From 19179b589155926507f56957177212b685e03d44 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Fri, 12 Jan 2024 12:22:07 +0100 Subject: [PATCH] Kitchensink: Fix pallet_mmr config (#2919) Related to https://github.com/paritytech/polkadot-sdk/issues/2787 Fixes `pallet_mmr::Config` for the kitchensink runtime --- substrate/bin/node/cli/tests/basic.rs | 2 +- substrate/bin/node/runtime/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/bin/node/cli/tests/basic.rs b/substrate/bin/node/cli/tests/basic.rs index e5a8a397254e5..525ab2e39c128 100644 --- a/substrate/bin/node/cli/tests/basic.rs +++ b/substrate/bin/node/cli/tests/basic.rs @@ -154,7 +154,7 @@ fn blocks() -> ((Vec, Hash), (Vec, Hash)) { // session change => consensus authorities change => authorities change digest item appears let digest = Header::decode(&mut &block2.0[..]).unwrap().digest; - assert_eq!(digest.logs().len(), 1 /* Just babe slot */); + assert_eq!(digest.logs().len(), 2 /* Just babe and BEEFY slots */); (block1, block2) } diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index ec1601929fcf3..1043e5017dc36 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -879,7 +879,7 @@ parameter_types! { pub const MaxPointsToBalance: u8 = 10; } -use sp_runtime::traits::Convert; +use sp_runtime::traits::{Convert, Keccak256}; pub struct BalanceToU256; impl Convert for BalanceToU256 { fn convert(balance: Balance) -> sp_core::U256 { @@ -1578,9 +1578,9 @@ impl pallet_vesting::Config for Runtime { impl pallet_mmr::Config for Runtime { const INDEXING_PREFIX: &'static [u8] = b"mmr"; - type Hashing = ::Hashing; + type Hashing = Keccak256; type LeafData = pallet_mmr::ParentNumberAndHash; - type OnNewRoot = (); + type OnNewRoot = pallet_beefy_mmr::DepositBeefyDigest; type WeightInfo = (); }