File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
fuzz/fuzz_targets/bitcoin Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ fn do_test(data: &[u8]) {
1010
1111 if let Ok ( mut tx) = t {
1212 let serialized = serialize ( & tx) ;
13+ let deserialized: Result < Transaction , _ > = deserialize ( serialized. as_slice ( ) ) ;
14+ assert ! ( deserialized. is_ok( ) , "Deserialization error: {:?}" , deserialized. err( ) . unwrap( ) ) ;
15+ assert_eq ! ( deserialized. unwrap( ) , tx) ;
16+
1317 let len = serialized. len ( ) ;
1418 let calculated_weight = tx. weight ( ) . to_wu ( ) as usize ;
1519 for input in & mut tx. inputs {
@@ -25,10 +29,6 @@ fn do_test(data: &[u8]) {
2529 } else {
2630 assert_eq ! ( no_witness_len * 3 + len, calculated_weight) ;
2731 }
28-
29- let deserialized: Result < Transaction , _ > = deserialize ( serialized. as_slice ( ) ) ;
30- assert ! ( deserialized. is_ok( ) , "Deserialization error: {:?}" , deserialized. err( ) . unwrap( ) ) ;
31- assert_eq ! ( deserialized. unwrap( ) , tx) ;
3232 }
3333}
3434
You can’t perform that action at this time.
0 commit comments