From 48bb6c7ba4222236f483118cfea46e2252566975 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Thu, 20 Jun 2024 16:52:55 +0800 Subject: [PATCH] !! paritytech/polkadot-sdk#1363 --- runtime/crab/src/pallets/balances.rs | 2 +- runtime/crab/src/pallets/preimage.rs | 14 ++++++++++++-- runtime/darwinia/src/pallets/balances.rs | 2 +- runtime/darwinia/src/pallets/preimage.rs | 14 ++++++++++++-- runtime/koi/src/pallets/balances.rs | 2 +- runtime/koi/src/pallets/preimage.rs | 16 +++++++++++++--- 6 files changed, 40 insertions(+), 10 deletions(-) diff --git a/runtime/crab/src/pallets/balances.rs b/runtime/crab/src/pallets/balances.rs index b4e79658c..169981e2e 100644 --- a/runtime/crab/src/pallets/balances.rs +++ b/runtime/crab/src/pallets/balances.rs @@ -26,7 +26,7 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = pallet_config::ExistentialDeposit; type FreezeIdentifier = (); type MaxFreezes = (); - type MaxHolds = (); + type MaxHolds = ConstU32<1>; type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; diff --git a/runtime/crab/src/pallets/preimage.rs b/runtime/crab/src/pallets/preimage.rs index a8adc3778..b23165866 100644 --- a/runtime/crab/src/pallets/preimage.rs +++ b/runtime/crab/src/pallets/preimage.rs @@ -19,9 +19,19 @@ // darwinia use crate::*; +frame_support::parameter_types! { + pub const PreimageBaseDeposit: Balance = deposit(2, 64); + pub const PreimageByteDeposit: Balance = deposit(0, 1); + pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); +} + impl pallet_preimage::Config for Runtime { - type BaseDeposit = ConstU128<{ 500 * UNIT }>; - type ByteDeposit = ConstU128<{ darwinia_deposit(0, 1) }>; + type Consideration = HoldConsideration< + AccountId, + Balances, + PreimageHoldReason, + LinearStoragePrice, + >; type Currency = Balances; type ManagerOrigin = Root; type RuntimeEvent = RuntimeEvent; diff --git a/runtime/darwinia/src/pallets/balances.rs b/runtime/darwinia/src/pallets/balances.rs index b4e79658c..169981e2e 100644 --- a/runtime/darwinia/src/pallets/balances.rs +++ b/runtime/darwinia/src/pallets/balances.rs @@ -26,7 +26,7 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = pallet_config::ExistentialDeposit; type FreezeIdentifier = (); type MaxFreezes = (); - type MaxHolds = (); + type MaxHolds = ConstU32<1>; type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; diff --git a/runtime/darwinia/src/pallets/preimage.rs b/runtime/darwinia/src/pallets/preimage.rs index a8adc3778..b23165866 100644 --- a/runtime/darwinia/src/pallets/preimage.rs +++ b/runtime/darwinia/src/pallets/preimage.rs @@ -19,9 +19,19 @@ // darwinia use crate::*; +frame_support::parameter_types! { + pub const PreimageBaseDeposit: Balance = deposit(2, 64); + pub const PreimageByteDeposit: Balance = deposit(0, 1); + pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); +} + impl pallet_preimage::Config for Runtime { - type BaseDeposit = ConstU128<{ 500 * UNIT }>; - type ByteDeposit = ConstU128<{ darwinia_deposit(0, 1) }>; + type Consideration = HoldConsideration< + AccountId, + Balances, + PreimageHoldReason, + LinearStoragePrice, + >; type Currency = Balances; type ManagerOrigin = Root; type RuntimeEvent = RuntimeEvent; diff --git a/runtime/koi/src/pallets/balances.rs b/runtime/koi/src/pallets/balances.rs index b4e79658c..169981e2e 100644 --- a/runtime/koi/src/pallets/balances.rs +++ b/runtime/koi/src/pallets/balances.rs @@ -26,7 +26,7 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = pallet_config::ExistentialDeposit; type FreezeIdentifier = (); type MaxFreezes = (); - type MaxHolds = (); + type MaxHolds = ConstU32<1>; type MaxLocks = ConstU32<50>; type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; diff --git a/runtime/koi/src/pallets/preimage.rs b/runtime/koi/src/pallets/preimage.rs index b18c1a2d5..b23165866 100644 --- a/runtime/koi/src/pallets/preimage.rs +++ b/runtime/koi/src/pallets/preimage.rs @@ -19,11 +19,21 @@ // darwinia use crate::*; +frame_support::parameter_types! { + pub const PreimageBaseDeposit: Balance = deposit(2, 64); + pub const PreimageByteDeposit: Balance = deposit(0, 1); + pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); +} + impl pallet_preimage::Config for Runtime { - type BaseDeposit = ConstU128<{ 500 * UNIT }>; - type ByteDeposit = ConstU128<{ darwinia_deposit(0, 1) }>; + type Consideration = HoldConsideration< + AccountId, + Balances, + PreimageHoldReason, + LinearStoragePrice, + >; type Currency = Balances; - type ManagerOrigin = RootOr; + type ManagerOrigin = Root; type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_preimage::WeightInfo; }