@@ -551,14 +551,14 @@ mod tests {
551551 assert_eq ! ( script_code, Some ( uncomp. pk_spk) ) ;
552552
553553 // Scriptpubkey has invalid key
554- let mut spk = comp. pk_spk . to_bytes ( ) ;
554+ let mut spk = comp. pk_spk . to_vec ( ) ;
555555 spk[ 1 ] = 5 ;
556556 let spk = ScriptPubKeyBuf :: from ( spk) ;
557557 let err = from_txdata ( & spk, & ScriptSigBuf :: new ( ) , & empty_wit) . unwrap_err ( ) ;
558558 assert_eq ! ( err. to_string( ) , "could not parse pubkey" ) ;
559559
560560 // Scriptpubkey has invalid script
561- let mut spk = comp. pk_spk . to_bytes ( ) ;
561+ let mut spk = comp. pk_spk . to_vec ( ) ;
562562 spk[ 0 ] = 100 ;
563563 let spk = ScriptPubKeyBuf :: from ( spk) ;
564564 let err = from_txdata ( & spk, & ScriptSigBuf :: new ( ) , & empty_wit) . unwrap_err ( ) ;
@@ -785,7 +785,7 @@ mod tests {
785785 let hash = hash160:: Hash :: hash ( & preimage[ ..] ) ;
786786 let ( miniscript, witness_script) = ms_inner_script ( & format ! ( "hash160({})" , hash) ) ;
787787 let wit_hash = bitcoin:: script:: WScriptHash :: from_byte_array ( sha256:: Hash :: hash ( witness_script. as_bytes ( ) ) . to_byte_array ( ) ) ;
788- let wit_stack = Witness :: from_slice ( & [ witness_script. to_bytes ( ) ] ) ;
788+ let wit_stack = Witness :: from_slice ( & [ witness_script. to_vec ( ) ] ) ;
789789
790790 let spk = ScriptPubKeyBuf :: new_p2wsh ( wit_hash) ;
791791 let blank_script = ScriptSigBuf :: new ( ) ;
@@ -795,7 +795,7 @@ mod tests {
795795 assert_eq ! ( & err. to_string( ) , "unexpected end of stack" ) ;
796796
797797 // with incorrect witness
798- let wit = Witness :: from_slice ( & [ spk. to_bytes ( ) ] ) ;
798+ let wit = Witness :: from_slice ( & [ spk. to_vec ( ) ] ) ;
799799 let err = from_txdata ( & spk, & blank_script, & wit) . unwrap_err ( ) ;
800800 assert_eq ! ( & err. to_string( ) [ 0 ..12 ] , "parse error:" ) ;
801801
@@ -820,7 +820,7 @@ mod tests {
820820 let hash = hash160:: Hash :: hash ( & preimage[ ..] ) ;
821821 let ( miniscript, witness_script) = ms_inner_script ( & format ! ( "hash160({})" , hash) ) ;
822822 let wit_hash = bitcoin:: script:: WScriptHash :: from_byte_array ( sha256:: Hash :: hash ( witness_script. as_bytes ( ) ) . to_byte_array ( ) ) ;
823- let wit_stack = Witness :: from_slice ( & [ witness_script. to_bytes ( ) ] ) ;
823+ let wit_stack = Witness :: from_slice ( & [ witness_script. to_vec ( ) ] ) ;
824824
825825 let redeem_script = ScriptPubKeyBuf :: new_p2wsh ( wit_hash) ;
826826 let script_sig = script:: Builder :: new ( )
@@ -840,12 +840,12 @@ mod tests {
840840 assert_eq ! ( & err. to_string( ) , "unexpected end of stack" ) ;
841841
842842 // with incorrect witness
843- let wit = Witness :: from_slice ( & [ spk. to_bytes ( ) ] ) ;
843+ let wit = Witness :: from_slice ( & [ spk. to_vec ( ) ] ) ;
844844 let err = from_txdata ( & spk, & script_sig, & wit) . unwrap_err ( ) ;
845845 assert_eq ! ( & err. to_string( ) [ 0 ..12 ] , "parse error:" ) ;
846846
847847 // with incorrect scriptsig
848- let incorrect_sig = ScriptSigBuf :: from ( redeem_script. to_bytes ( ) ) ;
848+ let incorrect_sig = ScriptSigBuf :: from ( redeem_script. to_vec ( ) ) ;
849849 let err = from_txdata ( & spk, & incorrect_sig, & wit_stack) . unwrap_err ( ) ;
850850 assert_eq ! ( & err. to_string( ) , "redeem script did not match scriptpubkey" ) ;
851851
0 commit comments