From 7f764dbd37425b61c3ff30f39b61e42e27c05593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= <mich@elmueller.net> Date: Tue, 13 Aug 2019 20:16:02 +0200 Subject: [PATCH] Replace config field with default value (srml/im-online) (#3388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix whitespacing * Replace configurable fields with default values * Bump version * Apply suggestions from code review Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Fix more whitespacing * Fix style --- substrate/core/network/src/protocol/light_dispatch.rs | 2 +- substrate/node/cli/src/chain_spec.rs | 6 ++---- substrate/node/runtime/src/lib.rs | 4 ++-- substrate/srml/contracts/src/tests.rs | 2 +- substrate/srml/im-online/src/lib.rs | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/substrate/core/network/src/protocol/light_dispatch.rs b/substrate/core/network/src/protocol/light_dispatch.rs index a7b327686af..e56ed3a08ee 100644 --- a/substrate/core/network/src/protocol/light_dispatch.rs +++ b/substrate/core/network/src/protocol/light_dispatch.rs @@ -668,7 +668,7 @@ pub mod tests { use sr_primitives::traits::{Block as BlockT, NumberFor, Header as HeaderT}; use client::{error::{Error as ClientError, Result as ClientResult}}; use client::light::fetcher::{FetchChecker, RemoteHeaderRequest, - ChangesProof, RemoteCallRequest, RemoteReadRequest, + ChangesProof, RemoteCallRequest, RemoteReadRequest, RemoteReadChildRequest, RemoteChangesRequest, RemoteBodyRequest}; use crate::config::Roles; use crate::message::{self, BlockAttributes, Direction, FromBlock, RequestId}; diff --git a/substrate/node/cli/src/chain_spec.rs b/substrate/node/cli/src/chain_spec.rs index acedb5c14bb..fbc3f18f65c 100644 --- a/substrate/node/cli/src/chain_spec.rs +++ b/substrate/node/cli/src/chain_spec.rs @@ -19,9 +19,9 @@ use primitives::{Pair, Public, crypto::UncheckedInto}; pub use node_primitives::{AccountId, Balance}; use node_runtime::{ - BabeConfig, BalancesConfig, ContractsConfig, CouncilConfig, DemocracyConfig, + BabeConfig, BalancesConfig, ContractsConfig, CouncilConfig, DemocracyConfig, ElectionsConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, Perbill, - SessionConfig, SessionKeys, StakerStatus, StakingConfig, SudoConfig, SystemConfig, + SessionConfig, SessionKeys, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, WASM_BINARY, }; use node_runtime::constants::{time::*, currency::*}; @@ -169,7 +169,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig { authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(), }), im_online: Some(ImOnlineConfig { - gossip_at: 0, keys: initial_authorities.iter().map(|x| x.4.clone()).collect(), }), grandpa: Some(GrandpaConfig { @@ -302,7 +301,6 @@ pub fn testnet_genesis( authorities: initial_authorities.iter().map(|x| (x.3.clone(), 1)).collect(), }), im_online: Some(ImOnlineConfig{ - gossip_at: 0, keys: initial_authorities.iter().map(|x| x.4.clone()).collect(), }), grandpa: Some(GrandpaConfig { diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index e47a6d8df70..9deaa5852ad 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -81,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. spec_version: 140, - impl_version: 140, + impl_version: 141, apis: RUNTIME_API_VERSIONS, }; @@ -436,7 +436,7 @@ construct_runtime!( Treasury: treasury::{Module, Call, Storage, Event<T>}, Contracts: contracts, Sudo: sudo, - ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config<T>}, + ImOnline: im_online::{Module, Call, Storage, Event, ValidateUnsigned, Config}, } ); diff --git a/substrate/srml/contracts/src/tests.rs b/substrate/srml/contracts/src/tests.rs index 9c338a5abd9..224d01d48aa 100644 --- a/substrate/srml/contracts/src/tests.rs +++ b/substrate/srml/contracts/src/tests.rs @@ -35,7 +35,7 @@ use sr_primitives::traits::{BlakeTwo256, Hash, IdentityLookup}; use sr_primitives::{Perbill, BuildStorage}; use srml_support::{ assert_ok, assert_err, impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types, - storage::child, StorageMap, StorageValue, traits::{Currency, Get}, + storage::child, StorageMap, StorageValue, traits::{Currency, Get}, }; use std::cell::RefCell; use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/substrate/srml/im-online/src/lib.rs b/substrate/srml/im-online/src/lib.rs index eff811d6cac..512fca0c0c5 100644 --- a/substrate/srml/im-online/src/lib.rs +++ b/substrate/srml/im-online/src/lib.rs @@ -70,7 +70,7 @@ use primitives::offchain::{OpaqueNetworkState, StorageKind}; use codec::{Encode, Decode}; use sr_primitives::{ - ApplyError, traits::{Extrinsic as ExtrinsicT}, + ApplyError, traits::Extrinsic as ExtrinsicT, transaction_validity::{TransactionValidity, TransactionLongevity, ValidTransaction}, }; use rstd::prelude::*; @@ -174,7 +174,7 @@ decl_event!( decl_storage! { trait Store for Module<T: Trait> as ImOnline { /// The block number when we should gossip. - GossipAt get(gossip_at) config(): T::BlockNumber; + GossipAt get(gossip_at): T::BlockNumber; /// The current set of keys that may issue a heartbeat. Keys get(keys) config(): Vec<AuthorityId>; -- GitLab