From d12eee1164877358036f951f4998474956424c12 Mon Sep 17 00:00:00 2001 From: Gav <gavin@parity.io> Date: Mon, 5 Mar 2018 15:58:06 +0100 Subject: [PATCH] Another few tests for council_vote. --- .../demo/runtime/src/runtime/council_vote.rs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/substrate/demo/runtime/src/runtime/council_vote.rs b/substrate/demo/runtime/src/runtime/council_vote.rs index 02350d47785..86f9ecb612c 100644 --- a/substrate/demo/runtime/src/runtime/council_vote.rs +++ b/substrate/demo/runtime/src/runtime/council_vote.rs @@ -308,6 +308,29 @@ mod tests { }); } + #[test] + fn retry_after_cooloff_should_work() { + with_externalities(&mut new_test_ext(), || { + with_env(|e| e.block_number = 1); + let proposal = Proposal::StakingSetBondingDuration(42); + let hash = proposal.blake2_256(); + public::propose(Alice, &proposal); + public::veto(Bob, &hash); + + with_env(|e| e.block_number = 3); + public::propose(Alice, &proposal); + public::vote(Bob, &hash, false); + public::vote(Charlie, &hash, true); + internal::end_block(3); + + with_env(|e| e.block_number = 4); + internal::end_block(4); + assert_eq!(proposals().len(), 0); + assert_eq!(democracy::active_referendums(), vec![(0, 5, Proposal::StakingSetBondingDuration(42), VoteThreshold::SimpleMajority)]); + + }); + } + #[test] fn alternative_double_veto_should_work() { with_externalities(&mut new_test_ext(), || { -- GitLab