Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixes for democracy using Scheduler

* Revert branch change
  • Loading branch information
gavofyork authored Apr 1, 2020
1 parent 5e0170c commit d4f0a74
Show file tree
Hide file tree
Showing 22 changed files with 315 additions and 285 deletions.
521 changes: 263 additions & 258 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ path = "src/main.rs"

[package]
name = "polkadot"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion availability-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-cli"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-collator"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-erasure-coding"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-network"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-parachain"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
Expand Down
1 change: 1 addition & 0 deletions parachain/src/wasm_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use sp_externalities::ExternalitiesExt;
#[runtime_interface]
pub trait Parachain {
/// Post a message to this parachain's relay chain.
#[allow(dead_code)]
fn post_upward_message(&mut self, msg: UpwardMessage) {
self.extension::<crate::wasm_executor::ParachainExt>()
.expect("No `ParachainExt` associated with the current context.")
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-primitives"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-rpc"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime-common"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
10 changes: 6 additions & 4 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down Expand Up @@ -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",
Expand All @@ -117,6 +118,7 @@ std = [
"recovery/std",
"sp-runtime/std",
"sp-staking/std",
"scheduler/std",
"session/std",
"society/std",
"staking/std",
Expand Down
15 changes: 13 additions & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -349,6 +356,7 @@ impl democracy::Trait for Runtime {
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type Slash = Treasury;
type Scheduler = Scheduler;
}

parameter_types! {
Expand Down Expand Up @@ -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>},
}
}

Expand Down Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down Expand Up @@ -32,7 +32,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 }
Expand All @@ -46,6 +46,7 @@ membership = { package = "pallet-membership", git = "https://github.com/parityte
nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
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 }
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 }
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 }
Expand Down Expand Up @@ -97,7 +98,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",
Expand All @@ -112,6 +113,7 @@ std = [
"offences/std",
"sp-runtime/std",
"sp-staking/std",
"scheduler/std",
"session/std",
"staking/std",
"system/std",
Expand Down
13 changes: 11 additions & 2 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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")]
Expand Down Expand Up @@ -153,6 +153,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;
Expand Down Expand Up @@ -356,6 +363,7 @@ impl democracy::Trait for Runtime {
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type Slash = Treasury;
type Scheduler = Scheduler;
}

parameter_types! {
Expand Down Expand Up @@ -582,6 +590,7 @@ construct_runtime! {
// Basic stuff; balances is uncallable initially.
System: system::{Module, Call, Storage, Config, Event<T>},
RandomnessCollectiveFlip: randomness_collective_flip::{Module, Storage},
Scheduler: scheduler::{Module, Call, Storage, Event<T>},

// Must be before session.
Babe: babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
Expand Down Expand Up @@ -809,7 +818,7 @@ sp_api::impl_runtime_apis! {
}
}

impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<
impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<
Block,
Balance,
UncheckedExtrinsic,
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-test-runtime"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-service"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion statement-table/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-statement-table"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion test-parachains/adder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adder"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion test-parachains/halt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "halt"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion validation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-validation"
version = "0.7.28"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down

0 comments on commit d4f0a74

Please sign in to comment.