@@ -1166,13 +1166,13 @@ mod tests {
11661166 use std:: str:: FromStr ;
11671167 use std:: string:: String ;
11681168
1169- use miniscript:: { satisfy, Legacy , Segwitv0 } ;
1169+ use miniscript:: { satisfy, Legacy , Segwitv0 , Tap } ;
11701170 use policy:: Liftable ;
11711171 use script_num_size;
11721172
11731173 type SPolicy = Concrete < String > ;
11741174 type BPolicy = Concrete < bitcoin:: PublicKey > ;
1175- type DummySegwitAstElemExt = policy:: compiler:: AstElemExt < String , Segwitv0 > ;
1175+ type DummyTapAstElemExt = policy:: compiler:: AstElemExt < String , Tap > ;
11761176 type SegwitMiniScript = Miniscript < bitcoin:: PublicKey , Segwitv0 > ;
11771177
11781178 fn pubkeys_and_a_sig ( n : usize ) -> ( Vec < bitcoin:: PublicKey > , secp256k1:: ecdsa:: Signature ) {
@@ -1262,7 +1262,7 @@ mod tests {
12621262 #[ test]
12631263 fn compile_q ( ) {
12641264 let policy = SPolicy :: from_str ( "or(1@and(pk(A),pk(B)),127@pk(C))" ) . expect ( "parsing" ) ;
1265- let compilation: DummySegwitAstElemExt =
1265+ let compilation: DummyTapAstElemExt =
12661266 best_t ( & mut BTreeMap :: new ( ) , & policy, 1.0 , None ) . unwrap ( ) ;
12671267
12681268 assert_eq ! ( compilation. cost_1d( 1.0 , None ) , 88.0 + 74.109375 ) ;
@@ -1271,13 +1271,14 @@ mod tests {
12711271 compilation. ms. lift( ) . unwrap( ) . sorted( )
12721272 ) ;
12731273
1274+ // compile into taproot context to avoid limit errors
12741275 let policy = SPolicy :: from_str (
12751276 "and(and(and(or(127@thresh(2,pk(A),pk(B),thresh(2,or(127@pk(A),1@pk(B)),after(100),or(and(pk(C),after(200)),and(pk(D),sha256(66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925))),pk(E))),1@pk(F)),sha256(66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925)),or(127@pk(G),1@after(300))),or(127@after(400),pk(H)))"
12761277 ) . expect ( "parsing" ) ;
1277- let compilation: DummySegwitAstElemExt =
1278+ let compilation: DummyTapAstElemExt =
12781279 best_t ( & mut BTreeMap :: new ( ) , & policy, 1.0 , None ) . unwrap ( ) ;
12791280
1280- assert_eq ! ( compilation. cost_1d( 1.0 , None ) , 437 .0 + 299.4003295898438 ) ;
1281+ assert_eq ! ( compilation. cost_1d( 1.0 , None ) , 438 .0 + 299.4003295898438 ) ;
12811282 assert_eq ! (
12821283 policy. lift( ) . unwrap( ) . sorted( ) ,
12831284 compilation. ms. lift( ) . unwrap( ) . sorted( )
@@ -1563,9 +1564,9 @@ mod benches {
15631564 use test:: { black_box, Bencher } ;
15641565
15651566 use super :: { CompilerError , Concrete } ;
1566- use miniscript:: Segwitv0 ;
1567+ use miniscript:: Tap ;
15671568 use Miniscript ;
1568- type SegwitMsRes = Result < Miniscript < String , Segwitv0 > , CompilerError > ;
1569+ type TapMsRes = Result < Miniscript < String , Tap > , CompilerError > ;
15691570 #[ bench]
15701571 pub fn compile_basic ( bh : & mut Bencher ) {
15711572 let h = ( 0 ..64 ) . map ( |_| "a" ) . collect :: < String > ( ) ;
@@ -1575,7 +1576,7 @@ mod benches {
15751576 ) )
15761577 . expect ( "parsing" ) ;
15771578 bh. iter ( || {
1578- let pt: SegwitMsRes = pol. compile ( ) ;
1579+ let pt: TapMsRes = pol. compile ( ) ;
15791580 black_box ( pt) . unwrap ( ) ;
15801581 } ) ;
15811582 }
@@ -1587,7 +1588,7 @@ mod benches {
15871588 & format ! ( "or(pk(L),thresh(9,sha256({}),pk(A),pk(B),and(or(pk(C),pk(D)),pk(E)),after(100),pk(F),pk(G),pk(H),pk(I),and(pk(J),pk(K))))" , h)
15881589 ) . expect ( "parsing" ) ;
15891590 bh. iter ( || {
1590- let pt: SegwitMsRes = pol. compile ( ) ;
1591+ let pt: TapMsRes = pol. compile ( ) ;
15911592 black_box ( pt) . unwrap ( ) ;
15921593 } ) ;
15931594 }
@@ -1598,7 +1599,7 @@ mod benches {
15981599 "or(pk(A),thresh(4,pk(B),older(100),pk(C),and(after(100),or(pk(D),or(pk(E),and(pk(F),thresh(2,pk(G),or(pk(H),and(thresh(5,pk(I),or(pk(J),pk(K)),pk(L),pk(M),pk(N),pk(O),pk(P),pk(Q),pk(R),pk(S),pk(T)),pk(U))),pk(V),or(and(pk(W),pk(X)),pk(Y)),after(100)))))),pk(Z)))"
15991600 ) . expect ( "parsing" ) ;
16001601 bh. iter ( || {
1601- let pt: SegwitMsRes = pol. compile ( ) ;
1602+ let pt: TapMsRes = pol. compile ( ) ;
16021603 black_box ( pt) . unwrap ( ) ;
16031604 } ) ;
16041605 }
0 commit comments