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 authored and GitHub committed 2022-10-20 15:50:59 +00:00
1 parent 749bcd1949
commit 42215038a3
5 files changed
+75 -77

No files matched your search

@@ -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 =