,
+ /// Transaction pool instance.
+ pub pool: Arc,
/// Remote access to the blockchain (async).
pub remote_blockchain: Arc>,
/// Fetcher instance.
pub fetcher: Arc,
}
-impl LightDeps {
- /// Create empty `LightDeps` with given `F` type.
- ///
- /// This is a convenience method to be used in the service builder,
- /// to make sure the type of the `LightDeps` is matching.
- pub fn none(_: Option>) -> Option {
- None
- }
+/// Extra dependencies for BABE.
+pub struct BabeDeps {
+ /// BABE protocol config.
+ pub babe_config: Config,
+ /// BABE pending epoch changes.
+ pub shared_epoch_changes: SharedEpochChanges,
+ /// The keystore that manages the keys of the node.
+ pub keystore: KeyStorePtr,
}
-/// Instantiate all RPC extensions.
-///
-/// If you provide `LightDeps`, the system is configured for light client.
-pub fn create(
- client: Arc,
- pool: Arc,
- light_deps: Option>,
+/// Full client dependencies.
+pub struct FullDeps {
+ /// The client instance to use.
+ pub client: Arc,
+ /// Transaction pool instance.
+ pub pool: Arc,
+ /// The SelectChain Strategy
+ pub select_chain: SC,
+ /// BABE specific dependencies.
+ pub babe: BabeDeps,
+}
+
+/// Instantiate all Full RPC extensions.
+pub fn create_full(
+ deps: FullDeps,
) -> jsonrpc_core::IoHandler where
C: ProvideRuntimeApi,
- C: sc_client::blockchain::HeaderBackend,
+ C: HeaderBackend + HeaderMetadata + 'static,
C: Send + Sync + 'static,
C::Api: substrate_frame_rpc_system::AccountNonceApi,
C::Api: pallet_contracts_rpc::ContractsRuntimeApi,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi,
- F: sc_client::light::fetcher::Fetcher + 'static,
+ C::Api: BabeApi,
+ ::Error: fmt::Debug,
P: TransactionPool + 'static,
M: jsonrpc_core::Metadata + Default,
+ SC: SelectChain +'static,
{
- use substrate_frame_rpc_system::{FullSystem, LightSystem, SystemApi};
+ use substrate_frame_rpc_system::{FullSystem, SystemApi};
use pallet_contracts_rpc::{Contracts, ContractsApi};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
let mut io = jsonrpc_core::IoHandler::default();
+ let FullDeps {
+ client,
+ pool,
+ select_chain,
+ babe
+ } = deps;
+ let BabeDeps {
+ keystore,
+ babe_config,
+ shared_epoch_changes,
+ } = babe;
+
+ io.extend_with(
+ SystemApi::to_delegate(FullSystem::new(client.clone(), pool))
+ );
+ // Making synchronous calls in light client freezes the browser currently,
+ // more context: https://github.com/paritytech/substrate/pull/3480
+ // These RPCs should use an asynchronous caller instead.
+ io.extend_with(
+ ContractsApi::to_delegate(Contracts::new(client.clone()))
+ );
+ io.extend_with(
+ TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
+ );
+ io.extend_with(
+ sc_consensus_babe_rpc::BabeApi::to_delegate(
+ BabeRPCHandler::new(client, shared_epoch_changes, keystore, babe_config, select_chain)
+ )
+ );
+
+ io
+}
+
+/// Instantiate all Light RPC extensions.
+pub fn create_light(
+ deps: LightDeps,
+) -> jsonrpc_core::IoHandler where
+ C: sc_client::blockchain::HeaderBackend,
+ C: Send + Sync + 'static,
+ F: sc_client::light::fetcher::Fetcher + 'static,
+ P: TransactionPool + 'static,
+ M: jsonrpc_core::Metadata + Default,
+{
+ use substrate_frame_rpc_system::{LightSystem, SystemApi};
+
+ let LightDeps {
+ client,
+ pool,
+ remote_blockchain,
+ fetcher
+ } = deps;
+ let mut io = jsonrpc_core::IoHandler::default();
+ io.extend_with(
+ SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
+ );
- if let Some(LightDeps { remote_blockchain, fetcher }) = light_deps {
- io.extend_with(
- SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
- );
- } else {
- io.extend_with(
- SystemApi::to_delegate(FullSystem::new(client.clone(), pool))
- );
-
- // Making synchronous calls in light client freezes the browser currently,
- // more context: https://github.com/paritytech/substrate/pull/3480
- // These RPCs should use an asynchronous caller instead.
- io.extend_with(
- ContractsApi::to_delegate(Contracts::new(client.clone()))
- );
- io.extend_with(
- TransactionPaymentApi::to_delegate(TransactionPayment::new(client))
- );
- }
io
}
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index 3f8e8b6731477e4cbaabaf4e3012bb139d259e6d..6e2fd1fdb3973bd63413f6f7e5689190c022283b 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -1,10 +1,12 @@
[package]
name = "node-runtime"
-version = "2.0.0"
+version = "2.0.0-alpha.1"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
license = "GPL-3.0"
+homepage = "https://substrate.dev"
+repository = "https://github.com/paritytech/substrate/"
[dependencies]
@@ -15,63 +17,64 @@ rustc-hex = { version = "2.0", optional = true }
serde = { version = "1.0.102", optional = true }
# primitives
-sp-authority-discovery = { version = "2.0.0", default-features = false, path = "../../../primitives/authority-discovery" }
-sp-consensus-babe = { version = "0.8", default-features = false, path = "../../../primitives/consensus/babe" }
-sp-block-builder = { path = "../../../primitives/block-builder", default-features = false}
-sp-inherents = { version = "2.0.0", default-features = false, path = "../../../primitives/inherents" }
-node-primitives = { version = "2.0.0", default-features = false, path = "../primitives" }
-sp-offchain = { version = "2.0.0", default-features = false, path = "../../../primitives/offchain" }
-sp-core = { version = "2.0.0", default-features = false, path = "../../../primitives/core" }
-sp-std = { version = "2.0.0", default-features = false, path = "../../../primitives/std" }
-sp-api = { version = "2.0.0", default-features = false, path = "../../../primitives/api" }
-sp-runtime = { version = "2.0.0", default-features = false, path = "../../../primitives/runtime" }
-sp-staking = { version = "2.0.0", default-features = false, path = "../../../primitives/staking" }
-sp-keyring = { version = "2.0.0", optional = true, path = "../../../primitives/keyring" }
-sp-session = { version = "2.0.0", default-features = false, path = "../../../primitives/session" }
-sp-transaction-pool = { version = "2.0.0", default-features = false, path = "../../../primitives/transaction-pool" }
-sp-version = { version = "2.0.0", default-features = false, path = "../../../primitives/version" }
+sp-authority-discovery = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/authority-discovery" }
+sp-consensus-babe = { version = "0.8.0-alpha.1", default-features = false, path = "../../../primitives/consensus/babe" }
+sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-alpha.1"}
+sp-inherents = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/inherents" }
+node-primitives = { version = "2.0.0-alpha.1", default-features = false, path = "../primitives" }
+sp-offchain = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/offchain" }
+sp-core = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/core" }
+sp-std = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/std" }
+sp-api = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/api" }
+sp-runtime = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/runtime" }
+sp-staking = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/staking" }
+sp-keyring = { version = "2.0.0-alpha.1", optional = true, path = "../../../primitives/keyring" }
+sp-session = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/session" }
+sp-transaction-pool = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/transaction-pool" }
+sp-version = { version = "2.0.0-alpha.1", default-features = false, path = "../../../primitives/version" }
# frame dependencies
-frame-executive = { version = "2.0.0", default-features = false, path = "../../../frame/executive" }
-frame-support = { version = "2.0.0", default-features = false, path = "../../../frame/support" }
-frame-system = { version = "2.0.0", default-features = false, path = "../../../frame/system" }
-frame-system-rpc-runtime-api = { version = "2.0.0", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
-pallet-authority-discovery = { version = "2.0.0", default-features = false, path = "../../../frame/authority-discovery" }
-pallet-authorship = { version = "2.0.0", default-features = false, path = "../../../frame/authorship" }
-pallet-babe = { version = "2.0.0", default-features = false, path = "../../../frame/babe" }
-pallet-balances = { version = "2.0.0", default-features = false, path = "../../../frame/balances" }
-pallet-collective = { version = "2.0.0", default-features = false, path = "../../../frame/collective" }
-pallet-contracts = { version = "2.0.0", default-features = false, path = "../../../frame/contracts" }
-pallet-contracts-primitives = { version = "2.0.0", default-features = false, path = "../../../frame/contracts/common/" }
-pallet-contracts-rpc-runtime-api = { version = "0.8.0", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
-pallet-democracy = { version = "2.0.0", default-features = false, path = "../../../frame/democracy" }
-pallet-elections-phragmen = { version = "2.0.0", default-features = false, path = "../../../frame/elections-phragmen" }
-pallet-finality-tracker = { version = "2.0.0", default-features = false, path = "../../../frame/finality-tracker" }
-pallet-grandpa = { version = "2.0.0", default-features = false, path = "../../../frame/grandpa" }
-pallet-im-online = { version = "2.0.0", default-features = false, path = "../../../frame/im-online" }
-pallet-indices = { version = "2.0.0", default-features = false, path = "../../../frame/indices" }
-pallet-identity = { version = "2.0.0", default-features = false, path = "../../../frame/identity" }
-pallet-membership = { version = "2.0.0", default-features = false, path = "../../../frame/membership" }
-pallet-offences = { version = "2.0.0", default-features = false, path = "../../../frame/offences" }
-pallet-randomness-collective-flip = { version = "2.0.0", default-features = false, path = "../../../frame/randomness-collective-flip" }
-pallet-recovery = { version = "2.0.0", default-features = false, path = "../../../frame/recovery" }
-pallet-session = { version = "2.0.0", features = ["historical"], path = "../../../frame/session", default-features = false }
-pallet-staking = { version = "2.0.0", features = ["migrate"], path = "../../../frame/staking", default-features = false }
-pallet-staking-reward-curve = { version = "2.0.0", path = "../../../frame/staking/reward-curve" }
-pallet-sudo = { version = "2.0.0", default-features = false, path = "../../../frame/sudo" }
-pallet-society = { version = "2.0.0", default-features = false, path = "../../../frame/society" }
-pallet-timestamp = { version = "2.0.0", default-features = false, path = "../../../frame/timestamp" }
-pallet-treasury = { version = "2.0.0", default-features = false, path = "../../../frame/treasury" }
-pallet-utility = { version = "2.0.0", default-features = false, path = "../../../frame/utility" }
-pallet-transaction-payment = { version = "2.0.0", default-features = false, path = "../../../frame/transaction-payment" }
-pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
-pallet-vesting = { version = "2.0.0", default-features = false, path = "../../../frame/vesting" }
+frame-executive = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/executive" }
+frame-benchmarking = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/benchmarking" }
+frame-support = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/support" }
+frame-system = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/system" }
+frame-system-rpc-runtime-api = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
+pallet-authority-discovery = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/authority-discovery" }
+pallet-authorship = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/authorship" }
+pallet-babe = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/babe" }
+pallet-balances = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/balances" }
+pallet-collective = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/collective" }
+pallet-contracts = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/contracts" }
+pallet-contracts-primitives = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/contracts/common/" }
+pallet-contracts-rpc-runtime-api = { version = "0.8.0-alpha.1", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
+pallet-democracy = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/democracy" }
+pallet-elections-phragmen = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/elections-phragmen" }
+pallet-finality-tracker = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/finality-tracker" }
+pallet-grandpa = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/grandpa" }
+pallet-im-online = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/im-online" }
+pallet-indices = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/indices" }
+pallet-identity = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/identity" }
+pallet-membership = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/membership" }
+pallet-offences = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/offences" }
+pallet-randomness-collective-flip = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/randomness-collective-flip" }
+pallet-recovery = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/recovery" }
+pallet-session = { version = "2.0.0-alpha.1", features = ["historical"], path = "../../../frame/session", default-features = false }
+pallet-staking = { version = "2.0.0-alpha.1", features = ["migrate"], path = "../../../frame/staking", default-features = false }
+pallet-staking-reward-curve = { version = "2.0.0-alpha.1", path = "../../../frame/staking/reward-curve" }
+pallet-sudo = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/sudo" }
+pallet-society = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/society" }
+pallet-timestamp = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/timestamp" }
+pallet-treasury = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/treasury" }
+pallet-utility = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/utility" }
+pallet-transaction-payment = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/transaction-payment" }
+pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
+pallet-vesting = { version = "2.0.0-alpha.1", default-features = false, path = "../../../frame/vesting" }
[build-dependencies]
-wasm-builder-runner = { version = "1.0.4", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
+wasm-builder-runner = { version = "1.0.5", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
[dev-dependencies]
-sp-io = { version = "2.0.0", path = "../../../primitives/io" }
+sp-io = { version = "2.0.0-alpha.1", path = "../../../primitives/io" }
[features]
default = ["std"]
@@ -115,6 +118,7 @@ std = [
"sp-session/std",
"pallet-sudo/std",
"frame-support/std",
+ "frame-benchmarking/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"pallet-timestamp/std",
diff --git a/bin/node/runtime/src/constants.rs b/bin/node/runtime/src/constants.rs
index b2c880c08bbf8098e16154e99f3a797a6d27eec8..bf12492f8db029dc22b519dd52af74adcad99a7f 100644
--- a/bin/node/runtime/src/constants.rs
+++ b/bin/node/runtime/src/constants.rs
@@ -38,7 +38,7 @@ pub mod time {
/// a slot being empty).
/// This value is only used indirectly to define the unit constants below
/// that are expressed in blocks. The rest of the code should use
- /// `SLOT_DURATION` instead (like the timestamp module for calculating the
+ /// `SLOT_DURATION` instead (like the Timestamp pallet for calculating the
/// minimum period).
///
/// If using BABE with secondary slots (default) then all of the slots will
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index 7b718ca21f3714b6aa2ebd858dbb916e1148b781..980f033024d6a32b567ec22ea226244626c65fbc 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -27,15 +27,17 @@ use frame_support::{
traits::{SplitTwoWays, Currency, Randomness},
};
use sp_core::u32_trait::{_1, _2, _3, _4};
-use node_primitives::{AccountId, AccountIndex, Balance, BlockNumber, Hash, Index, Moment, Signature};
+pub use node_primitives::{AccountId, Signature};
+use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
use sp_api::impl_runtime_apis;
use sp_runtime::{
- Permill, Perbill, Percent, ApplyExtrinsicResult, impl_opaque_keys, generic, create_runtime_str
+ Permill, Perbill, Percent, ApplyExtrinsicResult, impl_opaque_keys, generic, create_runtime_str,
};
use sp_runtime::curve::PiecewiseLinear;
use sp_runtime::transaction_validity::TransactionValidity;
use sp_runtime::traits::{
- self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion, ConvertInto, OpaqueKeys,
+ self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion,
+ ConvertInto, OpaqueKeys,
};
use sp_version::RuntimeVersion;
#[cfg(any(feature = "std", test))]
@@ -79,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
- spec_version: 214,
+ spec_version: 225,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
};
@@ -127,6 +129,9 @@ impl frame_system::Trait for Runtime {
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
type ModuleToIndex = ModuleToIndex;
+ type AccountData = pallet_balances::AccountData;
+ type OnNewAccount = ();
+ type OnKilledAccount = ();
}
parameter_types! {
@@ -157,27 +162,27 @@ impl pallet_babe::Trait for Runtime {
type EpochChangeTrigger = pallet_babe::ExternalTrigger;
}
+parameter_types! {
+ pub const IndexDeposit: Balance = 1 * DOLLARS;
+}
+
impl pallet_indices::Trait for Runtime {
type AccountIndex = AccountIndex;
- type IsDeadAccount = Balances;
- type ResolveHint = pallet_indices::SimpleResolveHint;
type Event = Event;
+ type Currency = Balances;
+ type Deposit = IndexDeposit;
}
parameter_types! {
pub const ExistentialDeposit: Balance = 1 * DOLLARS;
- pub const CreationFee: Balance = 1 * CENTS;
}
impl pallet_balances::Trait for Runtime {
type Balance = Balance;
- type OnReapAccount = ((((System, Staking), Contracts), Session), Recovery);
- type OnNewAccount = Indices;
- type Event = Event;
type DustRemoval = ();
- type TransferPayment = ();
+ type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
- type CreationFee = CreationFee;
+ type AccountStore = frame_system::Module;
}
parameter_types! {
@@ -232,13 +237,13 @@ parameter_types! {
}
impl pallet_session::Trait for Runtime {
- type SessionManager = Staking;
- type SessionHandler = ::KeyTypeIdProviders;
- type ShouldEndSession = Babe;
type Event = Event;
- type Keys = SessionKeys;
type ValidatorId = ::AccountId;
type ValidatorIdOf = pallet_staking::StashOf;
+ type ShouldEndSession = Babe;
+ type SessionManager = Staking;
+ type SessionHandler = ::KeyTypeIdProviders;
+ type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
}
@@ -300,7 +305,6 @@ impl pallet_democracy::Trait for Runtime {
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
- type EmergencyVotingPeriod = EmergencyVotingPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin = pallet_collective::EnsureProportionAtLeast<_1, _2, AccountId, CouncilCollective>;
@@ -312,6 +316,7 @@ impl pallet_democracy::Trait for Runtime {
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, TechnicalCollective>;
+ type EmergencyVotingPeriod = EmergencyVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin = pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>;
// Any single technical committee member may veto a coming council proposal, however they can
@@ -340,16 +345,16 @@ parameter_types! {
impl pallet_elections_phragmen::Trait for Runtime {
type Event = Event;
type Currency = Balances;
+ type ChangeMembers = Council;
type CurrencyToVote = CurrencyToVoteHandler;
type CandidacyBond = CandidacyBond;
type VotingBond = VotingBond;
- type TermDuration = TermDuration;
- type DesiredMembers = DesiredMembers;
- type DesiredRunnersUp = DesiredRunnersUp;
type LoserCandidate = ();
type BadReport = ();
type KickedMember = ();
- type ChangeMembers = Council;
+ type DesiredMembers = DesiredMembers;
+ type DesiredRunnersUp = DesiredRunnersUp;
+ type TermDuration = TermDuration;
}
type TechnicalCollective = pallet_collective::Instance2;
@@ -384,22 +389,20 @@ impl pallet_treasury::Trait for Runtime {
type Currency = Balances;
type ApproveOrigin = pallet_collective::EnsureMembers<_4, AccountId, CouncilCollective>;
type RejectOrigin = pallet_collective::EnsureMembers<_2, AccountId, CouncilCollective>;
+ type Tippers = Elections;
+ type TipCountdown = TipCountdown;
+ type TipFindersFee = TipFindersFee;
+ type TipReportDepositBase = TipReportDepositBase;
+ type TipReportDepositPerByte = TipReportDepositPerByte;
type Event = Event;
type ProposalRejection = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
- type Tippers = Elections;
- type TipCountdown = TipCountdown;
- type TipFindersFee = TipFindersFee;
- type TipReportDepositBase = TipReportDepositBase;
- type TipReportDepositPerByte = TipReportDepositPerByte;
}
parameter_types! {
- pub const ContractTransferFee: Balance = 1 * CENTS;
- pub const ContractCreationFee: Balance = 1 * CENTS;
pub const ContractTransactionBaseFee: Balance = 1 * CENTS;
pub const ContractTransactionByteFee: Balance = 10 * MILLICENTS;
pub const ContractFee: Balance = 1 * CENTS;
@@ -415,7 +418,7 @@ impl pallet_contracts::Trait for Runtime {
type Randomness = RandomnessCollectiveFlip;
type Call = Call;
type Event = Event;
- type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminator;
+ type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer;
type ComputeDispatchFee = pallet_contracts::DefaultDispatchFeeComputor;
type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter;
type GasPayment = ();
@@ -426,7 +429,6 @@ impl pallet_contracts::Trait for Runtime {
type RentByteFee = RentByteFee;
type RentDepositOffset = RentDepositOffset;
type SurchargeReward = SurchargeReward;
- type CreationFee = ContractCreationFee;
type TransactionBaseFee = ContractTransactionBaseFee;
type TransactionByteFee = ContractTransactionByteFee;
type ContractFee = ContractFee;
@@ -439,7 +441,7 @@ impl pallet_contracts::Trait for Runtime {
impl pallet_sudo::Trait for Runtime {
type Event = Event;
- type Proposal = Call;
+ type Call = Call;
}
/// A runtime transaction submitter.
@@ -451,11 +453,11 @@ parameter_types! {
impl pallet_im_online::Trait for Runtime {
type AuthorityId = ImOnlineId;
- type Call = Call;
type Event = Event;
+ type Call = Call;
type SubmitTransaction = SubmitTransaction;
- type ReportUnresponsiveness = Offences;
type SessionDuration = SessionDuration;
+ type ReportUnresponsiveness = Offences;
}
impl pallet_offences::Trait for Runtime {
@@ -492,14 +494,14 @@ parameter_types! {
impl pallet_identity::Trait for Runtime {
type Event = Event;
type Currency = Balances;
- type Slashed = Treasury;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
type SubAccountDeposit = SubAccountDeposit;
type MaxSubAccounts = MaxSubAccounts;
type MaxAdditionalFields = MaxAdditionalFields;
- type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
+ type Slashed = Treasury;
type ForceOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
+ type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
}
impl frame_system::offchain::CreateTransaction for Runtime {
@@ -597,15 +599,15 @@ construct_runtime!(
NodeBlock = node_primitives::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
- System: frame_system::{Module, Call, Storage, Config, Event},
+ System: frame_system::{Module, Call, Config, Storage, Event},
Utility: pallet_utility::{Module, Call, Storage, Event},
Babe: pallet_babe::{Module, Call, Storage, Config, Inherent(Timestamp)},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
- Indices: pallet_indices,
- Balances: pallet_balances,
+ Indices: pallet_indices::{Module, Call, Storage, Config, Event},
+ Balances: pallet_balances::{Module, Call, Storage, Config, Event},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
- Staking: pallet_staking,
+ Staking: pallet_staking::{Module, Call, Config, Storage, Event},
Session: pallet_session::{Module, Call, Storage, Event, Config},
Democracy: pallet_democracy::{Module, Call, Storage, Config, Event},
Council: pallet_collective::::{Module, Call, Storage, Origin, Event, Config},
@@ -615,8 +617,8 @@ construct_runtime!(
FinalityTracker: pallet_finality_tracker::{Module, Call, Inherent},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Treasury: pallet_treasury::{Module, Call, Storage, Config, Event},
- Contracts: pallet_contracts,
- Sudo: pallet_sudo,
+ Contracts: pallet_contracts::{Module, Call, Config, Storage, Event},
+ Sudo: pallet_sudo::{Module, Call, Config, Storage, Event},
ImOnline: pallet_im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config},
AuthorityDiscovery: pallet_authority_discovery::{Module, Call, Config},
Offences: pallet_offences::{Module, Call, Storage, Event},
@@ -683,6 +685,10 @@ impl_runtime_apis! {
Executive::apply_extrinsic(extrinsic)
}
+ fn apply_trusted_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult {
+ Executive::apply_trusted_extrinsic(extrinsic)
+ }
+
fn finalize_block() -> ::Header {
Executive::finalize_block()
}
@@ -734,6 +740,10 @@ impl_runtime_apis! {
secondary_slots: true,
}
}
+
+ fn current_epoch_start() -> sp_consensus_babe::SlotNumber {
+ Babe::current_epoch_start()
+ }
}
impl sp_authority_discovery::AuthorityDiscoveryApi for Runtime {
@@ -804,6 +814,24 @@ impl_runtime_apis! {
SessionKeys::decode_into_raw_public_keys(&encoded)
}
}
+
+ impl frame_benchmarking::Benchmark for Runtime {
+ fn dispatch_benchmark(
+ module: Vec,
+ extrinsic: Vec