@@ -460,7 +460,7 @@ impl Plan {
460
460
}
461
461
}
462
462
463
- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
463
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
464
464
/// Signatures which a key can produce
465
465
///
466
466
/// Defaults to `ecdsa=true` and `taproot=TaprootCanSign::default()`
@@ -480,7 +480,7 @@ impl Default for CanSign {
480
480
}
481
481
}
482
482
483
- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
483
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
484
484
/// Signatures which a taproot key can produce
485
485
///
486
486
/// Defaults to `key_spend=true`, `script_spend=Any` and `sighash_default=true`
@@ -512,7 +512,7 @@ impl Default for TaprootCanSign {
512
512
}
513
513
}
514
514
515
- #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
515
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
516
516
/// Which taproot leaves the key can sign for
517
517
pub enum TaprootAvailableLeaves {
518
518
/// Cannot sign for any leaf
@@ -546,15 +546,15 @@ pub struct Assets {
546
546
/// derived with either `derivation_path` or a derivation path that extends `derivation_path`
547
547
/// by exactly one child number. For example, if the derivation path `m/0/1` is provided, the
548
548
/// user can sign with either `m/0/1` or `m/0/1/*`.
549
- pub keys : HashSet < ( bip32:: KeySource , CanSign ) > ,
549
+ pub keys : BTreeSet < ( bip32:: KeySource , CanSign ) > ,
550
550
/// Set of available sha256 preimages
551
- pub sha256_preimages : HashSet < sha256:: Hash > ,
551
+ pub sha256_preimages : BTreeSet < sha256:: Hash > ,
552
552
/// Set of available hash256 preimages
553
- pub hash256_preimages : HashSet < hash256:: Hash > ,
553
+ pub hash256_preimages : BTreeSet < hash256:: Hash > ,
554
554
/// Set of available ripemd160 preimages
555
- pub ripemd160_preimages : HashSet < ripemd160:: Hash > ,
555
+ pub ripemd160_preimages : BTreeSet < ripemd160:: Hash > ,
556
556
/// Set of available hash160 preimages
557
- pub hash160_preimages : HashSet < hash160:: Hash > ,
557
+ pub hash160_preimages : BTreeSet < hash160:: Hash > ,
558
558
/// Maximum absolute timelock allowed
559
559
pub absolute_timelock : Option < LockTime > ,
560
560
/// Maximum relative timelock allowed
@@ -679,7 +679,7 @@ impl AssetProvider<DefiniteDescriptorKey> for Assets {
679
679
680
680
impl FromIterator < DescriptorPublicKey > for Assets {
681
681
fn from_iter < I : IntoIterator < Item = DescriptorPublicKey > > ( iter : I ) -> Self {
682
- let mut keys = HashSet :: new ( ) ;
682
+ let mut keys = BTreeSet :: new ( ) ;
683
683
for pk in iter {
684
684
for deriv_path in pk. full_derivation_paths ( ) {
685
685
keys. insert ( ( ( pk. master_fingerprint ( ) , deriv_path) , CanSign :: default ( ) ) ) ;
@@ -699,8 +699,8 @@ pub trait IntoAssets {
699
699
}
700
700
701
701
impl IntoAssets for KeyMap {
702
- fn into_assets ( mut self ) -> Assets {
703
- Assets :: from_iter ( self . drain ( ) . map ( |( k, _) | k) )
702
+ fn into_assets ( self ) -> Assets {
703
+ Assets :: from_iter ( self . into_iter ( ) . map ( |( k, _) | k) )
704
704
}
705
705
}
706
706
0 commit comments