From 7c13412775ed59534a7b4877de4039e2c7705aaa Mon Sep 17 00:00:00 2001 From: Robert Hambrock Date: Tue, 28 Nov 2023 14:42:31 +0100 Subject: [PATCH] account for #2446 --- substrate/primitives/consensus/beefy/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/substrate/primitives/consensus/beefy/src/lib.rs b/substrate/primitives/consensus/beefy/src/lib.rs index 90bf075eca3b0..a73e3fd70ba06 100644 --- a/substrate/primitives/consensus/beefy/src/lib.rs +++ b/substrate/primitives/consensus/beefy/src/lib.rs @@ -49,7 +49,7 @@ use codec::{Codec, Decode, Encode}; use scale_info::TypeInfo; use sp_application_crypto::RuntimeAppPublic; use sp_core::H256; -use sp_runtime::traits::{Hash, Header, Keccak256, NumberFor}; +use sp_runtime::traits::{Hash, Header as HeaderT, Keccak256, NumberFor}; use sp_std::prelude::*; /// Key type for BEEFY module. @@ -319,7 +319,9 @@ pub struct ForkEquivocationProof { pub ancestry_proof: Option>, } -impl ForkEquivocationProof { +impl + ForkEquivocationProof +{ /// Returns the authority id of the misbehaving voter. pub fn offender_ids(&self) -> Vec<&Id> { self.signatories.iter().map(|(id, _)| id).collect() @@ -392,7 +394,7 @@ fn check_header_proof
( expected_header_hash: &Header::Hash, ) -> bool where - Header: sp_api::HeaderT, + Header: HeaderT, { if let Some(correct_header) = correct_header { let expected_mmr_root_digest = mmr::find_mmr_root_digest::
(correct_header); @@ -425,7 +427,7 @@ fn check_ancestry_proof( mmr_size: u64, ) -> bool where - Header: sp_api::HeaderT, + Header: HeaderT, NodeHash: Clone + Debug + PartialEq + Encode + Decode, Hasher: mmr_lib::Merge, { @@ -514,7 +516,7 @@ pub fn check_fork_equivocation_proof( where Id: BeefyAuthorityId + PartialEq, MsgHash: Hash, - Header: sp_api::HeaderT, + Header: HeaderT, NodeHash: Clone + Debug + PartialEq + Encode + Decode, Hasher: mmr_lib::Merge, {