@@ -651,7 +651,7 @@ mod tests {
651651 //
652652 // Since the first branch's dissatisfaction is HASSIG but the second branch's is not,
653653 // the satisfier is required to dissatisfy the second branch to avoid malleability.
654- // However, because of #976, it does not .
654+ // But if we use `into_plan_mall` we can see the bug .
655655 //
656656 // Itstead, it takes both the after(144) and after(50) branches, and the resulting
657657 // plan should show after(144) since it's the higher one. However, prior to #895,
@@ -664,9 +664,12 @@ mod tests {
664664 // Need DefiniteDescriptorKey https://github.com/rust-bitcoin/rust-miniscript/issues/927
665665 let descriptor =
666666 Descriptor :: < crate :: DefiniteDescriptorKey > :: from_str ( & descriptor_str) . unwrap ( ) ;
667- // Compute plan and confirm the timelock is correct.
668- let plan = descriptor. into_plan ( & satisfier) . unwrap ( ) ;
667+ // Compute plan and confirm the timelock is correct -- 144 for a malleable transaction
668+ let plan = descriptor. clone ( ) . into_plan_mall ( & satisfier) . unwrap ( ) ;
669669 assert_eq ! ( plan. absolute_timelock, Some ( absolute:: LockTime :: from_height( 144 ) . unwrap( ) ) , ) ;
670+ // ...and 50 for a non-malleable one (since take the expensive_threshold alternate)
671+ let plan = descriptor. into_plan ( & satisfier) . unwrap ( ) ;
672+ assert_eq ! ( plan. absolute_timelock, Some ( absolute:: LockTime :: from_height( 50 ) . unwrap( ) ) , ) ;
670673
671674 // Same descriptor as above, except that now we use a time-based timelock rather than a
672675 // lower height-based one.
@@ -690,7 +693,7 @@ mod tests {
690693 let descriptor =
691694 Descriptor :: < crate :: DefiniteDescriptorKey > :: from_str ( & descriptor_str) . unwrap ( ) ;
692695
693- let plan = descriptor. into_plan ( & satisfier) . unwrap ( ) ;
696+ let plan = descriptor. into_plan_mall ( & satisfier) . unwrap ( ) ;
694697 assert_eq ! (
695698 plan. absolute_timelock,
696699 Some ( absolute:: LockTime :: from_time( 1000000000 ) . unwrap( ) ) ,
0 commit comments