Update substrate and polkadot (#50)

* Update Cargo.lock

* Fix for substrate update

* Update Cargo.lock

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Update Cargo.lock

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* Fix for substrate update

* WIP

* Temporary fix until polkadot is fixed

* WIP

* WIP
This commit is contained in:
Cecile Tonglet
2020-02-03 15:39:51 +01:00
committed by GitHub
parent 539f83efbf
commit 0efd15c0c5
13 changed files with 756 additions and 620 deletions
+10 -5
View File
@@ -21,7 +21,7 @@ use runtime::{
genesismap::{additional_storage_with_genesis, GenesisConfig},
Block,
};
use sp_core::{sr25519, storage::Storage};
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};
pub use test_client::*;
@@ -46,7 +46,7 @@ pub type Executor =
sc_client::LocalCallExecutor<Backend, sc_executor::NativeExecutor<LocalExecutor>>;
/// Test client builder for Cumulus
pub type TestClientBuilder = test_client::TestClientBuilder<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>;
@@ -64,7 +64,12 @@ impl test_client::GenesisInit for GenesisParameters {
fn genesis_storage(&self) -> Storage {
use codec::Encode;
let mut storage = genesis_config(self.support_changes_trie).genesis_map();
let changes_trie_config: Option<ChangesTrieConfiguration> = if self.support_changes_trie {
Some(sp_test_primitives::changes_trie_config())
} else {
None
};
let mut storage = genesis_config(changes_trie_config).genesis_map();
let child_roots = storage.children.iter().map(|(sk, child_content)| {
let state_root =
@@ -121,9 +126,9 @@ impl DefaultTestClientBuilderExt for TestClientBuilder {
}
}
fn genesis_config(support_changes_trie: bool) -> GenesisConfig {
fn genesis_config(changes_trie_config: Option<ChangesTrieConfiguration>) -> GenesisConfig {
GenesisConfig::new(
support_changes_trie,
changes_trie_config,
vec![
sr25519::Public::from(Sr25519Keyring::Alice).into(),
sr25519::Public::from(Sr25519Keyring::Bob).into(),