mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
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:
committed by
GitHub
parent
7c4bfc9749
commit
1ed70004e7
@@ -142,7 +142,7 @@ where
|
||||
let block_hash = self.client.expect_block_hash_from_id(block)?;
|
||||
let mut raw_weight = &self
|
||||
.client
|
||||
.storage(&block_hash, &key)?
|
||||
.storage(block_hash, &key)?
|
||||
.ok_or(format!("Could not find System::BlockWeight for block: {}", block))?
|
||||
.0[..];
|
||||
|
||||
|
||||
@@ -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()];
|
||||
|
||||
Reference in New Issue
Block a user