Skip to content

Commit dc851dc

Browse files
committed
Update pallet-preimage config
Changes introduced in paritytech/polkadot-sdk#1363
1 parent c9fdfd7 commit dc851dc

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

runtime/src/lib.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ use frame_support::{
4949
parameter_types,
5050
sp_runtime::RuntimeDebug,
5151
traits::{
52-
ConstU16, ConstU32, Contains, Currency, EitherOfDiverse, EqualPrivilegeOnly, Imbalance,
53-
InstanceFilter, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, WithdrawReasons,
52+
fungible::HoldConsideration, ConstU16, ConstU32, Contains, Currency, EitherOfDiverse,
53+
EqualPrivilegeOnly, Imbalance, InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice,
54+
LockIdentifier, OnUnbalanced, WithdrawReasons,
5455
},
5556
weights::{
5657
constants::{
@@ -1062,15 +1063,19 @@ impl pallet_scheduler::Config for Runtime {
10621063
}
10631064

10641065
parameter_types! {
1065-
pub const PreimageMaxSize: u32 = 4096 * 1024;
1066-
pub const PreimageBaseDeposit: Balance = DOLLARS;
1067-
// One cent: $10,000 / MB
1068-
pub const PreimageByteDeposit: Balance = CENTS;
1066+
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
1067+
pub const PreimageByteDeposit: Balance = deposit(0, 1);
1068+
pub const PreimageHoldReason: RuntimeHoldReason =
1069+
RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
10691070
}
10701071

10711072
impl pallet_preimage::Config for Runtime {
1072-
type BaseDeposit = PreimageBaseDeposit;
1073-
type ByteDeposit = PreimageByteDeposit;
1073+
type Consideration = HoldConsideration<
1074+
AccountId,
1075+
Balances,
1076+
PreimageHoldReason,
1077+
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
1078+
>;
10741079
type Currency = Balances;
10751080
type ManagerOrigin = EnsureRoot<AccountId>;
10761081
type RuntimeEvent = RuntimeEvent;

0 commit comments

Comments
 (0)