BlockId removal: refactor: Finalizer (#12528)

* BlockId removal: refactor: Finalizer

It changes the arguments of methods of `Finalizer` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`

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

* minor corrections

* failing test corrected

* minor rework
This commit is contained in:
Michal Kucharczyk
2022-10-20 08:44:04 +02:00
committed by GitHub
parent 7aadc2aa3c
commit 749bcd1949
16 changed files with 113 additions and 118 deletions
@@ -20,7 +20,7 @@
use crate::rpc;
use sc_client_api::backend::{Backend as ClientBackend, Finalizer};
use sp_runtime::{generic::BlockId, traits::Block as BlockT, Justification};
use sp_runtime::{traits::Block as BlockT, Justification};
use std::{marker::PhantomData, sync::Arc};
/// params for block finalization.
@@ -46,7 +46,7 @@ where
{
let FinalizeBlockParams { hash, mut sender, justification, finalizer, .. } = params;
match finalizer.finalize_block(BlockId::Hash(hash), justification, true) {
match finalizer.finalize_block(&hash, justification, true) {
Err(e) => {
log::warn!("Failed to finalize block {}", e);
rpc::send_result(&mut sender, Err(e.into()))