BlockId removal: refactor: Backend::append_justification (#12551)

* BlockId removal: refactor: Backend::append_justification

It changes the arguments of `Backend::append_justification`
from: block: `BlockId<Block>` to: hash: `&Block::Hash`

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

* Error message improved

Co-authored-by: Adrian Catangiu <adrian@parity.io>

* single error message in beefy::finalize

* println removed

Co-authored-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
Michal Kucharczyk
2022-10-30 18:58:29 +01:00
committed by GitHub
parent 9bc59da6b3
commit 0ef7e261a3
4 changed files with 38 additions and 34 deletions
+2 -3
View File
@@ -27,7 +27,6 @@ use sp_blockchain;
use sp_consensus::BlockOrigin;
use sp_core::offchain::OffchainStorage;
use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, HashFor, NumberFor},
Justification, Justifications, StateVersion, Storage,
};
@@ -485,12 +484,12 @@ pub trait Backend<Block: BlockT>: AuxStore + Send + Sync {
justification: Option<Justification>,
) -> sp_blockchain::Result<()>;
/// Append justification to the block with the given Id.
/// Append justification to the block with the given `hash`.
///
/// This should only be called for blocks that are already finalized.
fn append_justification(
&self,
block: BlockId<Block>,
hash: &Block::Hash,
justification: Justification,
) -> sp_blockchain::Result<()>;