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 20
20
//!
21
21
22
22
use bitcoin:: util:: sighash:: Prevouts ;
23
- use util:: { script_is_v1_tr , witness_size} ;
23
+ use util:: witness_size;
24
24
25
25
use super :: { sanity_check, Psbt } ;
26
26
use super :: { Error , InputError , PsbtInputSatisfier } ;
@@ -45,7 +45,7 @@ fn construct_tap_witness(
45
45
sat : & PsbtInputSatisfier ,
46
46
allow_mall : bool ,
47
47
) -> Result < Vec < Vec < u8 > > , InputError > {
48
- assert ! ( script_is_v1_tr ( & spk) ) ;
48
+ assert ! ( spk. is_v1_p2tr ( ) ) ;
49
49
50
50
// try the script spend path first
51
51
if let Some ( sig) =
@@ -383,7 +383,7 @@ pub fn finalize_helper<C: secp256k1::Verification>(
383
383
let spk = get_scriptpubkey ( psbt, index) . map_err ( |e| Error :: InputError ( e, index) ) ?;
384
384
let sat = PsbtInputSatisfier :: new ( & psbt, index) ;
385
385
386
- if script_is_v1_tr ( spk) {
386
+ if spk. is_v1_p2tr ( ) {
387
387
// Deal with tr case separately, unfortunately we cannot infer the full descriptor for Tr
388
388
let wit = construct_tap_witness ( spk, & sat, allow_mall)
389
389
. map_err ( |e| Error :: InputError ( e, index) ) ?;
Original file line number Diff line number Diff line change 1
1
use bitcoin;
2
- use bitcoin:: blockdata:: opcodes;
3
2
use bitcoin:: blockdata:: script;
4
- use bitcoin:: blockdata:: script:: Instruction ;
5
3
use bitcoin:: Script ;
6
4
use miniscript:: context;
7
5
@@ -48,15 +46,3 @@ impl MsKeyBuilder for script::Builder {
48
46
}
49
47
}
50
48
}
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