From 6644e25752cc0bd3b9cd3bc35c3aa1dbf3622221 Mon Sep 17 00:00:00 2001 From: Guantong Date: Wed, 18 Jan 2023 07:43:48 +0800 Subject: [PATCH] Companion for paritytech/parity-bridges-common#1691 --- modules/grandpa/src/mock.rs | 3 +-- modules/messages/src/mock.rs | 10 +++------- modules/parachains/src/mock.rs | 7 +++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/modules/grandpa/src/mock.rs b/modules/grandpa/src/mock.rs index ba4df1ceb..2d28f5372 100644 --- a/modules/grandpa/src/mock.rs +++ b/modules/grandpa/src/mock.rs @@ -55,7 +55,6 @@ frame_support::construct_runtime! { } frame_support::parameter_types! { - pub const BlockHashCount: u64 = 250; pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); @@ -64,7 +63,7 @@ impl frame_system::Config for TestRuntime { type AccountData = (); type AccountId = AccountId; type BaseCallFilter = Everything; - type BlockHashCount = BlockHashCount; + type BlockHashCount = ConstU64<250>; type BlockLength = (); type BlockNumber = u64; type BlockWeights = (); diff --git a/modules/messages/src/mock.rs b/modules/messages/src/mock.rs index 5bdaecece..79d535009 100644 --- a/modules/messages/src/mock.rs +++ b/modules/messages/src/mock.rs @@ -47,7 +47,7 @@ use frame_support::{ weights::{RuntimeDbWeight, Weight}, }; use frame_system::mocking::*; -use sp_core::H256; +use sp_core::{H256, ConstU64}; use sp_runtime::{ testing::Header as SubstrateHeader, traits::{BlakeTwo256, IdentityLookup}, @@ -128,7 +128,6 @@ frame_support::construct_runtime! { } parameter_types! { - pub const BlockHashCount: u64 = 250; pub const MaximumBlockWeight: Weight = Weight::from_ref_time(1024); pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); @@ -138,7 +137,7 @@ impl frame_system::Config for TestRuntime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; type BaseCallFilter = frame_support::traits::Everything; - type BlockHashCount = BlockHashCount; + type BlockHashCount = ConstU64<250>; type BlockLength = (); type BlockNumber = u64; type BlockWeights = (); @@ -161,14 +160,11 @@ impl frame_system::Config for TestRuntime { type Version = (); } -parameter_types! { - pub const ExistentialDeposit: u64 = 1; -} impl pallet_balances::Config for TestRuntime { type AccountStore = frame_system::Pallet; type Balance = Balance; type DustRemoval = (); - type ExistentialDeposit = ExistentialDeposit; + type ExistentialDeposit = ConstU64<1>; type MaxLocks = (); type MaxReserves = (); type ReserveIdentifier = (); diff --git a/modules/parachains/src/mock.rs b/modules/parachains/src/mock.rs index 18537b7b4..a34656e96 100644 --- a/modules/parachains/src/mock.rs +++ b/modules/parachains/src/mock.rs @@ -88,17 +88,16 @@ impl frame_system::Config for TestRuntime { } frame_support::parameter_types! { - pub const MaxRequests: u32 = 2; - pub const HeadersToKeep: u32 = 5; pub const SessionLength: u64 = 5; pub const NumValidators: u32 = 5; + pub const HeadersToKeep: u32 = 5; } impl pallet_bridge_grandpa::Config for TestRuntime { type BridgedChain = TestBridgedChain; type HeadersToKeep = HeadersToKeep; type MaxBridgedAuthorities = frame_support::traits::ConstU32<5>; type MaxBridgedHeaderSize = frame_support::traits::ConstU32<512>; - type MaxRequests = MaxRequests; + type MaxRequests = ConstU32<2>; type WeightInfo = (); } @@ -107,7 +106,7 @@ impl pallet_bridge_grandpa::Config for TestRun type HeadersToKeep = HeadersToKeep; type MaxBridgedAuthorities = frame_support::traits::ConstU32<5>; type MaxBridgedHeaderSize = frame_support::traits::ConstU32<512>; - type MaxRequests = MaxRequests; + type MaxRequests = ConstU32<2>; type WeightInfo = (); }