Browse Source

council - unlock voting stake conditions fix II

ondratra 4 years ago
parent
commit
897b63f296
2 changed files with 1 additions and 4 deletions
  1. 1 1
      runtime-modules/council/src/lib.rs
  2. 0 3
      runtime-modules/council/src/tests.rs

+ 1 - 1
runtime-modules/council/src/lib.rs

@@ -779,7 +779,7 @@ impl<T: Trait> ReferendumConnection<T> for Module<T> {
             .any(|membership_id| vote.vote_for == Some(membership_id.into()));
 
         // allow release for vote from previous elections only when not voted for winner
-        if vote.cycle_id == current_voting_cycle_id + 1 {
+        if *current_voting_cycle_id == vote.cycle_id + 1 {
             // ensure vote was not cast for the one of winning candidates / council members
             if voting_for_winner {
                 return Err(Error::CantReleaseStakeNow);

+ 0 - 3
runtime-modules/council/src/tests.rs

@@ -172,9 +172,6 @@ fn council_vote_for_winner_stakes_longer() {
         Mocks::release_vote_stake(voter_for_winner.origin.clone(), Err(()));
         Mocks::release_vote_stake(voter_for_looser.origin.clone(), Ok(()));
 
-        // forward past idle stage
-        MockUtils::increase_block_number(council_settings.idle_stage_duration + 1);
-
         // try to release vote stake
         Mocks::release_vote_stake(voter_for_winner.origin.clone(), Err(()));