From f1829f3f414d3a4cc4e11ddd6b22b047a7e8d3c7 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Thu, 11 Jan 2024 19:50:26 +0100 Subject: [PATCH 1/2] Kitchensink: Fix pallet_mmr config --- substrate/bin/node/runtime/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 = (); } From 85aa81019ea75e2147e894b650129cdf6ea00360 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Fri, 12 Jan 2024 11:18:44 +0100 Subject: [PATCH 2/2] Fix unit test --- substrate/bin/node/cli/tests/basic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }