mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 22:55:43 +00:00
FRAME: Revamp Preimage pallet to use Consideration (#1363)
Make Preimage pallet use Consideration instead of handling deposits directly. Other half of paritytech/substrate#13666. Depends/based on #1361. Script for the lazy migration that should be run manually once: [migrate-preimage-lazy.py](https://github.com/ggwpez/substrate-scripts/blob/master/migrate-preimage-lazy.py). ## TODO - [x] Migration code. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: command-bot <> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -60,8 +60,9 @@ use beefy_primitives::{
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{
|
||||
Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
|
||||
PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons,
|
||||
fungible::HoldConsideration, Contains, EitherOfDiverse, InstanceFilter,
|
||||
KeyOwnerProofSystem, LinearStoragePrice, LockIdentifier, PrivilegeCmp, ProcessMessage,
|
||||
ProcessMessageError, StorageMapShim, WithdrawReasons,
|
||||
},
|
||||
weights::{ConstantMultiplier, WeightMeter},
|
||||
PalletId,
|
||||
@@ -224,6 +225,7 @@ impl pallet_scheduler::Config for Runtime {
|
||||
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 {
|
||||
@@ -231,8 +233,12 @@ impl pallet_preimage::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type ManagerOrigin = EnsureRoot<AccountId>;
|
||||
type BaseDeposit = PreimageBaseDeposit;
|
||||
type ByteDeposit = PreimageByteDeposit;
|
||||
type Consideration = HoldConsideration<
|
||||
AccountId,
|
||||
Balances,
|
||||
PreimageHoldReason,
|
||||
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
|
||||
>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -1449,7 +1455,7 @@ construct_runtime! {
|
||||
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 31,
|
||||
|
||||
// Preimage registrar.
|
||||
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 32,
|
||||
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 32,
|
||||
|
||||
// Bounties modules.
|
||||
Bounties: pallet_bounties::{Pallet, Call, Storage, Event<T>} = 35,
|
||||
|
||||
Reference in New Issue
Block a user