mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Convert unnecessary storage item to static. (#3093)
* Convert unnecessary storage item to static. * Polish * 6 second blocks. * Compile fixes * Bump runtime * Fix * Another fix * Import `srml_support::traits::Get` * Export MinimumPeriod from `decl_module!` * Remove `config` from Timestamp * Clean up warnings
This commit is contained in:
@@ -21,8 +21,8 @@ use node_primitives::{AccountId, AuraId, Balance};
|
||||
use node_runtime::{
|
||||
GrandpaConfig, BalancesConfig, ContractsConfig, ElectionsConfig, DemocracyConfig, CouncilConfig,
|
||||
AuraConfig, IndicesConfig, SessionConfig, StakingConfig, SudoConfig, TechnicalCommitteeConfig,
|
||||
SystemConfig, TimestampConfig, WASM_BINARY, Perbill, SessionKeys, StakerStatus, DAYS, DOLLARS,
|
||||
MILLICENTS, SECS_PER_BLOCK,
|
||||
SystemConfig, WASM_BINARY, Perbill, SessionKeys, StakerStatus, DAYS, DOLLARS,
|
||||
MILLICENTS,
|
||||
};
|
||||
pub use node_runtime::GenesisConfig;
|
||||
use substrate_service;
|
||||
@@ -144,9 +144,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
term_duration: 28 * DAYS,
|
||||
desired_seats: 0,
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
minimum_period: SECS_PER_BLOCK / 2, // due to the nature of aura the slots are 2*period
|
||||
}),
|
||||
contracts: Some(ContractsConfig {
|
||||
current_schedule: Default::default(),
|
||||
gas_price: 1 * MILLICENTS,
|
||||
@@ -281,9 +278,6 @@ pub fn testnet_genesis(
|
||||
term_duration: 1000000,
|
||||
desired_seats: desired_seats,
|
||||
}),
|
||||
timestamp: Some(TimestampConfig {
|
||||
minimum_period: 2, // 2*2=4 second block time.
|
||||
}),
|
||||
contracts: Some(ContractsConfig {
|
||||
current_schedule: contracts::Schedule {
|
||||
enable_println, // this should only be enabled on development chains
|
||||
@@ -342,23 +336,15 @@ pub(crate) mod tests {
|
||||
use service_test;
|
||||
use crate::service::Factory;
|
||||
|
||||
fn local_testnet_genesis_instant() -> GenesisConfig {
|
||||
let mut genesis = local_testnet_genesis();
|
||||
genesis.timestamp = Some(TimestampConfig { minimum_period: 1 });
|
||||
genesis
|
||||
}
|
||||
|
||||
fn local_testnet_genesis_instant_single() -> GenesisConfig {
|
||||
let mut genesis = testnet_genesis(
|
||||
testnet_genesis(
|
||||
vec![
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
],
|
||||
get_account_id_from_seed("Alice"),
|
||||
None,
|
||||
false,
|
||||
);
|
||||
genesis.timestamp = Some(TimestampConfig { minimum_period: 1 });
|
||||
genesis
|
||||
)
|
||||
}
|
||||
|
||||
/// Local testnet config (single validator - Alice)
|
||||
@@ -377,7 +363,7 @@ pub(crate) mod tests {
|
||||
|
||||
/// Local testnet config (multivalidator Alice + Bob)
|
||||
pub fn integration_test_config_with_two_authorities() -> ChainSpec {
|
||||
ChainSpec::from_genesis("Integration Test", "test", local_testnet_genesis_instant, vec![], None, None, None, None)
|
||||
ChainSpec::from_genesis("Integration Test", "test", local_testnet_genesis, vec![], None, None, None, None)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -38,7 +38,7 @@ use inherents::InherentData;
|
||||
use timestamp;
|
||||
use finality_tracker;
|
||||
|
||||
// TODO get via api: <timestamp::Module<T>>::minimum_period(). See #2587.
|
||||
// TODO get via api: <T as timestamp::Trait>::MinimumPeriod::get(). See #2587.
|
||||
const MINIMUM_PERIOD: u64 = 99;
|
||||
|
||||
pub struct FactoryState<N> {
|
||||
|
||||
@@ -346,7 +346,6 @@ mod tests {
|
||||
collective_Instance1: Some(Default::default()),
|
||||
collective_Instance2: Some(Default::default()),
|
||||
elections: Some(Default::default()),
|
||||
timestamp: Some(Default::default()),
|
||||
contracts: Some(ContractsConfig {
|
||||
current_schedule: Default::default(),
|
||||
gas_price: 1 * MILLICENTS,
|
||||
|
||||
@@ -69,7 +69,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
// and set impl_version to equal spec_version. If only runtime
|
||||
// implementation changes and behavior does not, then leave spec_version as
|
||||
// is and increment impl_version.
|
||||
spec_version: 109,
|
||||
spec_version: 110,
|
||||
impl_version: 110,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
@@ -161,9 +161,13 @@ impl balances::Trait for Runtime {
|
||||
type TransactionByteFee = TransactionByteFee;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const MinimumPeriod: u64 = SECS_PER_BLOCK / 2;
|
||||
}
|
||||
impl timestamp::Trait for Runtime {
|
||||
type Moment = Moment;
|
||||
type OnTimestampSet = Aura;
|
||||
type MinimumPeriod = MinimumPeriod;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -407,7 +411,7 @@ construct_runtime!(
|
||||
{
|
||||
System: system::{Module, Call, Storage, Config, Event},
|
||||
Aura: aura::{Module, Call, Storage, Config<T>, Inherent(Timestamp)},
|
||||
Timestamp: timestamp::{Module, Call, Storage, Config<T>, Inherent},
|
||||
Timestamp: timestamp::{Module, Call, Storage, Inherent},
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Indices: indices,
|
||||
Balances: balances,
|
||||
|
||||
Reference in New Issue
Block a user