mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 10:01:17 +00:00
EnumerableStorageMap (#1763)
* Refactor decl_storage a bit to allow easier impl of linked map. * A bunch of refactorings for storage generation. - Rename StorageMap and ChildrenStorageMap to avoid confusion with generator::StorageMap. - Separate implementation from the procedural macro code to clean it up. - Make sure that genesis is initialised using the `StorageValue/StorageMap` generated implementations instead of going RAW. * WiP: Writing test. * Basic implementation. * Implement enumeration. * Fix non-std issues. * fix warning * Fix test-client. * Address review grumbles - part 1 * Avoid cloning the key, relax Storage requirements. * Rebuild runtime. * Remove dangling todo.
This commit is contained in:
committed by
Bastian Köcher
parent
6e26c52191
commit
9e2710246f
@@ -35,7 +35,7 @@ pub use consensus;
|
||||
|
||||
use std::sync::Arc;
|
||||
use primitives::Blake2Hasher;
|
||||
use runtime_primitives::StorageMap;
|
||||
use runtime_primitives::StorageOverlay;
|
||||
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash as HashT};
|
||||
use runtime::genesismap::{GenesisConfig, additional_storage_with_genesis};
|
||||
use keyring::Keyring;
|
||||
@@ -126,7 +126,7 @@ fn genesis_config(support_changes_trie: bool) -> GenesisConfig {
|
||||
], 1000)
|
||||
}
|
||||
|
||||
fn genesis_storage(support_changes_trie: bool) -> StorageMap {
|
||||
fn genesis_storage(support_changes_trie: bool) -> StorageOverlay {
|
||||
let mut storage = genesis_config(support_changes_trie).genesis_map();
|
||||
let state_root = <<<runtime::Block as BlockT>::Header as HeaderT>::Hashing as HashT>::trie_root(storage.clone().into_iter());
|
||||
let block: runtime::Block = client::genesis::construct_genesis_block(state_root);
|
||||
|
||||
Reference in New Issue
Block a user