File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,18 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
277
277
Ok ( Descriptor :: Bare ( Bare :: new ( ms) ?) )
278
278
}
279
279
280
+ // Wrap with sh
281
+
282
+ /// Create a new sh wrapper for the given wpkh descriptor
283
+ pub fn new_sh_with_wpkh ( wpkh : Wpkh < Pk > ) -> Self {
284
+ Descriptor :: Sh ( Sh :: new_with_wpkh ( wpkh) )
285
+ }
286
+
287
+ /// Create a new sh wrapper for the given wsh descriptor
288
+ pub fn new_sh_with_wsh ( wsh : Wsh < Pk > ) -> Self {
289
+ Descriptor :: Sh ( Sh :: new_with_wsh ( wsh) )
290
+ }
291
+
280
292
// sorted multi
281
293
282
294
/// Create a new sh sortedmulti descriptor with threshold `k`
Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ impl<Pk: MiniscriptKey> Sh<Pk> {
175
175
} )
176
176
}
177
177
178
+ /// Create a new p2sh wrapper for the given wsh descriptor
179
+ pub fn new_with_wsh ( wsh : Wsh < Pk > ) -> Self {
180
+ Self {
181
+ inner : ShInner :: Wsh ( wsh) ,
182
+ }
183
+ }
184
+
178
185
/// Create a new p2sh wrapped wsh sortedmulti descriptor from threshold
179
186
/// `k` and Vec of `pks`
180
187
pub fn new_wsh_sortedmulti ( k : usize , pks : Vec < Pk > ) -> Result < Self , Error > {
@@ -191,6 +198,13 @@ impl<Pk: MiniscriptKey> Sh<Pk> {
191
198
inner : ShInner :: Wpkh ( Wpkh :: new ( pk) ?) ,
192
199
} )
193
200
}
201
+
202
+ /// Create a new p2sh wrapper for the given wpkh descriptor
203
+ pub fn new_with_wpkh ( wpkh : Wpkh < Pk > ) -> Self {
204
+ Self {
205
+ inner : ShInner :: Wpkh ( wpkh) ,
206
+ }
207
+ }
194
208
}
195
209
196
210
impl < Pk : MiniscriptKey + ToPublicKey > Sh < Pk > {
You can’t perform that action at this time.
0 commit comments