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