@@ -1166,13 +1166,13 @@ mod tests {
1166
1166
use std:: str:: FromStr ;
1167
1167
use std:: string:: String ;
1168
1168
1169
- use miniscript:: { satisfy, Legacy , Segwitv0 } ;
1169
+ use miniscript:: { satisfy, Legacy , Segwitv0 , Tap } ;
1170
1170
use policy:: Liftable ;
1171
1171
use script_num_size;
1172
1172
1173
1173
type SPolicy = Concrete < String > ;
1174
1174
type BPolicy = Concrete < bitcoin:: PublicKey > ;
1175
- type DummySegwitAstElemExt = policy:: compiler:: AstElemExt < String , Segwitv0 > ;
1175
+ type DummyTapAstElemExt = policy:: compiler:: AstElemExt < String , Tap > ;
1176
1176
type SegwitMiniScript = Miniscript < bitcoin:: PublicKey , Segwitv0 > ;
1177
1177
1178
1178
fn pubkeys_and_a_sig ( n : usize ) -> ( Vec < bitcoin:: PublicKey > , secp256k1:: ecdsa:: Signature ) {
@@ -1262,7 +1262,7 @@ mod tests {
1262
1262
#[ test]
1263
1263
fn compile_q ( ) {
1264
1264
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 =
1266
1266
best_t ( & mut BTreeMap :: new ( ) , & policy, 1.0 , None ) . unwrap ( ) ;
1267
1267
1268
1268
assert_eq ! ( compilation. cost_1d( 1.0 , None ) , 88.0 + 74.109375 ) ;
@@ -1271,13 +1271,14 @@ mod tests {
1271
1271
compilation. ms. lift( ) . unwrap( ) . sorted( )
1272
1272
) ;
1273
1273
1274
+ // compile into taproot context to avoid limit errors
1274
1275
let policy = SPolicy :: from_str (
1275
1276
"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)))"
1276
1277
) . expect ( "parsing" ) ;
1277
- let compilation: DummySegwitAstElemExt =
1278
+ let compilation: DummyTapAstElemExt =
1278
1279
best_t ( & mut BTreeMap :: new ( ) , & policy, 1.0 , None ) . unwrap ( ) ;
1279
1280
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 ) ;
1281
1282
assert_eq ! (
1282
1283
policy. lift( ) . unwrap( ) . sorted( ) ,
1283
1284
compilation. ms. lift( ) . unwrap( ) . sorted( )
@@ -1563,9 +1564,9 @@ mod benches {
1563
1564
use test:: { black_box, Bencher } ;
1564
1565
1565
1566
use super :: { CompilerError , Concrete } ;
1566
- use miniscript:: Segwitv0 ;
1567
+ use miniscript:: Tap ;
1567
1568
use Miniscript ;
1568
- type SegwitMsRes = Result < Miniscript < String , Segwitv0 > , CompilerError > ;
1569
+ type TapMsRes = Result < Miniscript < String , Tap > , CompilerError > ;
1569
1570
#[ bench]
1570
1571
pub fn compile_basic ( bh : & mut Bencher ) {
1571
1572
let h = ( 0 ..64 ) . map ( |_| "a" ) . collect :: < String > ( ) ;
@@ -1575,7 +1576,7 @@ mod benches {
1575
1576
) )
1576
1577
. expect ( "parsing" ) ;
1577
1578
bh. iter ( || {
1578
- let pt: SegwitMsRes = pol. compile ( ) ;
1579
+ let pt: TapMsRes = pol. compile ( ) ;
1579
1580
black_box ( pt) . unwrap ( ) ;
1580
1581
} ) ;
1581
1582
}
@@ -1587,7 +1588,7 @@ mod benches {
1587
1588
& 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)
1588
1589
) . expect ( "parsing" ) ;
1589
1590
bh. iter ( || {
1590
- let pt: SegwitMsRes = pol. compile ( ) ;
1591
+ let pt: TapMsRes = pol. compile ( ) ;
1591
1592
black_box ( pt) . unwrap ( ) ;
1592
1593
} ) ;
1593
1594
}
@@ -1598,7 +1599,7 @@ mod benches {
1598
1599
"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)))"
1599
1600
) . expect ( "parsing" ) ;
1600
1601
bh. iter ( || {
1601
- let pt: SegwitMsRes = pol. compile ( ) ;
1602
+ let pt: TapMsRes = pol. compile ( ) ;
1602
1603
black_box ( pt) . unwrap ( ) ;
1603
1604
} ) ;
1604
1605
}
0 commit comments