Companion for #5412 (#942)

* Fixes for democracy using Scheduler

* Revert branch change
This commit is contained in:
Gavin Wood
2020-04-01 17:01:14 +02:00
committed by GitHub
parent 6301baf024
commit d8e1180030
22 changed files with 315 additions and 285 deletions
+6 -4
View File
@@ -1,6 +1,6 @@
[package]
name = "kusama-runtime"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
@@ -33,7 +33,7 @@ authorship = { package = "pallet-authorship", git = "https://github.com/parityte
babe = { package = "pallet-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
transaction-payment = { package = "pallet-transaction-payment", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
collective = { package = "pallet-collective", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
democracy = { package = "pallet-democracy", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -48,11 +48,12 @@ nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substra
offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
scheduler = { package = "pallet-scheduler", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking-reward-curve = { package = "pallet-staking-reward-curve", git = "https://github.com/paritytech/substrate", branch = "master" }
system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
system_rpc_runtime_api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
timestamp = { package = "pallet-timestamp", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -101,7 +102,7 @@ std = [
"authorship/std",
"balances/std",
"transaction-payment/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"transaction-payment-rpc-runtime-api/std",
"collective/std",
"elections-phragmen/std",
"democracy/std",
@@ -117,6 +118,7 @@ std = [
"recovery/std",
"sp-runtime/std",
"sp-staking/std",
"scheduler/std",
"session/std",
"society/std",
"staking/std",
+13 -2
View File
@@ -56,7 +56,7 @@ use frame_support::{
use im_online::sr25519::AuthorityId as ImOnlineId;
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use system::offchain::TransactionSubmitter;
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
use transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
use session::{historical as session_historical};
#[cfg(feature = "std")]
@@ -145,6 +145,13 @@ impl system::Trait for Runtime {
type OnKilledAccount = ();
}
impl scheduler::Trait for Runtime {
type Event = Event;
type Origin = Origin;
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
}
parameter_types! {
pub const EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64;
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
@@ -349,6 +356,7 @@ impl democracy::Trait for Runtime {
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type Slash = Treasury;
type Scheduler = Scheduler;
}
parameter_types! {
@@ -703,6 +711,9 @@ construct_runtime! {
// Vesting. Usable initially, but removed once all vesting is finished.
Vesting: vesting::{Module, Call, Storage, Event<T>, Config<T>},
// System scheduler.
Scheduler: scheduler::{Module, Call, Storage, Event<T>},
}
}
@@ -887,7 +898,7 @@ sp_api::impl_runtime_apis! {
}
}
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<
Block,
Balance,
UncheckedExtrinsic,