@@ -52,10 +52,10 @@ mod ms_tests;
52
52
mod private {
53
53
use core:: marker:: PhantomData ;
54
54
55
- use super :: types:: { ExtData , Type } ;
55
+ use super :: limits:: { MAX_PUBKEYS_IN_CHECKSIGADD , MAX_PUBKEYS_PER_MULTISIG } ;
56
+ use super :: types:: { self , ExtData , Type } ;
56
57
use crate :: iter:: TreeLike as _;
57
58
pub use crate :: miniscript:: context:: ScriptContext ;
58
- use crate :: miniscript:: types;
59
59
use crate :: prelude:: sync:: Arc ;
60
60
use crate :: { AbsLockTime , Error , MiniscriptKey , RelLockTime , Terminal , MAX_RECURSION_DEPTH } ;
61
61
@@ -270,6 +270,28 @@ mod private {
270
270
}
271
271
}
272
272
273
+ // non-const because Thresh::n is not becasue Vec::len is not (needs Rust 1.87)
274
+ /// The `multi` combinator.
275
+ pub fn multi ( thresh : crate :: Threshold < Pk , MAX_PUBKEYS_PER_MULTISIG > ) -> Self {
276
+ Self {
277
+ ty : types:: Type :: multi ( ) ,
278
+ ext : types:: extra_props:: ExtData :: multi ( thresh. k ( ) , thresh. n ( ) ) ,
279
+ node : Terminal :: Multi ( thresh) ,
280
+ phantom : PhantomData ,
281
+ }
282
+ }
283
+
284
+ // non-const because Thresh::n is not becasue Vec::len is not
285
+ /// The `multi` combinator.
286
+ pub fn multi_a ( thresh : crate :: Threshold < Pk , MAX_PUBKEYS_IN_CHECKSIGADD > ) -> Self {
287
+ Self {
288
+ ty : types:: Type :: multi_a ( ) ,
289
+ ext : types:: extra_props:: ExtData :: multi_a ( thresh. k ( ) , thresh. n ( ) ) ,
290
+ node : Terminal :: MultiA ( thresh) ,
291
+ phantom : PhantomData ,
292
+ }
293
+ }
294
+
273
295
/// Add type information(Type and Extdata) to Miniscript based on
274
296
/// `AstElem` fragment. Dependent on display and clone because of Error
275
297
/// Display code of type_check.
0 commit comments