Sensible scheduling for referenda (#2753)

* Nonlinear locking and cleanups

* Bump runtime version

* Minor cleanup

* Fix tests

* Fix council tests

* Fix flaw in turnout counting

* Initial work on referendum schedules

* Refactor council-democracy interface.

* Fix build

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Update srml/democracy/src/lib.rs

Co-Authored-By: Luke Schoen <ltfschoen@users.noreply.github.com>

* Tests compile again

* Tests!

* Update todo

* Fix build

* Ensure votes arer not double-counted on member-transitions

* Extra logic for normal council changes

* Typo

* A few grumbles addressed.
This commit is contained in:
Gavin Wood
2019-06-05 12:36:28 +02:00
committed by GitHub
parent 89b312fe9c
commit 22a00a3353
16 changed files with 1186 additions and 747 deletions
+1 -11
View File
@@ -18,7 +18,7 @@
use primitives::{ed25519::Public as AuthorityId, ed25519, sr25519, Pair, crypto::UncheckedInto};
use node_primitives::AccountId;
use node_runtime::{ConsensusConfig, CouncilSeatsConfig, CouncilVotingConfig, DemocracyConfig,
use node_runtime::{ConsensusConfig, CouncilSeatsConfig, DemocracyConfig,
SessionConfig, StakingConfig, StakerStatus, TimestampConfig, BalancesConfig, TreasuryConfig,
SudoConfig, ContractConfig, GrandpaConfig, IndicesConfig, Permill, Perbill};
pub use node_runtime::GenesisConfig;
@@ -132,11 +132,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
desired_seats: 0,
inactive_grace_period: 1, // one additional vote should go by before an inactive voter can be reaped.
}),
council_voting: Some(CouncilVotingConfig {
cooloff_period: 4 * DAYS,
voting_period: 1 * DAYS,
enact_delay_period: 0,
}),
timestamp: Some(TimestampConfig {
minimum_period: SECS_PER_BLOCK / 2, // due to the nature of aura the slots are 2*period
}),
@@ -312,11 +307,6 @@ pub fn testnet_genesis(
desired_seats: (endowed_accounts.len() / 2 - initial_authorities.len()) as u32,
inactive_grace_period: 1,
}),
council_voting: Some(CouncilVotingConfig {
cooloff_period: 75,
voting_period: 20,
enact_delay_period: 0,
}),
timestamp: Some(TimestampConfig {
minimum_period: 2, // 2*2=4 second block time.
}),