BlockId removal: &Hash to Hash (#12626)

It changes &Block::Hash argument to Block::Hash.

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)
This commit is contained in:
Michal Kucharczyk
2022-11-07 22:42:16 +01:00
committed by GitHub
parent 7c4bfc9749
commit 1ed70004e7
49 changed files with 428 additions and 441 deletions
@@ -193,7 +193,7 @@ impl StorageCmd {
{
let hash = client.usage_info().chain.best_hash;
let empty_prefix = StorageKey(Vec::new());
let mut keys = client.storage_keys(&hash, &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(&hash, &key)
.storage(hash, &key)
.expect("Checked above to exist")
.ok_or("Value unexpectedly empty");
}
@@ -43,7 +43,7 @@ impl StorageCmd {
info!("Preparing keys from block {}", best_hash);
// Load all keys and randomly shuffle them.
let empty_prefix = StorageKey(Vec::new());
let mut keys = client.storage_keys(&best_hash, &empty_prefix)?;
let mut keys = client.storage_keys(best_hash, &empty_prefix)?;
let (mut rng, _) = new_rng(None);
keys.shuffle(&mut rng);
@@ -55,7 +55,7 @@ impl StorageCmd {
match (self.params.include_child_trees, self.is_child_key(key.clone().0)) {
(true, Some(info)) => {
// child tree key
let child_keys = client.child_storage_keys(&best_hash, &info, &empty_prefix)?;
let child_keys = client.child_storage_keys(best_hash, &info, &empty_prefix)?;
for ck in child_keys {
child_nodes.push((ck.clone(), info.clone()));
}
@@ -64,7 +64,7 @@ impl StorageCmd {
// regular key
let start = Instant::now();
let v = client
.storage(&best_hash, &key)
.storage(best_hash, &key)
.expect("Checked above to exist")
.ok_or("Value unexpectedly empty")?;
record.append(v.0.len(), start.elapsed())?;
@@ -79,7 +79,7 @@ impl StorageCmd {
for (key, info) in child_nodes.as_slice() {
let start = Instant::now();
let v = client
.child_storage(&best_hash, info, key)
.child_storage(best_hash, info, key)
.expect("Checked above to exist")
.ok_or("Value unexpectedly empty")?;
record.append(v.0.len(), start.elapsed())?;
@@ -77,7 +77,7 @@ impl StorageCmd {
match (self.params.include_child_trees, self.is_child_key(k.to_vec())) {
(true, Some(info)) => {
let child_keys =
client.child_storage_keys_iter(&best_hash, info.clone(), None, None)?;
client.child_storage_keys_iter(best_hash, info.clone(), None, None)?;
for ck in child_keys {
child_nodes.push((ck.clone(), info.clone()));
}
@@ -124,7 +124,7 @@ impl StorageCmd {
for (key, info) in child_nodes {
if let Some(original_v) = client
.child_storage(&best_hash, &info.clone(), &key)
.child_storage(best_hash, &info.clone(), &key)
.expect("Checked above to exist")
{
let mut new_v = vec![0; original_v.0.len()];