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 authored and GitHub committed 2022-11-07 21:42:16 +00:00
1 parent 7c4bfc9749
commit 1ed70004e7
49 files changed
+428 -441

No files matched your search

+5 -5
View File
@@ -822,7 +822,7 @@ fn revert_not_allowed_for_finalized() {
let canon = propose_and_import_blocks_wrap(BlockId::Number(0), 3);
// Finalize best block
client.finalize_block(&canon[2], None, false).unwrap();
client.finalize_block(canon[2], None, false).unwrap();
// Revert canon chain to last finalized block
revert(client.clone(), backend, 100).expect("revert should work for baked test scenario");
@@ -884,7 +884,7 @@ fn importing_epoch_change_block_prunes_tree() {
// We finalize block #13 from the canon chain, so on the next epoch
// change the tree should be pruned, to not contain F (#7).
client.finalize_block(&canon_hashes[12], None, false).unwrap();
client.finalize_block(canon_hashes[12], None, false).unwrap();
propose_and_import_blocks_wrap(BlockId::Hash(client.chain_info().best_hash), 7);
// at this point no hashes from the first fork must exist on the tree
@@ -911,7 +911,7 @@ fn importing_epoch_change_block_prunes_tree() {
.any(|h| fork_3.contains(h)),);
// finalizing block #25 from the canon chain should prune out the second fork
client.finalize_block(&canon_hashes[24], None, false).unwrap();
client.finalize_block(canon_hashes[24], None, false).unwrap();
propose_and_import_blocks_wrap(BlockId::Hash(client.chain_info().best_hash), 8);
// at this point no hashes from the second fork must exist on the tree
@@ -1049,7 +1049,7 @@ fn obsolete_blocks_aux_data_cleanup() {
assert!(aux_data_check(&fork3_hashes, true));
// Finalize A3
client.finalize_block(&fork1_hashes[2], None, true).unwrap();
client.finalize_block(fork1_hashes[2], None, true).unwrap();
// Wiped: A1, A2
assert!(aux_data_check(&fork1_hashes[..2], false));
@@ -1060,7 +1060,7 @@ fn obsolete_blocks_aux_data_cleanup() {
// Present C4, C5
assert!(aux_data_check(&fork3_hashes, true));
client.finalize_block(&fork1_hashes[3], None, true).unwrap();
client.finalize_block(fork1_hashes[3], None, true).unwrap();
// Wiped: A3
assert!(aux_data_check(&fork1_hashes[2..3], false));