File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change 2020//!
2121
2222use bitcoin:: util:: sighash:: Prevouts ;
23- use util:: { script_is_v1_tr , witness_size} ;
23+ use util:: witness_size;
2424
2525use super :: { sanity_check, Psbt } ;
2626use super :: { Error , InputError , PsbtInputSatisfier } ;
@@ -45,7 +45,7 @@ fn construct_tap_witness(
4545 sat : & PsbtInputSatisfier ,
4646 allow_mall : bool ,
4747) -> Result < Vec < Vec < u8 > > , InputError > {
48- assert ! ( script_is_v1_tr ( & spk) ) ;
48+ assert ! ( spk. is_v1_p2tr ( ) ) ;
4949
5050 // try the script spend path first
5151 if let Some ( sig) =
@@ -383,7 +383,7 @@ pub fn finalize_helper<C: secp256k1::Verification>(
383383 let spk = get_scriptpubkey ( psbt, index) . map_err ( |e| Error :: InputError ( e, index) ) ?;
384384 let sat = PsbtInputSatisfier :: new ( & psbt, index) ;
385385
386- if script_is_v1_tr ( spk) {
386+ if spk. is_v1_p2tr ( ) {
387387 // Deal with tr case separately, unfortunately we cannot infer the full descriptor for Tr
388388 let wit = construct_tap_witness ( spk, & sat, allow_mall)
389389 . map_err ( |e| Error :: InputError ( e, index) ) ?;
Original file line number Diff line number Diff line change 11use bitcoin;
2- use bitcoin:: blockdata:: opcodes;
32use bitcoin:: blockdata:: script;
4- use bitcoin:: blockdata:: script:: Instruction ;
53use bitcoin:: Script ;
64use miniscript:: context;
75
@@ -48,15 +46,3 @@ impl MsKeyBuilder for script::Builder {
4846 }
4947 }
5048}
51-
52- // This belongs in rust-bitcoin, make this upstream later
53- pub ( crate ) fn script_is_v1_tr ( s : & Script ) -> bool {
54- let mut iter = s. instructions_minimal ( ) ;
55- if s. len ( ) != 32
56- || iter. next ( ) != Some ( Ok ( Instruction :: Op ( opcodes:: all:: OP_PUSHNUM_1 ) ) )
57- || iter. next ( ) != Some ( Ok ( Instruction :: Op ( opcodes:: all:: OP_PUSHBYTES_32 ) ) )
58- {
59- return false ;
60- }
61- return true ;
62- }
You can’t perform that action at this time.
0 commit comments