@@ -251,59 +251,6 @@ impl<Pk: MiniscriptKey, Ctx: ScriptContext> Miniscript<Pk, Ctx> {
251
251
}
252
252
}
253
253
254
- /// `PartialOrd` of `Miniscript` must depend only on node and not the type information.
255
- ///
256
- /// The type information and extra_properties can be deterministically determined by the AST.
257
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > PartialOrd for Miniscript < Pk , Ctx > {
258
- fn partial_cmp ( & self , other : & Miniscript < Pk , Ctx > ) -> Option < cmp:: Ordering > {
259
- Some ( self . node . cmp ( & other. node ) )
260
- }
261
- }
262
-
263
- /// `Ord` of `Miniscript` must depend only on node and not the type information.
264
- ///
265
- /// The type information and extra_properties can be deterministically determined by the AST.
266
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > Ord for Miniscript < Pk , Ctx > {
267
- fn cmp ( & self , other : & Miniscript < Pk , Ctx > ) -> cmp:: Ordering {
268
- self . node . cmp ( & other. node )
269
- }
270
- }
271
-
272
- /// `PartialEq` of `Miniscript` must depend only on node and not the type information.
273
- ///
274
- /// The type information and extra_properties can be deterministically determined by the AST.
275
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > PartialEq for Miniscript < Pk , Ctx > {
276
- fn eq ( & self , other : & Miniscript < Pk , Ctx > ) -> bool {
277
- self . node . eq ( & other. node )
278
- }
279
- }
280
-
281
- /// `Eq` of `Miniscript` must depend only on node and not the type information.
282
- ///
283
- /// The type information and extra_properties can be deterministically determined by the AST.
284
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > Eq for Miniscript < Pk , Ctx > { }
285
-
286
- /// `Hash` of `Miniscript` must depend only on node and not the type information.
287
- ///
288
- /// The type information and extra_properties can be deterministically determined by the AST.
289
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > hash:: Hash for Miniscript < Pk , Ctx > {
290
- fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
291
- self . node . hash ( state) ;
292
- }
293
- }
294
-
295
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Debug for Miniscript < Pk , Ctx > {
296
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
297
- write ! ( f, "{:?}" , self . node)
298
- }
299
- }
300
-
301
- impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Display for Miniscript < Pk , Ctx > {
302
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
303
- write ! ( f, "{}" , self . node)
304
- }
305
- }
306
-
307
254
impl < Ctx : ScriptContext > Miniscript < Ctx :: Key , Ctx > {
308
255
/// Attempt to parse an insane(scripts don't clear sanity checks)
309
256
/// script into a Miniscript representation.
@@ -383,6 +330,59 @@ impl<Ctx: ScriptContext> Miniscript<Ctx::Key, Ctx> {
383
330
}
384
331
}
385
332
333
+ /// `PartialOrd` of `Miniscript` must depend only on node and not the type information.
334
+ ///
335
+ /// The type information and extra_properties can be deterministically determined by the AST.
336
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > PartialOrd for Miniscript < Pk , Ctx > {
337
+ fn partial_cmp ( & self , other : & Miniscript < Pk , Ctx > ) -> Option < cmp:: Ordering > {
338
+ Some ( self . node . cmp ( & other. node ) )
339
+ }
340
+ }
341
+
342
+ /// `Ord` of `Miniscript` must depend only on node and not the type information.
343
+ ///
344
+ /// The type information and extra_properties can be deterministically determined by the AST.
345
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > Ord for Miniscript < Pk , Ctx > {
346
+ fn cmp ( & self , other : & Miniscript < Pk , Ctx > ) -> cmp:: Ordering {
347
+ self . node . cmp ( & other. node )
348
+ }
349
+ }
350
+
351
+ /// `PartialEq` of `Miniscript` must depend only on node and not the type information.
352
+ ///
353
+ /// The type information and extra_properties can be deterministically determined by the AST.
354
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > PartialEq for Miniscript < Pk , Ctx > {
355
+ fn eq ( & self , other : & Miniscript < Pk , Ctx > ) -> bool {
356
+ self . node . eq ( & other. node )
357
+ }
358
+ }
359
+
360
+ /// `Eq` of `Miniscript` must depend only on node and not the type information.
361
+ ///
362
+ /// The type information and extra_properties can be deterministically determined by the AST.
363
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > Eq for Miniscript < Pk , Ctx > { }
364
+
365
+ /// `Hash` of `Miniscript` must depend only on node and not the type information.
366
+ ///
367
+ /// The type information and extra_properties can be deterministically determined by the AST.
368
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > hash:: Hash for Miniscript < Pk , Ctx > {
369
+ fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
370
+ self . node . hash ( state) ;
371
+ }
372
+ }
373
+
374
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Debug for Miniscript < Pk , Ctx > {
375
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
376
+ write ! ( f, "{:?}" , self . node)
377
+ }
378
+ }
379
+
380
+ impl < Pk : MiniscriptKey , Ctx : ScriptContext > fmt:: Display for Miniscript < Pk , Ctx > {
381
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
382
+ write ! ( f, "{}" , self . node)
383
+ }
384
+ }
385
+
386
386
impl < Pk : MiniscriptKey , Ctx : ScriptContext > ForEachKey < Pk > for Miniscript < Pk , Ctx > {
387
387
fn for_each_key < ' a , F : FnMut ( & ' a Pk ) -> bool > ( & ' a self , mut pred : F ) -> bool {
388
388
for ms in self . pre_order_iter ( ) {
0 commit comments