mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21:10 +00:00
pallet-beefy-mmr: fix when using custom hashing (#14273)
`Hash` is no longer part of `pallet_mmr::Config`, but this code would still build because it assumes we're referring to underlying `<pallet_mmr::Config as frame_system::Config>::Hash` which is not what we want when using different hashing between `frame_system` and `pallet_mmr`. Disambiguate by using correct `pallet_mmr::Config::Hashing` type. Signed-off-by: acatangiu <adrian@parity.io>
This commit is contained in:
@@ -56,7 +56,7 @@ pub struct DepositBeefyDigest<T>(sp_std::marker::PhantomData<T>);
|
||||
|
||||
impl<T> pallet_mmr::primitives::OnNewRoot<sp_consensus_beefy::MmrRootHash> for DepositBeefyDigest<T>
|
||||
where
|
||||
T: pallet_mmr::Config<Hash = sp_consensus_beefy::MmrRootHash>,
|
||||
T: pallet_mmr::Config<Hashing = sp_consensus_beefy::MmrHashing>,
|
||||
T: pallet_beefy::Config,
|
||||
{
|
||||
fn on_new_root(root: &sp_consensus_beefy::MmrRootHash) {
|
||||
|
||||
@@ -47,7 +47,7 @@ use codec::{Codec, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_application_crypto::RuntimeAppPublic;
|
||||
use sp_core::H256;
|
||||
use sp_runtime::traits::{Hash, NumberFor};
|
||||
use sp_runtime::traits::{Hash, Keccak256, NumberFor};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
/// Key type for BEEFY module.
|
||||
@@ -156,6 +156,8 @@ impl<AuthorityId> ValidatorSet<AuthorityId> {
|
||||
/// The index of an authority.
|
||||
pub type AuthorityIndex = u32;
|
||||
|
||||
/// The Hashing used within MMR.
|
||||
pub type MmrHashing = Keccak256;
|
||||
/// The type used to represent an MMR root hash.
|
||||
pub type MmrRootHash = H256;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user