@@ -21,7 +21,7 @@ use crate::miniscript::ScriptContext;
21
21
use crate :: prelude:: * ;
22
22
use crate :: util:: MsKeyBuilder ;
23
23
use crate :: {
24
- errstr, expression, script_num_size, AbsLockTime , Error , ForEachKey , Miniscript , MiniscriptKey ,
24
+ errstr, expression, script_num_size, AbsLockTime , Error , Miniscript , MiniscriptKey ,
25
25
Terminal , ToPublicKey , TranslateErr , TranslatePk , Translator ,
26
26
} ;
27
27
64
64
}
65
65
66
66
impl < Pk : MiniscriptKey , Ctx : ScriptContext > Terminal < Pk , Ctx > {
67
- pub ( super ) fn real_for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , pred : & mut F ) -> bool {
68
- match * self {
69
- Terminal :: PkK ( ref p) => pred ( p) ,
70
- Terminal :: PkH ( ref p) => pred ( p) ,
71
- Terminal :: RawPkH ( ..)
72
- | Terminal :: After ( ..)
73
- | Terminal :: Older ( ..)
74
- | Terminal :: Sha256 ( ..)
75
- | Terminal :: Hash256 ( ..)
76
- | Terminal :: Ripemd160 ( ..)
77
- | Terminal :: Hash160 ( ..)
78
- | Terminal :: True
79
- | Terminal :: False => true ,
80
- Terminal :: Alt ( ref sub)
81
- | Terminal :: Swap ( ref sub)
82
- | Terminal :: Check ( ref sub)
83
- | Terminal :: DupIf ( ref sub)
84
- | Terminal :: Verify ( ref sub)
85
- | Terminal :: NonZero ( ref sub)
86
- | Terminal :: ZeroNotEqual ( ref sub) => sub. real_for_each_key ( pred) ,
87
- Terminal :: AndV ( ref left, ref right)
88
- | Terminal :: AndB ( ref left, ref right)
89
- | Terminal :: OrB ( ref left, ref right)
90
- | Terminal :: OrD ( ref left, ref right)
91
- | Terminal :: OrC ( ref left, ref right)
92
- | Terminal :: OrI ( ref left, ref right) => {
93
- left. real_for_each_key ( & mut * pred) && right. real_for_each_key ( pred)
94
- }
95
- Terminal :: AndOr ( ref a, ref b, ref c) => {
96
- a. real_for_each_key ( & mut * pred)
97
- && b. real_for_each_key ( & mut * pred)
98
- && c. real_for_each_key ( pred)
99
- }
100
- Terminal :: Thresh ( _, ref subs) => subs. iter ( ) . all ( |sub| sub. real_for_each_key ( pred) ) ,
101
- Terminal :: Multi ( _, ref keys) | Terminal :: MultiA ( _, ref keys) => keys. iter ( ) . all ( pred) ,
102
- }
103
- }
104
-
105
67
pub ( super ) fn real_translate_pk < Q , CtxQ , T , E > (
106
68
& self ,
107
69
t : & mut T ,
@@ -250,12 +212,6 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Terminal<Pk, Ctx> {
250
212
}
251
213
}
252
214
253
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > ForEachKey < Pk > for Terminal < Pk , Ctx > {
254
- fn for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , mut pred : F ) -> bool {
255
- self . real_for_each_key ( & mut pred)
256
- }
257
- }
258
-
259
215
impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Debug for Terminal < Pk , Ctx > {
260
216
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
261
217
f. write_str ( "[" ) ?;
0 commit comments