@@ -110,20 +110,16 @@ pub mod fns {
110
110
Ok ( ( psbt, errors) . into ( ) )
111
111
}
112
112
113
- // psbt::sign(Psbt, Xpriv|Array<Xpriv>|Array<SinglePk:SingleSk> sign_keys, Bool finalize=false ) -> Psbt
113
+ // psbt::sign(Psbt, Xpriv|Array<Xpriv>|Array<SinglePk:SingleSk> sign_keys) -> Psbt
114
114
//
115
115
// Attempt to sign all transaction inputs, raising an error if any fail.
116
116
pub fn sign ( args : Array , _: & ScopeRef ) -> Result < Value > {
117
- let ( mut psbt, keys, finalize ) : ( _ , _ , Option < bool > ) = args. args_into ( ) ?;
117
+ let ( mut psbt, keys) = args. args_into ( ) ?;
118
118
119
119
let ( _signed, failed) = sign_psbt ( & mut psbt, keys) ?;
120
120
ensure ! ( failed. is_empty( ) , Error :: PsbtSigning ( failed) ) ;
121
121
// XXX check signed?
122
122
123
- if finalize. unwrap_or ( false ) {
124
- psbt. finalize_mut ( & EC ) . map_err ( Error :: PsbtFinalize ) ?;
125
- }
126
-
127
123
Ok ( psbt. into ( ) )
128
124
}
129
125
@@ -139,15 +135,12 @@ pub mod fns {
139
135
Ok ( ( psbt, signed, failed) . into ( ) )
140
136
}
141
137
142
- /// psbt::extract(Psbt, Bool finalize=false ) -> Transaction
138
+ /// psbt::extract(Psbt) -> Transaction
143
139
///
144
- /// Extract the PSBT finalized transaction. Will run the Miniscript interpreter sanity checks.
145
- /// Also possible using `tx(Psbt)` (without the `finalize` option, for pre-finalized PSBT only)
140
+ /// Extract the PSBT finalized transaction (The PSBT must already be finalized).
141
+ /// Will run the Miniscript interpreter sanity checks. Also possible using `tx(Psbt)`.
146
142
pub fn extract ( args : Array , _: & ScopeRef ) -> Result < Value > {
147
- let ( mut psbt, finalize) : ( Psbt , Option < bool > ) = args. args_into ( ) ?;
148
- if finalize. unwrap_or ( false ) {
149
- psbt. finalize_mut ( & EC ) . map_err ( Error :: PsbtFinalize ) ?;
150
- }
143
+ let psbt: Psbt = args. arg_into ( ) ?;
151
144
// Uses rust-miniscript's PsbtExt::extract(), which only works with Miniscript-compatible Scripts
152
145
Ok ( psbt. extract ( & EC ) ?. into ( ) )
153
146
}
0 commit comments