Skip to content

Commit b8f7a8d

Browse files
committed
[requires migration. onchain or offchain?]
1 parent a012d32 commit b8f7a8d

File tree

6 files changed

+47
-15
lines changed

6 files changed

+47
-15
lines changed

relay/kusama/src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ use frame_election_provider_support::{
6363
use frame_support::{
6464
construct_runtime, parameter_types,
6565
traits::{
66-
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
67-
PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons,
66+
fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter,
67+
KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, ProcessMessageError,
68+
StorageMapShim, WithdrawReasons,
6869
},
6970
weights::{ConstantMultiplier, WeightMeter},
7071
PalletId,
@@ -241,15 +242,20 @@ impl pallet_scheduler::Config for Runtime {
241242
parameter_types! {
242243
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
243244
pub const PreimageByteDeposit: Balance = deposit(0, 1);
245+
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
244246
}
245247

246248
impl pallet_preimage::Config for Runtime {
247249
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
248250
type RuntimeEvent = RuntimeEvent;
249251
type Currency = Balances;
250252
type ManagerOrigin = EnsureRoot<AccountId>;
251-
type BaseDeposit = PreimageBaseDeposit;
252-
type ByteDeposit = PreimageByteDeposit;
253+
type Consideration = HoldConsideration<
254+
AccountId,
255+
Balances,
256+
PreimageHoldReason,
257+
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
258+
>;
253259
}
254260

255261
parameter_types! {
@@ -1563,7 +1569,7 @@ construct_runtime! {
15631569
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 31,
15641570

15651571
// Preimage registrar.
1566-
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 32,
1572+
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 32,
15671573

15681574
// Bounties modules.
15691575
Bounties: pallet_bounties::{Pallet, Call, Storage, Event<T>} = 35,

relay/kusama/src/weights/pallet_preimage.rs

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

relay/polkadot/src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ use frame_election_provider_support::{
4747
use frame_support::{
4848
construct_runtime, parameter_types,
4949
traits::{
50-
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
51-
PrivilegeCmp, ProcessMessage, ProcessMessageError, WithdrawReasons,
50+
fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter,
51+
KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, ProcessMessageError,
52+
WithdrawReasons,
5253
},
5354
weights::{ConstantMultiplier, WeightMeter},
5455
PalletId,
@@ -228,15 +229,20 @@ parameter_types! {
228229
pub const PreimageMaxSize: u32 = 4096 * 1024;
229230
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
230231
pub const PreimageByteDeposit: Balance = deposit(0, 1);
232+
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
231233
}
232234

233235
impl pallet_preimage::Config for Runtime {
234236
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
235237
type RuntimeEvent = RuntimeEvent;
236238
type Currency = Balances;
237239
type ManagerOrigin = EnsureRoot<AccountId>;
238-
type BaseDeposit = PreimageBaseDeposit;
239-
type ByteDeposit = PreimageByteDeposit;
240+
type Consideration = HoldConsideration<
241+
AccountId,
242+
Balances,
243+
PreimageHoldReason,
244+
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
245+
>;
240246
}
241247

242248
parameter_types! {
@@ -1379,7 +1385,7 @@ construct_runtime! {
13791385
// Basic stuff; balances is uncallable initially.
13801386
System: frame_system::{Pallet, Call, Storage, Config<T>, Event<T>} = 0,
13811387
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 1,
1382-
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 10,
1388+
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 10,
13831389

13841390
// Babe must be before session.
13851391
Babe: pallet_babe::{Pallet, Call, Storage, Config<T>, ValidateUnsigned} = 2,

relay/polkadot/src/weights/pallet_preimage.rs

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system-parachains/collectives/collectives-polkadot/src/lib.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ use frame_support::{
6464
construct_runtime,
6565
dispatch::DispatchClass,
6666
parameter_types,
67-
traits::{ConstBool, ConstU16, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter},
67+
traits::{
68+
fungible::HoldConsideration, ConstBool, ConstU16, ConstU32, ConstU64, ConstU8,
69+
EitherOfDiverse, InstanceFilter, LinearStoragePrice,
70+
},
6871
weights::{ConstantMultiplier, Weight},
6972
PalletId,
7073
};
@@ -207,7 +210,7 @@ impl pallet_balances::Config for Runtime {
207210
type RuntimeHoldReason = RuntimeHoldReason;
208211
type RuntimeFreezeReason = RuntimeFreezeReason;
209212
type FreezeIdentifier = ();
210-
type MaxHolds = ConstU32<0>;
213+
type MaxHolds = ConstU32<1>;
211214
type MaxFreezes = ConstU32<0>;
212215
}
213216

@@ -543,15 +546,20 @@ impl pallet_scheduler::Config for Runtime {
543546
parameter_types! {
544547
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
545548
pub const PreimageByteDeposit: Balance = deposit(0, 1);
549+
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
546550
}
547551

548552
impl pallet_preimage::Config for Runtime {
549553
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
550554
type RuntimeEvent = RuntimeEvent;
551555
type Currency = Balances;
552556
type ManagerOrigin = EnsureRoot<AccountId>;
553-
type BaseDeposit = PreimageBaseDeposit;
554-
type ByteDeposit = PreimageByteDeposit;
557+
type Consideration = HoldConsideration<
558+
AccountId,
559+
Balances,
560+
PreimageHoldReason,
561+
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
562+
>;
555563
}
556564

557565
// Create the runtime by composing the FRAME pallets that were previously configured.
@@ -587,7 +595,7 @@ construct_runtime!(
587595
Utility: pallet_utility::{Pallet, Call, Event} = 40,
588596
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 41,
589597
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>} = 42,
590-
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 43,
598+
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 43,
591599
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 44,
592600

593601
// The main stage.

system-parachains/collectives/collectives-polkadot/src/weights/pallet_preimage.rs

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)