@@ -22,7 +22,7 @@ pub struct RegisterValidatorSignedMessage {
22
22
pub registration_utxo : UtxoId ,
23
23
}
24
24
25
- #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq ) ]
25
+ #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq , PartialOrd , Ord ) ]
26
26
pub struct CandidateWithStake < TAccountId , TAccountKeys > {
27
27
pub stake_pool_pub_key : StakePoolPublicKey ,
28
28
/// Amount of ADA staked/locked by the Authority Candidate
@@ -31,29 +31,18 @@ pub struct CandidateWithStake<TAccountId, TAccountKeys> {
31
31
pub account_keys : TAccountKeys ,
32
32
}
33
33
34
- #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq ) ]
34
+ #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq , PartialOrd , Ord ) ]
35
35
pub struct PermissionedCandidate < TAccountId , TAccountKeys > {
36
36
pub account_id : TAccountId ,
37
37
pub account_keys : TAccountKeys ,
38
38
}
39
39
40
- #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq ) ]
40
+ #[ derive( Clone , Debug , Encode , Decode , PartialEq , Eq , PartialOrd , Ord ) ]
41
41
pub enum Candidate < TAccountId , TAccountKeys > {
42
42
Permissioned ( PermissionedCandidate < TAccountId , TAccountKeys > ) ,
43
43
Registered ( CandidateWithStake < TAccountId , TAccountKeys > ) ,
44
44
}
45
45
46
- impl < TAccountId : Ord , TAccountKeys : Eq > PartialOrd for Candidate < TAccountId , TAccountKeys > {
47
- fn partial_cmp ( & self , other : & Self ) -> Option < core:: cmp:: Ordering > {
48
- Some ( self . cmp ( other) )
49
- }
50
- }
51
- impl < TAccountId : Ord , TAccountKeys : Eq > Ord for Candidate < TAccountId , TAccountKeys > {
52
- fn cmp ( & self , other : & Self ) -> core:: cmp:: Ordering {
53
- self . account_id ( ) . cmp ( other. account_id ( ) )
54
- }
55
- }
56
-
57
46
impl < AuthorityId , AuthorityKeys > From < Candidate < AuthorityId , AuthorityKeys > >
58
47
for CommitteeMember < AuthorityId , AuthorityKeys >
59
48
{
0 commit comments