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
@@ -878,17 +878,17 @@ where
// plugable we cannot make a better choice here. usages that need
// an accurate "best" block need to go through `SelectChain`
// instead.
operation.op.mark_head(BlockId::Hash(block))?;
operation.op.mark_head(&block)?;
}
let enacted = route_from_finalized.enacted();
assert!(enacted.len() > 0);
for finalize_new in &enacted[..enacted.len() - 1] {
operation.op.mark_finalized(BlockId::Hash(finalize_new.hash), None)?;
operation.op.mark_finalized(&finalize_new.hash, None)?;
}
assert_eq!(enacted.last().map(|e| e.hash), Some(block));
operation.op.mark_finalized(BlockId::Hash(block), justification)?;
operation.op.mark_finalized(&block, justification)?;
if notify {
let finalized =