File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1545,8 +1545,6 @@ mod tests {
15451545
15461546 #[ test]
15471547 fn sighash_single_bug ( ) {
1548- const SIGHASH_SINGLE : u32 = 3 ;
1549-
15501548 // We need a tx with more inputs than outputs.
15511549 let tx = Transaction {
15521550 version : transaction:: Version :: ONE ,
@@ -1557,10 +1555,16 @@ mod tests {
15571555 let script = ScriptBuf :: new ( ) ;
15581556 let cache = SighashCache :: new ( & tx) ;
15591557
1560- let got = cache. legacy_signature_hash ( 1 , & script, SIGHASH_SINGLE ) . expect ( "sighash" ) ;
1558+ let sighash_single = 3 ;
1559+ let got = cache. legacy_signature_hash ( 1 , & script, sighash_single) . expect ( "sighash" ) ;
15611560 let want = LegacySighash :: from_byte_array ( UINT256_ONE ) ;
1561+ assert_eq ! ( got, want) ;
15621562
1563- assert_eq ! ( got, want)
1563+ // https://github.com/rust-bitcoin/rust-bitcoin/issues/4112
1564+ let sighash_single = 131 ;
1565+ let got = cache. legacy_signature_hash ( 1 , & script, sighash_single) . expect ( "sighash" ) ;
1566+ let want = LegacySighash :: from_byte_array ( UINT256_ONE ) ;
1567+ assert_eq ! ( got, want) ;
15641568 }
15651569
15661570 #[ test]
You can’t perform that action at this time.
0 commit comments