File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub type MainnetRewardAddress = String;
66pub type MainnetStakeAddress = String ;
77
88/// The voting registration/delegation format as introduced in CIP-36,
9- /// which is a generalizatin of CIP-15, allowing to distribute
9+ /// which is a generalization of CIP-15, allowing to distribute
1010/// voting power among multiple keys in a single transaction and
1111/// to tag the purpose of the vote.
1212#[ derive( Deserialize , Clone , Debug , PartialEq ) ]
@@ -22,6 +22,16 @@ pub struct VotingRegistration {
2222 pub voting_purpose : u64 ,
2323}
2424
25+ impl VotingRegistration {
26+ pub fn is_legacy ( & self ) -> bool {
27+ matches ! ( self . delegations, Delegations :: Legacy ( _) )
28+ }
29+
30+ pub fn is_new ( & self ) -> bool {
31+ !self . is_legacy ( )
32+ }
33+ }
34+
2535/// To allow backward compatibility and avoid requiring existing users to
2636/// re-register we still consider valid old CIP-15 registrations, with the
2737/// simple correspondence between the two described in CIP-36.
You can’t perform that action at this time.
0 commit comments