BIP32 KeySource refactored to type aliace
This commit is contained in:
parent
aa67f10162
commit
c098dfa7f2
|
@ -347,8 +347,7 @@ impl fmt::Debug for DerivationPath {
|
||||||
|
|
||||||
/// Full information on the used extended public key: fingerprint of the
|
/// Full information on the used extended public key: fingerprint of the
|
||||||
/// master extended public key and a derivation path from it.
|
/// master extended public key and a derivation path from it.
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
|
pub type KeySource = (Fingerprint, DerivationPath);
|
||||||
pub struct KeySource(pub Fingerprint, pub DerivationPath);
|
|
||||||
|
|
||||||
/// A BIP32 error
|
/// A BIP32 error
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
|
|
|
@ -227,7 +227,7 @@ mod tests {
|
||||||
|
|
||||||
let pk: ExtendedPubKey = ExtendedPubKey::from_private(&secp, &sk);
|
let pk: ExtendedPubKey = ExtendedPubKey::from_private(&secp, &sk);
|
||||||
|
|
||||||
hd_keypaths.insert(pk.public_key, KeySource(fprint, dpath.into()));
|
hd_keypaths.insert(pk.public_key, (fprint, dpath.into()));
|
||||||
|
|
||||||
let expected: Output = Output {
|
let expected: Output = Output {
|
||||||
redeem_script: Some(hex_script!(
|
redeem_script: Some(hex_script!(
|
||||||
|
|
|
@ -101,7 +101,7 @@ impl Deserialize for KeySource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(KeySource(fprint, dpath.into()))
|
Ok((fprint, dpath.into()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue