BlockId removal: refactor: StorageProvider (#12510)

* BlockId removal: refactor: StorageProvider

It changes the arguments of `Backend::StorageProvider` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/api/src/backend.rs

Co-authored-by: Dmitrii Markin <dmitry@markin.tech>

* GrandpaBlockImport::current_set_id reworked

* ExportStateCmd reworked

* trigger CI job

* trigger CI job

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Dmitrii Markin <dmitry@markin.tech>
This commit is contained in:
Michal Kucharczyk
2022-10-18 14:52:04 +02:00
committed by GitHub
parent 2f341fcf15
commit b16135f602
12 changed files with 112 additions and 120 deletions
@@ -191,9 +191,9 @@ impl StorageCmd {
B: BlockT + Debug,
BA: ClientBackend<B>,
{
let block = BlockId::Hash(client.usage_info().chain.best_hash);
let hash = client.usage_info().chain.best_hash;
let empty_prefix = StorageKey(Vec::new());
let mut keys = client.storage_keys(&block, &empty_prefix)?;
let mut keys = client.storage_keys(&hash, &empty_prefix)?;
let (mut rng, _) = new_rng(None);
keys.shuffle(&mut rng);
@@ -201,7 +201,7 @@ impl StorageCmd {
info!("Warmup round {}/{}", i + 1, self.params.warmups);
for key in keys.as_slice() {
let _ = client
.storage(&block, &key)
.storage(&hash, &key)
.expect("Checked above to exist")
.ok_or("Value unexpectedly empty");
}