@@ -120,8 +120,6 @@ mod tests {
120120 }
121121 }
122122
123- /// 3 authenticated participants with the given governance threshold and
124- /// fresh, empty pending votes.
125123 struct Voting {
126124 participants : Participants ,
127125 params : GovernanceThresholdParameters ,
@@ -183,7 +181,7 @@ mod tests {
183181
184182 #[ test]
185183 fn vote__should_not_cross_below_threshold ( ) {
186- // Given 3 participants, threshold 2
184+ // Given 3 participants, governance threshold 2
187185 let mut voting = Voting :: with_threshold ( 2 ) ;
188186 let proposal = proposal ( "v.near" , 1 ) ;
189187
@@ -200,7 +198,7 @@ mod tests {
200198
201199 #[ test]
202200 fn vote__should_cross_threshold_and_clear_pending ( ) {
203- // Given 3 participants, threshold 2
201+ // Given 3 participants, governance threshold 2
204202 let mut voting = Voting :: with_threshold ( 2 ) ;
205203 let proposal = proposal ( "v.near" , 1 ) ;
206204
@@ -215,7 +213,7 @@ mod tests {
215213
216214 #[ test]
217215 fn vote__should_not_combine_same_account_different_hashes ( ) {
218- // Given 3 participants, threshold 2
216+ // Given 3 participants, governance threshold 2
219217 let mut voting = Voting :: with_threshold ( 2 ) ;
220218 let candidate = "v.near" ;
221219 let proposal_hash_1 = proposal ( candidate, 1 ) ;
@@ -239,7 +237,7 @@ mod tests {
239237
240238 #[ test]
241239 fn revote__should_replace_previous_vote ( ) {
242- // Given 3 participants, threshold 2
240+ // Given 3 participants, governance threshold 2
243241 let mut voting = Voting :: with_threshold ( 2 ) ;
244242 let first_proposal = proposal ( "a.near" , 1 ) ;
245243 let second_proposal = proposal ( "b.near" , 1 ) ;
@@ -260,7 +258,7 @@ mod tests {
260258
261259 #[ test]
262260 fn withdraw__should_remove_caller_vote ( ) {
263- // Given 3 participants, threshold 2, and one recorded vote
261+ // Given 3 participants, governance threshold 2, and one recorded vote
264262 let mut voting = Voting :: with_threshold ( 2 ) ;
265263 let proposal = proposal ( "v.near" , 1 ) ;
266264 voting. must_cast ( 0 , & proposal) ;
@@ -270,19 +268,19 @@ mod tests {
270268 ) ;
271269
272270 // When the caller withdraws
273- voting. votes . withdraw ( & voting. voters [ 0 ] ) ;
271+ voting. votes . withdraw ( & voting. voter ( 0 ) ) ;
274272
275273 // Then their vote is removed
276274 assert_eq ! ( voting. votes. pending( ) , BTreeMap :: new( ) ) ;
277275
278276 // When a voter who never voted withdraws, it is a no-op
279- voting. votes . withdraw ( & voting. voters [ 1 ] ) ;
277+ voting. votes . withdraw ( & voting. voter ( 1 ) ) ;
280278 assert_eq ! ( voting. votes. pending( ) , BTreeMap :: new( ) ) ;
281279 }
282280
283281 #[ test]
284282 fn retain__should_keep_current_participants_and_drop_the_rest ( ) {
285- // Given 3 participants, threshold 3, and two voters sharing one bucket
283+ // Given 3 participants, governance threshold 3, and two voters sharing one bucket
286284 let mut voting = Voting :: with_threshold ( 3 ) ;
287285 let proposal = proposal ( "v.near" , 1 ) ;
288286 voting. must_cast ( 0 , & proposal) ;
0 commit comments