@@ -135,7 +135,7 @@ pub(super) fn from_txdata<'txin>(
135135 let pk = pk_from_stack_elem ( & elem, false ) ?;
136136 if * spk
137137 == bitcoin_primitives:: ScriptBuf :: new_p2pkh (
138- & pk. to_pubkeyhash ( SigType :: Ecdsa ) . into ( ) ,
138+ pk. to_pubkeyhash ( SigType :: Ecdsa ) . into ( ) ,
139139 )
140140 {
141141 Ok ( (
@@ -159,11 +159,11 @@ pub(super) fn from_txdata<'txin>(
159159 Some ( elem) => {
160160 let pk = pk_from_stack_elem ( & elem, true ) ?;
161161 let hash160 = pk. to_pubkeyhash ( SigType :: Ecdsa ) ;
162- if * spk == bitcoin_primitives:: ScriptBuf :: new_p2wpkh ( & hash160. into ( ) ) {
162+ if * spk == bitcoin_primitives:: ScriptBuf :: new_p2wpkh ( hash160. into ( ) ) {
163163 Ok ( (
164164 Inner :: PublicKey ( pk. into ( ) , PubkeyType :: Wpkh ) ,
165165 wit_stack,
166- Some ( bitcoin_primitives:: ScriptBuf :: new_p2pkh ( & hash160. into ( ) ) ) , // bip143, why..
166+ Some ( bitcoin_primitives:: ScriptBuf :: new_p2pkh ( hash160. into ( ) ) ) , // bip143, why..
167167 ) )
168168 } else {
169169 Err ( Error :: IncorrectWPubkeyHash )
@@ -183,7 +183,7 @@ pub(super) fn from_txdata<'txin>(
183183 let script = miniscript. encode ( ) ;
184184 let miniscript = miniscript. to_no_checks_ms ( ) ;
185185 let scripthash = sha256:: Hash :: hash ( script. as_bytes ( ) ) ;
186- if * spk == bitcoin_primitives:: ScriptBuf :: new_p2wsh ( & scripthash. into ( ) ) {
186+ if * spk == bitcoin_primitives:: ScriptBuf :: new_p2wsh ( scripthash. into ( ) ) {
187187 Ok ( ( Inner :: Script ( miniscript, ScriptType :: Wsh ) , wit_stack, Some ( script) ) )
188188 } else {
189189 Err ( Error :: IncorrectWScriptHash )
@@ -255,7 +255,7 @@ pub(super) fn from_txdata<'txin>(
255255 Some ( elem) => {
256256 if let stack:: Element :: Push ( slice) = elem {
257257 let scripthash = hash160:: Hash :: hash ( slice) ;
258- if * spk != bitcoin_primitives:: ScriptBuf :: new_p2sh ( & scripthash. into ( ) ) {
258+ if * spk != bitcoin_primitives:: ScriptBuf :: new_p2sh ( scripthash. into ( ) ) {
259259 return Err ( Error :: IncorrectScriptHash ) ;
260260 }
261261 // ** p2sh-wrapped wpkh **
@@ -269,15 +269,15 @@ pub(super) fn from_txdata<'txin>(
269269 let hash160 = pk. to_pubkeyhash ( SigType :: Ecdsa ) ;
270270 if slice
271271 == bitcoin_primitives:: ScriptBuf :: new_p2wpkh (
272- & hash160. into ( ) ,
272+ hash160. into ( ) ,
273273 )
274274 . as_bytes ( )
275275 {
276276 Ok ( (
277277 Inner :: PublicKey ( pk. into ( ) , PubkeyType :: ShWpkh ) ,
278278 wit_stack,
279279 Some ( bitcoin_primitives:: ScriptBuf :: new_p2pkh (
280- & hash160. into ( ) ,
280+ hash160. into ( ) ,
281281 ) ) , // bip143, why..
282282 ) )
283283 } else {
@@ -301,7 +301,7 @@ pub(super) fn from_txdata<'txin>(
301301 let scripthash = sha256:: Hash :: hash ( script. as_bytes ( ) ) ;
302302 if slice
303303 == bitcoin_primitives:: ScriptBuf :: new_p2wsh (
304- & scripthash. into ( ) ,
304+ scripthash. into ( ) ,
305305 )
306306 . as_bytes ( )
307307 {
@@ -325,7 +325,7 @@ pub(super) fn from_txdata<'txin>(
325325 let miniscript = miniscript. to_no_checks_ms ( ) ;
326326 if wit_stack. is_empty ( ) {
327327 let scripthash = hash160:: Hash :: hash ( script. as_bytes ( ) ) ;
328- if * spk == bitcoin_primitives:: ScriptBuf :: new_p2sh ( & scripthash. into ( ) ) {
328+ if * spk == bitcoin_primitives:: ScriptBuf :: new_p2sh ( scripthash. into ( ) ) {
329329 Ok ( ( Inner :: Script ( miniscript, ScriptType :: Sh ) , ssig_stack, Some ( script) ) )
330330 } else {
331331 Err ( Error :: IncorrectScriptHash )
@@ -444,12 +444,12 @@ mod tests {
444444
445445 let pkhash = key. to_pubkeyhash ( SigType :: Ecdsa ) . into ( ) ;
446446 let wpkhash = key. to_pubkeyhash ( SigType :: Ecdsa ) . into ( ) ;
447- let wpkh_spk = bitcoin_primitives:: ScriptBuf :: new_p2wpkh ( & wpkhash) ;
447+ let wpkh_spk = bitcoin_primitives:: ScriptBuf :: new_p2wpkh ( wpkhash) ;
448448 let wpkh_scripthash = hash160:: Hash :: hash ( wpkh_spk. as_bytes ( ) ) . into ( ) ;
449449
450450 KeyTestData {
451451 pk_spk : bitcoin_primitives:: ScriptBuf :: new_p2pk ( key) ,
452- pkh_spk : bitcoin_primitives:: ScriptBuf :: new_p2pkh ( & pkhash) ,
452+ pkh_spk : bitcoin_primitives:: ScriptBuf :: new_p2pkh ( pkhash) ,
453453 pk_sig : script:: Builder :: new ( ) . push_slice ( dummy_sig) . into_script ( ) ,
454454 pkh_sig : script:: Builder :: new ( )
455455 . push_slice ( dummy_sig)
@@ -459,7 +459,7 @@ mod tests {
459459 wpkh_spk : wpkh_spk. clone ( ) ,
460460 wpkh_stack : Witness :: from_slice ( & [ dummy_sig_vec. clone ( ) , key. to_bytes ( ) ] ) ,
461461 wpkh_stack_justkey : Witness :: from_slice ( & [ key. to_bytes ( ) ] ) ,
462- sh_wpkh_spk : bitcoin_primitives:: ScriptBuf :: new_p2sh ( & wpkh_scripthash) ,
462+ sh_wpkh_spk : bitcoin_primitives:: ScriptBuf :: new_p2sh ( wpkh_scripthash) ,
463463 sh_wpkh_sig : script:: Builder :: new ( )
464464 . push_slice ( <& PushBytes >:: try_from ( wpkh_spk[ ..] . as_bytes ( ) ) . unwrap ( ) )
465465 . into_script ( ) ,
@@ -734,7 +734,7 @@ mod tests {
734734 let ( miniscript, redeem_script) = ms_inner_script ( & format ! ( "hash160({})" , hash) ) ;
735735 let rs_hash = hash160:: Hash :: hash ( redeem_script. as_bytes ( ) ) . into ( ) ;
736736
737- let spk = ScriptBuf :: new_p2sh ( & rs_hash) ;
737+ let spk = ScriptBuf :: new_p2sh ( rs_hash) ;
738738 let script_sig = script:: Builder :: new ( )
739739 . push_slice ( <& PushBytes >:: try_from ( redeem_script. as_bytes ( ) ) . unwrap ( ) )
740740 . into_script ( ) ;
@@ -770,7 +770,7 @@ mod tests {
770770 let wit_hash = sha256:: Hash :: hash ( witness_script. as_bytes ( ) ) . into ( ) ;
771771 let wit_stack = Witness :: from_slice ( & [ witness_script. to_bytes ( ) ] ) ;
772772
773- let spk = ScriptBuf :: new_p2wsh ( & wit_hash) ;
773+ let spk = ScriptBuf :: new_p2wsh ( wit_hash) ;
774774 let blank_script = bitcoin_primitives:: ScriptBuf :: new ( ) ;
775775
776776 // wsh without witness
@@ -805,14 +805,14 @@ mod tests {
805805 let wit_hash = sha256:: Hash :: hash ( witness_script. as_bytes ( ) ) . into ( ) ;
806806 let wit_stack = Witness :: from_slice ( & [ witness_script. to_bytes ( ) ] ) ;
807807
808- let redeem_script = ScriptBuf :: new_p2wsh ( & wit_hash) ;
808+ let redeem_script = ScriptBuf :: new_p2wsh ( wit_hash) ;
809809 let script_sig = script:: Builder :: new ( )
810810 . push_slice ( <& PushBytes >:: try_from ( redeem_script. as_bytes ( ) ) . unwrap ( ) )
811811 . into_script ( ) ;
812812 let blank_script = bitcoin_primitives:: ScriptBuf :: new ( ) ;
813813
814814 let rs_hash = hash160:: Hash :: hash ( redeem_script. as_bytes ( ) ) . into ( ) ;
815- let spk = ScriptBuf :: new_p2sh ( & rs_hash) ;
815+ let spk = ScriptBuf :: new_p2sh ( rs_hash) ;
816816
817817 // shwsh without witness or scriptsig
818818 let err = from_txdata ( & spk, & blank_script, & Witness :: default ( ) ) . unwrap_err ( ) ;
0 commit comments