BlockId removal: refactor: BlockImportOperation+Bknd::finalize_block (#12535)

* BlockId removal: refactor: BlockImportOperation+Bknd::finalize_block

It changes the arguments of methods of `BlockImportOperation` trait
from: block: `BlockId<Block>` to: hash: `&Block::Hash`
`Backend::finalize_block` was also changed.

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

* Review suggestion applied

thx to @davxy

* trigger CI job
This commit is contained in:
Michal Kucharczyk
2022-10-20 17:50:59 +02:00
committed by GitHub
parent 749bcd1949
commit 42215038a3
5 changed files with 75 additions and 77 deletions
+4 -2
View File
@@ -1371,8 +1371,10 @@ pub(crate) mod tests {
let mut best_block_stream = best_block_streams.drain(..).next().unwrap();
net.peer(0).push_blocks(2, false);
// finalize 1 and 2 without justifications
backend.finalize_block(BlockId::number(1), None).unwrap();
backend.finalize_block(BlockId::number(2), None).unwrap();
let hashof1 = backend.blockchain().expect_block_hash_from_id(&BlockId::Number(1)).unwrap();
let hashof2 = backend.blockchain().expect_block_hash_from_id(&BlockId::Number(2)).unwrap();
backend.finalize_block(&hashof1, None).unwrap();
backend.finalize_block(&hashof2, None).unwrap();
let justif = create_finality_proof(2);
// create new session at block #2