@@ -44,7 +44,7 @@ const ENTAILMENT_MAX_TERMINALS: usize = 20;
44
44
/// exceed resource limits for any compilation but cannot detect such policies
45
45
/// while lifting. Note that our compiler would not succeed for any such
46
46
/// policies.
47
- pub trait Liftable < Pk : MiniscriptKey > {
47
+ pub trait Lift < Pk : MiniscriptKey > {
48
48
/// Converts this object into an abstract policy.
49
49
fn lift ( & self ) -> Result < Semantic < Pk > , Error > ;
50
50
}
@@ -104,7 +104,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
104
104
}
105
105
}
106
106
107
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > Liftable < Pk > for Miniscript < Pk , Ctx > {
107
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > Lift < Pk > for Miniscript < Pk , Ctx > {
108
108
fn lift ( & self ) -> Result < Semantic < Pk > , Error > {
109
109
// check whether the root miniscript can have a spending path that is
110
110
// a combination of heightlock and timelock
@@ -113,7 +113,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for Miniscript<Pk, Ctx>
113
113
}
114
114
}
115
115
116
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > Liftable < Pk > for Terminal < Pk , Ctx > {
116
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > Lift < Pk > for Terminal < Pk , Ctx > {
117
117
fn lift ( & self ) -> Result < Semantic < Pk > , Error > {
118
118
let ret = match * self {
119
119
Terminal :: PkK ( ref pk) | Terminal :: PkH ( ref pk) => Semantic :: Key ( pk. clone ( ) ) ,
@@ -164,7 +164,7 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for Terminal<Pk, Ctx> {
164
164
}
165
165
}
166
166
167
- impl < Pk : MiniscriptKey > Liftable < Pk > for Descriptor < Pk > {
167
+ impl < Pk : MiniscriptKey > Lift < Pk > for Descriptor < Pk > {
168
168
fn lift ( & self ) -> Result < Semantic < Pk > , Error > {
169
169
match * self {
170
170
Descriptor :: Bare ( ref bare) => bare. lift ( ) ,
@@ -177,11 +177,11 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Descriptor<Pk> {
177
177
}
178
178
}
179
179
180
- impl < Pk : MiniscriptKey > Liftable < Pk > for Semantic < Pk > {
180
+ impl < Pk : MiniscriptKey > Lift < Pk > for Semantic < Pk > {
181
181
fn lift ( & self ) -> Result < Semantic < Pk > , Error > { Ok ( self . clone ( ) ) }
182
182
}
183
183
184
- impl < Pk : MiniscriptKey > Liftable < Pk > for Concrete < Pk > {
184
+ impl < Pk : MiniscriptKey > Lift < Pk > for Concrete < Pk > {
185
185
fn lift ( & self ) -> Result < Semantic < Pk > , Error > {
186
186
// do not lift if there is a possible satisfaction
187
187
// involving combination of timelocks and heightlocks
@@ -197,7 +197,7 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Concrete<Pk> {
197
197
Concrete :: Ripemd160 ( ref h) => Semantic :: Ripemd160 ( h. clone ( ) ) ,
198
198
Concrete :: Hash160 ( ref h) => Semantic :: Hash160 ( h. clone ( ) ) ,
199
199
Concrete :: And ( ref subs) => {
200
- let semantic_subs: Result < _ , Error > = subs. iter ( ) . map ( Liftable :: lift) . collect ( ) ;
200
+ let semantic_subs: Result < _ , Error > = subs. iter ( ) . map ( Lift :: lift) . collect ( ) ;
201
201
Semantic :: Threshold ( 2 , semantic_subs?)
202
202
}
203
203
Concrete :: Or ( ref subs) => {
@@ -206,15 +206,15 @@ impl<Pk: MiniscriptKey> Liftable<Pk> for Concrete<Pk> {
206
206
Semantic :: Threshold ( 1 , semantic_subs?)
207
207
}
208
208
Concrete :: Threshold ( k, ref subs) => {
209
- let semantic_subs: Result < _ , Error > = subs. iter ( ) . map ( Liftable :: lift) . collect ( ) ;
209
+ let semantic_subs: Result < _ , Error > = subs. iter ( ) . map ( Lift :: lift) . collect ( ) ;
210
210
Semantic :: Threshold ( k, semantic_subs?)
211
211
}
212
212
}
213
213
. normalized ( ) ;
214
214
Ok ( ret)
215
215
}
216
216
}
217
- impl < Pk : MiniscriptKey > Liftable < Pk > for Arc < Concrete < Pk > > {
217
+ impl < Pk : MiniscriptKey > Lift < Pk > for Arc < Concrete < Pk > > {
218
218
fn lift ( & self ) -> Result < Semantic < Pk > , Error > { self . as_ref ( ) . lift ( ) }
219
219
}
220
220
@@ -228,7 +228,7 @@ mod tests {
228
228
229
229
use super :: super :: miniscript:: context:: Segwitv0 ;
230
230
use super :: super :: miniscript:: Miniscript ;
231
- use super :: { Concrete , Liftable , Semantic } ;
231
+ use super :: { Concrete , Lift , Semantic } ;
232
232
#[ cfg( feature = "compiler" ) ]
233
233
use crate :: descriptor:: Tr ;
234
234
use crate :: prelude:: * ;
0 commit comments