Change Runtime APIs best_finalized() signature

Change Runtime APIs best_finalized() signature to return Option<HeaderId>

Signed-off-by: Serban Iorga <serban@parity.io>
This commit is contained in:
Serban Iorga
2022-07-28 15:18:40 +03:00
committed by Bastian Köcher
parent f13211344b
commit 7969459d07
14 changed files with 39 additions and 43 deletions
@@ -49,6 +49,7 @@ use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
// A few exports that help ease life for downstream crates.
use bp_runtime::{HeaderId, HeaderIdProvider};
pub use frame_support::{
construct_runtime, match_types, parameter_types,
traits::{Everything, IsInVec, Nothing, Randomness},
@@ -727,8 +728,8 @@ impl_runtime_apis! {
}
impl bp_millau::MillauFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<(bp_millau::BlockNumber, bp_millau::Hash)> {
BridgeMillauGrandpa::best_finalized().map(|header| (header.number, header.hash()))
fn best_finalized() -> Option<HeaderId<bp_millau::Hash, bp_millau::BlockNumber>> {
BridgeMillauGrandpa::best_finalized().map(|header| header.id())
}
}