Update Substrate & Polkadot (#84)

This commit is contained in:
Bastian Köcher
2020-04-29 14:23:18 +02:00
committed by GitHub
parent b9793bc2f6
commit cd7e06c643
15 changed files with 398 additions and 406 deletions
+2
View File
@@ -5,6 +5,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
sc-service = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
test-client = { package = "substrate-test-client", git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
runtime = { package = "cumulus-test-runtime", path = "../runtime" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
+8 -7
View File
@@ -21,6 +21,7 @@ use runtime::{
genesismap::{additional_storage_with_genesis, GenesisConfig},
Block,
};
use sc_service::client;
use sp_core::{sr25519, storage::Storage, ChangesTrieConfiguration};
use sp_keyring::{AccountKeyring, Sr25519Keyring};
use sp_runtime::traits::{Block as BlockT, Hash as HashT, Header as HeaderT};
@@ -42,17 +43,17 @@ pub use local_executor::LocalExecutor;
pub type Backend = test_client::Backend<Block>;
/// Test client executor.
pub type Executor =
sc_client::LocalCallExecutor<Backend, sc_executor::NativeExecutor<LocalExecutor>>;
pub type Executor = client::LocalCallExecutor<Backend, sc_executor::NativeExecutor<LocalExecutor>>;
/// Test client builder for Cumulus
pub type TestClientBuilder = test_client::TestClientBuilder<Block, Executor, Backend, GenesisParameters>;
pub type TestClientBuilder =
test_client::TestClientBuilder<Block, Executor, Backend, GenesisParameters>;
/// LongestChain type for the test runtime/client.
pub type LongestChain = test_client::sc_client::LongestChain<Backend, Block>;
pub type LongestChain = sc_consensus::LongestChain<Backend, Block>;
/// Test client type with `LocalExecutor` and generic Backend.
pub type Client = sc_client::Client<Backend, Executor, Block, runtime::RuntimeApi>;
pub type Client = client::Client<Backend, Executor, Block, runtime::RuntimeApi>;
/// Parameters of test-client builder with test-runtime.
#[derive(Default)]
@@ -71,7 +72,7 @@ impl test_client::GenesisInit for GenesisParameters {
};
let mut storage = genesis_config(changes_trie_config).genesis_map();
let child_roots = storage.children.iter().map(|(sk, child_content)| {
let child_roots = storage.children_default.iter().map(|(sk, child_content)| {
let state_root =
<<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
child_content.data.clone().into_iter().collect(),
@@ -82,7 +83,7 @@ impl test_client::GenesisInit for GenesisParameters {
<<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
storage.top.clone().into_iter().chain(child_roots).collect(),
);
let block: runtime::Block = sc_client::genesis::construct_genesis_block(state_root);
let block: runtime::Block = client::genesis::construct_genesis_block(state_root);
storage.top.extend(additional_storage_with_genesis(&block));
storage
+1 -1
View File
@@ -28,13 +28,13 @@ sp-io = { git = "https://github.com/paritytech/substrate", branch = "cumulus-bra
sp-core = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch", version = "0.8.0-alpha.5" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
+3 -2
View File
@@ -134,6 +134,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
pub const ExtrinsicBaseWeight: Weight = 10_000_000;
}
impl frame_system::Trait for Runtime {
@@ -173,6 +174,8 @@ impl frame_system::Trait for Runtime {
type OnNewAccount = ();
type OnKilledAccount = Balances;
type DbWeight = ();
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
type BlockExecutionWeight = ();
}
parameter_types! {
@@ -201,7 +204,6 @@ parameter_types! {
pub const ExistentialDeposit: u128 = 500;
pub const TransferFee: u128 = 0;
pub const CreationFee: u128 = 0;
pub const TransactionBaseFee: u128 = 0;
pub const TransactionByteFee: u128 = 1;
}
@@ -218,7 +220,6 @@ impl pallet_balances::Trait for Runtime {
impl pallet_transaction_payment::Trait for Runtime {
type Currency = Balances;
type OnTransactionPayment = ();
type TransactionBaseFee = TransactionBaseFee;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = ConvertInto;
type FeeMultiplierUpdate = ();
+3 -5
View File
@@ -23,11 +23,9 @@ use sc_cli::{
CliConfiguration, Error, ImportParams, KeystoreParams, NetworkParams, Result, SharedParams,
SubstrateCli,
};
use sc_client::genesis;
use sc_service::client::genesis;
use sc_network::config::TransportConfig;
use sc_service::{
config::{NetworkConfiguration, NodeKeyConfig, PrometheusConfig},
};
use sc_service::config::{NetworkConfiguration, NodeKeyConfig, PrometheusConfig};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::{
traits::{Block as BlockT, Hash as HashT, Header as HeaderT},
@@ -129,7 +127,7 @@ pub fn run() -> Result<()> {
let storage = (&chain_spec::get_chain_spec()).build_storage()?;
let child_roots = storage.children.iter().map(|(sk, child_content)| {
let child_roots = storage.children_default.iter().map(|(sk, child_content)| {
let state_root =
<<<Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(
child_content.data.clone().into_iter().collect(),
+1 -1
View File
@@ -48,7 +48,7 @@ macro_rules! new_full_start {
parachain_runtime::RuntimeApi,
crate::service::Executor,
>($config)?
.with_select_chain(|_config, backend| Ok(sc_client::LongestChain::new(backend.clone())))?
.with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
.with_transaction_pool(|config, client, _fetcher, prometheus_registry| {
let pool_api = Arc::new(sc_transaction_pool::FullChainApi::new(client.clone()));
let pool = sc_transaction_pool::BasicPool::new(config, pool_api, prometheus_registry);