File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -955,4 +955,19 @@ mod tests {
955955 let pset = encode:: deserialize :: < PartiallySignedTransaction > ( & bytes) . unwrap ( ) ;
956956 assert_eq ! ( & back_hex, & encode:: serialize( & pset) . to_hex( ) ) ;
957957 }
958+
959+ #[ test]
960+ fn pset_remove_in_out ( ) {
961+ let pset_str = include_str ! ( "../../tests/data/pset_swap_tutorial.hex" ) ;
962+
963+ let bytes = Vec :: < u8 > :: from_hex ( pset_str) . unwrap ( ) ;
964+ let mut pset = encode:: deserialize :: < PartiallySignedTransaction > ( & bytes) . unwrap ( ) ;
965+
966+ let n_inputs = pset. n_inputs ( ) ;
967+ let n_outputs = pset. n_outputs ( ) ;
968+ pset. remove_input ( n_inputs - 1 ) . unwrap ( ) ;
969+ pset. remove_output ( n_outputs - 1 ) . unwrap ( ) ;
970+ assert_eq ! ( pset. n_inputs( ) , n_inputs - 1 ) ;
971+ assert_eq ! ( pset. n_outputs( ) , n_outputs - 1 ) ;
972+ }
958973}
You can’t perform that action at this time.
0 commit comments