@@ -12,7 +12,7 @@ use core::str::FromStr;
12
12
13
13
use bitcoin:: script;
14
14
15
- use crate :: miniscript:: context:: ScriptContext ;
15
+ use crate :: miniscript:: context:: Context ;
16
16
use crate :: miniscript:: decode:: Terminal ;
17
17
use crate :: miniscript:: limits:: MAX_PUBKEYS_PER_MULTISIG ;
18
18
use crate :: prelude:: * ;
@@ -23,16 +23,16 @@ use crate::{
23
23
24
24
/// Contents of a "sortedmulti" descriptor
25
25
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
26
- pub struct SortedMultiVec < Pk : Key , Ctx : ScriptContext > {
26
+ pub struct SortedMultiVec < Pk : Key , Ctx : Context > {
27
27
/// signatures required
28
28
pub k : usize ,
29
29
/// public keys inside sorted Multi
30
30
pub pks : Vec < Pk > ,
31
- /// The current ScriptContext for sortedmulti
31
+ /// The current Context for sortedmulti
32
32
pub ( crate ) phantom : PhantomData < Ctx > ,
33
33
}
34
34
35
- impl < Pk : Key , Ctx : ScriptContext > SortedMultiVec < Pk , Ctx > {
35
+ impl < Pk : Key , Ctx : Context > SortedMultiVec < Pk , Ctx > {
36
36
/// Create a new instance of `SortedMultiVec` given a list of keys and the threshold
37
37
///
38
38
/// Internally checks all the applicable size limits and pubkey types limitations according to the current `Ctx`.
@@ -98,13 +98,13 @@ impl<Pk: Key, Ctx: ScriptContext> SortedMultiVec<Pk, Ctx> {
98
98
}
99
99
}
100
100
101
- impl < Pk : Key , Ctx : ScriptContext > ForEachKey < Pk > for SortedMultiVec < Pk , Ctx > {
101
+ impl < Pk : Key , Ctx : Context > ForEachKey < Pk > for SortedMultiVec < Pk , Ctx > {
102
102
fn for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , pred : F ) -> bool {
103
103
self . pks . iter ( ) . all ( pred)
104
104
}
105
105
}
106
106
107
- impl < Pk : Key , Ctx : ScriptContext > SortedMultiVec < Pk , Ctx > {
107
+ impl < Pk : Key , Ctx : Context > SortedMultiVec < Pk , Ctx > {
108
108
/// utility function to sanity a sorted multi vec
109
109
pub fn sanity_check ( & self ) -> Result < ( ) , Error > {
110
110
let ms: Miniscript < Pk , Ctx > =
@@ -116,7 +116,7 @@ impl<Pk: Key, Ctx: ScriptContext> SortedMultiVec<Pk, Ctx> {
116
116
}
117
117
}
118
118
119
- impl < Pk : Key , Ctx : ScriptContext > SortedMultiVec < Pk , Ctx > {
119
+ impl < Pk : Key , Ctx : Context > SortedMultiVec < Pk , Ctx > {
120
120
/// Create Terminal::Multi containing sorted pubkeys
121
121
pub fn sorted_node ( & self ) -> Terminal < Pk , Ctx >
122
122
where
@@ -194,7 +194,7 @@ impl<Pk: Key, Ctx: ScriptContext> SortedMultiVec<Pk, Ctx> {
194
194
}
195
195
}
196
196
197
- impl < Pk : Key , Ctx : ScriptContext > policy:: Liftable < Pk > for SortedMultiVec < Pk , Ctx > {
197
+ impl < Pk : Key , Ctx : Context > policy:: Liftable < Pk > for SortedMultiVec < Pk , Ctx > {
198
198
fn lift ( & self ) -> Result < policy:: semantic:: Policy < Pk > , Error > {
199
199
let ret = policy:: semantic:: Policy :: Threshold (
200
200
self . k ,
@@ -207,13 +207,13 @@ impl<Pk: Key, Ctx: ScriptContext> policy::Liftable<Pk> for SortedMultiVec<Pk, Ct
207
207
}
208
208
}
209
209
210
- impl < Pk : Key , Ctx : ScriptContext > fmt:: Debug for SortedMultiVec < Pk , Ctx > {
210
+ impl < Pk : Key , Ctx : Context > fmt:: Debug for SortedMultiVec < Pk , Ctx > {
211
211
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
212
212
fmt:: Display :: fmt ( self , f)
213
213
}
214
214
}
215
215
216
- impl < Pk : Key , Ctx : ScriptContext > fmt:: Display for SortedMultiVec < Pk , Ctx > {
216
+ impl < Pk : Key , Ctx : Context > fmt:: Display for SortedMultiVec < Pk , Ctx > {
217
217
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
218
218
write ! ( f, "sortedmulti({}" , self . k) ?;
219
219
for k in & self . pks {
0 commit comments