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