To prevent situations like this:
|
/// Creates scriptPubkey for specific derive pattern in pre-taproot |
|
/// descriptors |
|
fn script_pubkey_pretr<C: Verification>( |
|
&self, |
|
secp: &Secp256k1<C>, |
|
pat: impl AsRef<[UnhardenedIndex]>, |
|
) -> Result<Script, DeriveError>; |
|
|
|
/// Creates scriptPubkey for specific derive pattern in taproot descriptors |
|
fn script_pubkey_tr<C: Verification>( |
|
&self, |
|
secp: &Secp256k1<C>, |
|
pat: impl AsRef<[UnhardenedIndex]>, |
|
) -> Result<Script, DeriveError>; |
and like this, where a potential bugs may happen:
|
let scripts = indexes |
|
.into_iter() |
|
.map(|index| { |
|
if let Some(i) = derivation.borrow_mut().last_mut() { |
|
*i = index |
|
} |
|
Ok(( |
|
index, |
|
descriptor.script_pubkey_pretr(secp, &*derivation.borrow())?, |
|
)) |
|
}) |
|
.collect::<Result<BTreeMap<_, _>, DeriveError>>()?; |
To prevent situations like this:
descriptor-wallet/descriptors/src/derive.rs
Lines 63 to 76 in bc7a08d
and like this, where a potential bugs may happen:
descriptor-wallet/onchain/src/resolvers/mod.rs
Lines 119 to 130 in bc7a08d