Kill the light client, CHTs and change tries. (#10080)

* Remove light client, change tries and CHTs

* Update tests

* fmt

* Restore changes_root

* Fixed benches

* Cargo fmt

* fmt

* fmt
This commit is contained in:
Arkadiy Paronyan
2021-11-12 14:15:01 +01:00
committed by GitHub
parent 112b7dac47
commit 4cbbf0cf43
141 changed files with 532 additions and 17807 deletions
-1
View File
@@ -591,7 +591,6 @@ impl BenchKeyring {
/// Generate genesis with accounts from this keyring endowed with some balance.
pub fn generate_genesis(&self) -> node_runtime::GenesisConfig {
crate::genesis::config_endowed(
false,
Some(node_runtime::wasm_binary_unwrap()),
self.collect_account_ids(),
)
+2 -4
View File
@@ -42,13 +42,11 @@ pub type Transaction = sc_client_api::backend::TransactionFor<Backend, node_prim
/// Genesis configuration parameters for `TestClient`.
#[derive(Default)]
pub struct GenesisParameters {
support_changes_trie: bool,
}
pub struct GenesisParameters;
impl substrate_test_client::GenesisInit for GenesisParameters {
fn genesis_storage(&self) -> Storage {
crate::genesis::config(self.support_changes_trie, None).build_storage().unwrap()
crate::genesis::config(None).build_storage().unwrap()
}
}
+3 -13
View File
@@ -24,22 +24,17 @@ use node_runtime::{
GenesisConfig, GrandpaConfig, IndicesConfig, SessionConfig, SocietyConfig, StakerStatus,
StakingConfig, SystemConfig, BABE_GENESIS_EPOCH_CONFIG,
};
use sp_core::ChangesTrieConfiguration;
use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use sp_runtime::Perbill;
/// Create genesis runtime configuration for tests.
pub fn config(support_changes_trie: bool, code: Option<&[u8]>) -> GenesisConfig {
config_endowed(support_changes_trie, code, Default::default())
pub fn config(code: Option<&[u8]>) -> GenesisConfig {
config_endowed(code, Default::default())
}
/// Create genesis runtime configuration for tests with some extra
/// endowed accounts.
pub fn config_endowed(
support_changes_trie: bool,
code: Option<&[u8]>,
extra_endowed: Vec<AccountId>,
) -> GenesisConfig {
pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec<AccountId>) -> GenesisConfig {
let mut endowed = vec![
(alice(), 111 * DOLLARS),
(bob(), 100 * DOLLARS),
@@ -53,11 +48,6 @@ pub fn config_endowed(
GenesisConfig {
system: SystemConfig {
changes_trie_config: if support_changes_trie {
Some(ChangesTrieConfiguration { digest_interval: 2, digest_levels: 2 })
} else {
None
},
code: code.map(|x| x.to_vec()).unwrap_or_else(|| wasm_binary_unwrap().to_vec()),
},
indices: IndicesConfig { indices: vec![] },