File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1842,7 +1842,7 @@ where
1842
1842
. to_string ( )
1843
1843
. split_once ( '#' )
1844
1844
. unwrap ( )
1845
- . 0
1845
+ . 1
1846
1846
. to_string ( )
1847
1847
}
1848
1848
}
@@ -1938,6 +1938,22 @@ pub(crate) mod test {
1938
1938
// OP_PUSH.
1939
1939
const P2WPKH_FAKE_WITNESS_SIZE : usize = 106 ;
1940
1940
1941
+ #[ test]
1942
+ fn test_descriptor_checksum ( ) {
1943
+ let ( wallet, _, _) = get_funded_wallet ( get_test_wpkh ( ) ) ;
1944
+ let checksum = wallet. descriptor_checksum ( KeychainKind :: External ) ;
1945
+ assert_eq ! ( checksum. len( ) , 8 ) ;
1946
+
1947
+ let raw_descriptor = wallet
1948
+ . descriptor
1949
+ . to_string ( )
1950
+ . split_once ( '#' )
1951
+ . unwrap ( )
1952
+ . 0
1953
+ . to_string ( ) ;
1954
+ assert_eq ! ( get_checksum( & raw_descriptor) . unwrap( ) , checksum) ;
1955
+ }
1956
+
1941
1957
#[ test]
1942
1958
fn test_get_funded_wallet_balance ( ) {
1943
1959
let ( wallet, _, _) = get_funded_wallet ( get_test_wpkh ( ) ) ;
You can’t perform that action at this time.
0 commit comments