BIP32 KeySource refactored to type aliace

This commit is contained in:
Dr Maxim Orlovsky 2020-09-14 00:37:29 +02:00
parent aa67f10162
commit c098dfa7f2
3 changed files with 3 additions and 4 deletions

View File

@ -347,8 +347,7 @@ impl fmt::Debug for DerivationPath {
/// Full information on the used extended public key: fingerprint of the
/// master extended public key and a derivation path from it.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct KeySource(pub Fingerprint, pub DerivationPath);
pub type KeySource = (Fingerprint, DerivationPath);
/// A BIP32 error
#[derive(Clone, PartialEq, Eq, Debug)]

View File

@ -227,7 +227,7 @@ mod tests {
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 {
redeem_script: Some(hex_script!(

View File

@ -101,7 +101,7 @@ impl Deserialize for KeySource {
}
}
Ok(KeySource(fprint, dpath.into()))
Ok((fprint, dpath.into()))
}
}