@@ -131,57 +131,58 @@ decl_module! {
131
131
}
132
132
133
133
decl_storage ! {
134
- trait Store for Module <T : Trait >;
135
-
136
- // parameters
137
- // How much should be locked up in order to submit one's candidacy.
138
- pub CandidacyBond get( candidacy_bond) : b"cou:cbo" => required T :: Balance ;
139
- // How much should be locked up in order to be able to submit votes.
140
- pub VotingBond get( voting_bond) : b"cou:vbo" => required T :: Balance ;
141
- // The punishment, per voter, if you provide an invalid presentation.
142
- pub PresentSlashPerVoter get( present_slash_per_voter) : b"cou:pss" => required T :: Balance ;
143
- // How many runners-up should have their approvals persist until the next vote.
144
- pub CarryCount get( carry_count) : b"cou:cco" => required u32 ;
145
- // How long to give each top candidate to present themselves after the vote ends.
146
- pub PresentationDuration get( presentation_duration) : b"cou:pdu" => required T :: BlockNumber ;
147
- // How many votes need to go by after a voter's last vote before they can be reaped if their
148
- // approvals are moot.
149
- pub InactiveGracePeriod get( inactivity_grace_period) : b"cou:vgp" => required VoteIndex ;
150
- // How often (in blocks) to check for new votes.
151
- pub VotingPeriod get( voting_period) : b"cou:per" => required T :: BlockNumber ;
152
- // How long each position is active for.
153
- pub TermDuration get( term_duration) : b"cou:trm" => required T :: BlockNumber ;
154
- // Number of accounts that should be sitting on the council.
155
- pub DesiredSeats get( desired_seats) : b"cou:sts" => required u32 ;
156
-
157
- // permanent state (always relevant, changes only at the finalisation of voting)
158
- // The current council. When there's a vote going on, this should still be used for executive
159
- // matters.
160
- pub ActiveCouncil get( active_council) : b"cou:act" => default Vec <( T :: AccountId , T :: BlockNumber ) >;
161
- // The total number of votes that have happened or are in progress.
162
- pub VoteCount get( vote_index) : b"cou:vco" => default VoteIndex ;
163
-
164
- // persistent state (always relevant, changes constantly)
165
- // The last cleared vote index that this voter was last active at.
166
- pub ApprovalsOf get( approvals_of) : b"cou:apr" => default map [ T :: AccountId => Vec <bool > ] ;
167
- // The vote index and list slot that the candidate `who` was registered or `None` if they are not
168
- // currently registered.
169
- pub RegisterInfoOf get( candidate_reg_info) : b"cou:reg" => map [ T :: AccountId => ( VoteIndex , u32 ) ] ;
170
- // The last cleared vote index that this voter was last active at.
171
- pub LastActiveOf get( voter_last_active) : b"cou:lac" => map [ T :: AccountId => VoteIndex ] ;
172
- // The present voter list.
173
- pub Voters get( voters) : b"cou:vrs" => default Vec <T :: AccountId >;
174
- // The present candidate list.
175
- pub Candidates get( candidates) : b"cou:can" => default Vec <T :: AccountId >; // has holes
176
- pub CandidateCount get( candidate_count) : b"cou:cnc" => default u32 ;
177
-
178
- // temporary state (only relevant during finalisation/presentation)
179
- // The accounts holding the seats that will become free on the next tally.
180
- pub NextFinalise get( next_finalise) : b"cou:nxt" => ( T :: BlockNumber , u32 , Vec <T :: AccountId >) ;
181
- // The stakes as they were at the point that the vote ended.
182
- pub SnapshotedStakes get( snapshoted_stakes) : b"cou:sss" => required Vec <T :: Balance >;
183
- // Get the leaderboard if we;re in the presentation phase.
184
- pub Leaderboard get( leaderboard) : b"cou:win" => Vec <( T :: Balance , T :: AccountId ) >; // ORDERED low -> high
134
+ trait Store for Module <T : Trait > as Council {
135
+
136
+ // parameters
137
+ // How much should be locked up in order to submit one's candidacy.
138
+ pub CandidacyBond get( candidacy_bond) : required T :: Balance ;
139
+ // How much should be locked up in order to be able to submit votes.
140
+ pub VotingBond get( voting_bond) : required T :: Balance ;
141
+ // The punishment, per voter, if you provide an invalid presentation.
142
+ pub PresentSlashPerVoter get( present_slash_per_voter) : required T :: Balance ;
143
+ // How many runners-up should have their approvals persist until the next vote.
144
+ pub CarryCount get( carry_count) : required u32 ;
145
+ // How long to give each top candidate to present themselves after the vote ends.
146
+ pub PresentationDuration get( presentation_duration) : required T :: BlockNumber ;
147
+ // How many votes need to go by after a voter's last vote before they can be reaped if their
148
+ // approvals are moot.
149
+ pub InactiveGracePeriod get( inactivity_grace_period) : required VoteIndex ;
150
+ // How often (in blocks) to check for new votes.
151
+ pub VotingPeriod get( voting_period) : required T :: BlockNumber ;
152
+ // How long each position is active for.
153
+ pub TermDuration get( term_duration) : required T :: BlockNumber ;
154
+ // Number of accounts that should be sitting on the council.
155
+ pub DesiredSeats get( desired_seats) : required u32 ;
156
+
157
+ // permanent state (always relevant, changes only at the finalisation of voting)
158
+ // The current council. When there's a vote going on, this should still be used for executive
159
+ // matters.
160
+ pub ActiveCouncil get( active_council) : default Vec <( T :: AccountId , T :: BlockNumber ) >;
161
+ // The total number of votes that have happened or are in progress.
162
+ pub VoteCount get( vote_index) : default VoteIndex ;
163
+
164
+ // persistent state (always relevant, changes constantly)
165
+ // The last cleared vote index that this voter was last active at.
166
+ pub ApprovalsOf get( approvals_of) : default map [ T :: AccountId => Vec <bool > ] ;
167
+ // The vote index and list slot that the candidate `who` was registered or `None` if they are not
168
+ // currently registered.
169
+ pub RegisterInfoOf get( candidate_reg_info) : map [ T :: AccountId => ( VoteIndex , u32 ) ] ;
170
+ // The last cleared vote index that this voter was last active at.
171
+ pub LastActiveOf get( voter_last_active) : map [ T :: AccountId => VoteIndex ] ;
172
+ // The present voter list.
173
+ pub Voters get( voters) : default Vec <T :: AccountId >;
174
+ // The present candidate list.
175
+ pub Candidates get( candidates) : default Vec <T :: AccountId >; // has holes
176
+ pub CandidateCount get( candidate_count) : default u32 ;
177
+
178
+ // temporary state (only relevant during finalisation/presentation)
179
+ // The accounts holding the seats that will become free on the next tally.
180
+ pub NextFinalise get( next_finalise) : ( T :: BlockNumber , u32 , Vec <T :: AccountId >) ;
181
+ // The stakes as they were at the point that the vote ended.
182
+ pub SnapshotedStakes get( snapshoted_stakes) : required Vec <T :: Balance >;
183
+ // Get the leaderboard if we;re in the presentation phase.
184
+ pub Leaderboard get( leaderboard) : Vec <( T :: Balance , T :: AccountId ) >; // ORDERED low -> high
185
+ }
185
186
}
186
187
187
188
impl < T : Trait > Module < T > {
0 commit comments