Bring runtime API up to date with Substrate master (#17)

* Fixups for 646

* Fixes for API

* For for #678

* Fix runtime

* Update and build

* Tests build

* Fix tests
This commit is contained in:
Gav Wood
2018-09-12 19:36:33 +02:00
committed by Arkadiy Paronyan
parent 17ede5b8a0
commit 84748fccd3
44 changed files with 1491 additions and 2184 deletions
+5 -4
View File
@@ -16,8 +16,7 @@
//! Polkadot chain configurations.
use ed25519;
use primitives::AuthorityId;
use primitives::{AuthorityId, ed25519};
use polkadot_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyConfig,
SessionConfig, StakingConfig, TimestampConfig, BalancesConfig};
use service::ChainSpec;
@@ -60,7 +59,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
staking: Some(StakingConfig {
current_era: 0,
intentions: initial_authorities.iter().cloned().map(Into::into).collect(),
early_era_slash: 10000,
offline_slash: 10000,
session_reward: 100,
validator_count: 12,
sessions_per_era: 12, // 1 hour per era
@@ -92,6 +91,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
timestamp: Some(TimestampConfig {
period: 5, // 5 second block time.
}),
treasury: Some(Default::default()),
}
}
@@ -142,7 +142,7 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>) -> GenesisConfig {
validator_count: 2,
sessions_per_era: 5,
bonding_duration: 2 * 60 * 12,
early_era_slash: 0,
offline_slash: 0,
session_reward: 0,
offline_slash_grace: 0,
}),
@@ -170,6 +170,7 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>) -> GenesisConfig {
timestamp: Some(TimestampConfig {
period: 5, // 5 second block time.
}),
treasury: Some(Default::default()),
}
}
+3 -4
View File
@@ -18,7 +18,6 @@
//! Polkadot service. Specialized wrapper over substrate service.
extern crate ed25519;
extern crate polkadot_availability_store as av_store;
extern crate polkadot_primitives;
extern crate polkadot_runtime;
@@ -50,7 +49,7 @@ use client::{Client, BlockchainEvents};
use polkadot_network::{PolkadotProtocol, consensus::ConsensusNetwork};
use tokio::runtime::TaskExecutor;
use service::FactoryFullConfiguration;
use primitives::{KeccakHasher, RlpCodec};
use primitives::{Blake2Hasher, RlpCodec};
pub use service::{Roles, PruningMode, ExtrinsicPoolOptions,
ErrorKind, Error, ComponentBlock, LightComponents, FullComponents};
@@ -67,9 +66,9 @@ pub trait Components: service::Components {
/// Polkadot API.
type Api: 'static + PolkadotApi + Send + Sync;
/// Client backend.
type Backend: 'static + client::backend::Backend<Block, KeccakHasher, RlpCodec>;
type Backend: 'static + client::backend::Backend<Block, Blake2Hasher, RlpCodec>;
/// Client executor.
type Executor: 'static + client::CallExecutor<Block, KeccakHasher, RlpCodec> + Send + Sync;
type Executor: 'static + client::CallExecutor<Block, Blake2Hasher, RlpCodec> + Send + Sync;
}
impl Components for service::LightComponents<Factory> {