Fix Wallet::descriptor_checksum
to actually return the checksum
This commit is contained in:
parent
b14e4ee3a0
commit
af0b3698c6
@ -1842,7 +1842,7 @@ where
|
||||
.to_string()
|
||||
.split_once('#')
|
||||
.unwrap()
|
||||
.0
|
||||
.1
|
||||
.to_string()
|
||||
}
|
||||
}
|
||||
@ -1938,6 +1938,22 @@ pub(crate) mod test {
|
||||
// OP_PUSH.
|
||||
const P2WPKH_FAKE_WITNESS_SIZE: usize = 106;
|
||||
|
||||
#[test]
|
||||
fn test_descriptor_checksum() {
|
||||
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
|
||||
let checksum = wallet.descriptor_checksum(KeychainKind::External);
|
||||
assert_eq!(checksum.len(), 8);
|
||||
|
||||
let raw_descriptor = wallet
|
||||
.descriptor
|
||||
.to_string()
|
||||
.split_once('#')
|
||||
.unwrap()
|
||||
.0
|
||||
.to_string();
|
||||
assert_eq!(get_checksum(&raw_descriptor).unwrap(), checksum);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_get_funded_wallet_balance() {
|
||||
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
|
||||
|
Loading…
x
Reference in New Issue
Block a user