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
@@ -332,7 +332,7 @@ where
let hash = header.hash();
let parent_hash = *header.parent_hash();
let justifications =
if get_justification { self.client.justifications(&hash)? } else { None };
if get_justification { self.client.justifications(hash)? } else { None };
let (justifications, justification, is_empty_justification) =
if support_multiple_justifications {
@@ -361,7 +361,7 @@ where
};
let body = if get_body {
match self.client.block_body(&hash)? {
match self.client.block_body(hash)? {
Some(mut extrinsics) =>
extrinsics.iter_mut().map(|extrinsic| extrinsic.encode()).collect(),
None => {
@@ -374,7 +374,7 @@ where
};
let indexed_body = if get_indexed_body {
match self.client.block_indexed_body(&hash)? {
match self.client.block_indexed_body(hash)? {
Some(transactions) => transactions,
None => {
log::trace!(
+2 -2
View File
@@ -3201,7 +3201,7 @@ mod test {
let finalized_block = blocks[MAX_BLOCKS_TO_LOOK_BACKWARDS as usize * 2 - 1].clone();
let just = (*b"TEST", Vec::new());
client.finalize_block(&finalized_block.hash(), Some(just)).unwrap();
client.finalize_block(finalized_block.hash(), Some(just)).unwrap();
sync.update_chain_info(&info.best_hash, info.best_number);
let peer_id1 = PeerId::random();
@@ -3333,7 +3333,7 @@ mod test {
let finalized_block = blocks[MAX_BLOCKS_TO_LOOK_BACKWARDS as usize * 2 - 1].clone();
let just = (*b"TEST", Vec::new());
client.finalize_block(&finalized_block.hash(), Some(just)).unwrap();
client.finalize_block(finalized_block.hash(), Some(just)).unwrap();
sync.update_chain_info(&info.best_hash, info.best_number);
let peer_id1 = PeerId::random();
@@ -205,14 +205,14 @@ where
if !request.no_proof {
let (proof, _count) = self.client.read_proof_collection(
&block,
block,
request.start.as_slice(),
MAX_RESPONSE_BYTES,
)?;
response.proof = proof.encode();
} else {
let entries = self.client.storage_collection(
&block,
block,
request.start.as_slice(),
MAX_RESPONSE_BYTES,
)?;