From c87276e859008c5287b2eb2c68588ce40ce3c8bd Mon Sep 17 00:00:00 2001 From: Mokhtar Naamani Date: Sun, 13 Sep 2020 09:08:30 +0300 Subject: [PATCH] runtime: add pallet-runtime for doing batch staking payouts --- Cargo.lock | 19 ++++++++++++++++++- runtime/Cargo.toml | 5 ++++- runtime/src/lib.rs | 8 +++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e88530331..333742af82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2053,7 +2053,7 @@ dependencies = [ [[package]] name = "joystream-node-runtime" -version = "7.2.0" +version = "7.3.0" dependencies = [ "frame-benchmarking", "frame-executive", @@ -2095,6 +2095,7 @@ dependencies = [ "pallet-token-mint", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-versioned-store", "pallet-versioned-store-permissions", "pallet-working-group", @@ -3826,6 +3827,22 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-utility" +version = "2.0.0-rc4" +source = "git+https://github.com/paritytech/substrate.git?rev=00768a1f21a579c478fe5d4f51e1fa71f7db9fd4#00768a1f21a579c478fe5d4f51e1fa71f7db9fd4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-versioned-store" version = "3.0.0" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 31cd2e5429..731f3dd2bc 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -4,7 +4,7 @@ edition = '2018' name = 'joystream-node-runtime' # Follow convention: https://github.com/Joystream/substrate-runtime-joystream/issues/1 # {Authoring}.{Spec}.{Impl} of the RuntimeVersion -version = '7.2.0' +version = '7.3.0' [dependencies] # Third-party dependencies @@ -51,6 +51,7 @@ pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git pallet-balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-im-online = { package = 'pallet-im-online', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} pallet-collective = { package = 'pallet-collective', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} +pallet-utility = { package = 'pallet-utility', default-features = false, git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4'} # Benchmarking frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', rev = '00768a1f21a579c478fe5d4f51e1fa71f7db9fd4', default-features = false, optional = true } @@ -132,6 +133,7 @@ std = [ 'pallet-im-online/std', 'pallet-collective/std', 'pallet-offences/std', + 'pallet-utility/std', # Joystream 'common/std', @@ -166,6 +168,7 @@ runtime-benchmarks = [ "frame-system-benchmarking", "pallet-offences-benchmarking", "pallet-session-benchmarking", + "pallet-utility/runtime-benchmarks", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 660bf99b32..b851ce5981 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -70,7 +70,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("joystream-node"), impl_name: create_runtime_str!("joystream-node"), authoring_version: 7, - spec_version: 2, + spec_version: 3, impl_version: 0, apis: crate::runtime_api::EXPORTED_RUNTIME_API_VERSIONS, transaction_version: 1, @@ -127,6 +127,11 @@ impl system::Trait for Runtime { type OnKilledAccount = (); } +impl pallet_utility::Trait for Runtime { + type Event = Event; + type Call = Call; +} + parameter_types! { pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS as u64; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; @@ -578,6 +583,7 @@ construct_runtime!( { // Substrate System: system::{Module, Call, Storage, Config, Event}, + Utility: pallet_utility::{Module, Call, Event}, Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)}, Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, Authorship: pallet_authorship::{Module, Call, Storage, Inherent},