@@ -200,17 +200,8 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
200
200
{
201
201
// Only satisfactions for default versions (0xc0) are allowed.
202
202
let leaf_hash = TapLeafHash :: from_script ( & self . encode ( ) , LeafVersion :: TapScript ) ;
203
- match satisfy:: Satisfaction :: satisfy ( & self . node , & satisfier, self . ty . mall . safe , & leaf_hash)
204
- . stack
205
- {
206
- satisfy:: Witness :: Stack ( stack) => {
207
- Ctx :: check_witness :: < Pk > ( & stack) ?;
208
- Ok ( stack)
209
- }
210
- satisfy:: Witness :: Unavailable | satisfy:: Witness :: Impossible => {
211
- Err ( Error :: CouldNotSatisfy )
212
- }
213
- }
203
+ let satisfaction = satisfy:: Satisfaction :: satisfy ( & self . node , & satisfier, self . ty . mall . safe , & leaf_hash) ;
204
+ self . _satisfy ( satisfaction)
214
205
}
215
206
216
207
/// Attempt to produce a malleable satisfying witness for the
@@ -223,14 +214,15 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
223
214
Pk : ToPublicKey ,
224
215
{
225
216
let leaf_hash = TapLeafHash :: from_script ( & self . encode ( ) , LeafVersion :: TapScript ) ;
226
- match satisfy:: Satisfaction :: satisfy_mall (
227
- & self . node ,
228
- & satisfier,
229
- self . ty . mall . safe ,
230
- & leaf_hash,
231
- )
232
- . stack
233
- {
217
+ let satisfaction = satisfy:: Satisfaction :: satisfy_mall ( & self . node , & satisfier, self . ty . mall . safe , & leaf_hash) ;
218
+ self . _satisfy ( satisfaction)
219
+ }
220
+
221
+ fn _satisfy ( & self , satisfaction : satisfy:: Satisfaction ) -> Result < Vec < Vec < u8 > > , Error >
222
+ where
223
+ Pk : ToPublicKey ,
224
+ {
225
+ match satisfaction. stack {
234
226
satisfy:: Witness :: Stack ( stack) => {
235
227
Ctx :: check_witness :: < Pk > ( & stack) ?;
236
228
Ok ( stack)
0 commit comments