migrate alliance, fast-unstake and bags list to use derive-impl (#1636)

Moving a few pallets to the latest and greatest `derive_impl` to give it
a try.

Part of #171

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Kian Paimani
2023-10-01 16:16:14 +02:00
committed by GitHub
parent e8baac7848
commit 2ed66a0960
12 changed files with 34 additions and 139 deletions
+12 -7
View File
@@ -216,7 +216,7 @@ pub mod pallet {
/// Default implementations of [`DefaultConfig`], which can be used to implement [`Config`].
pub mod config_preludes {
use super::*;
use frame_support::derive_impl;
use frame_support::{derive_impl, traits::ConstU64};
pub struct TestDefaultConfig;
@@ -227,12 +227,17 @@ pub mod pallet {
impl DefaultConfig for TestDefaultConfig {
#[inject_runtime_type]
type RuntimeEvent = ();
#[inject_runtime_type]
type RuntimeHoldReason = ();
type Balance = u64;
type ExistentialDeposit = ConstU64<1>;
type ReserveIdentifier = ();
type FreezeIdentifier = ();
type DustRemoval = ();
type MaxLocks = ();
type MaxReserves = ();
type MaxFreezes = ();
@@ -249,6 +254,10 @@ pub mod pallet {
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// The overarching hold reason.
#[pallet::no_default_bounds]
type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Ord + Copy;
/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;
@@ -266,7 +275,7 @@ pub mod pallet {
+ FixedPointOperand;
/// Handler for the unbalanced reduction when removing a dust account.
#[pallet::no_default]
#[pallet::no_default_bounds]
type DustRemoval: OnUnbalanced<CreditOf<Self, I>>;
/// The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!
@@ -278,7 +287,7 @@ pub mod pallet {
///
/// Bottom line: Do yourself a favour and make it at least one!
#[pallet::constant]
#[pallet::no_default]
#[pallet::no_default_bounds]
type ExistentialDeposit: Get<Self::Balance>;
/// The means of storing the balances of an account.
@@ -290,10 +299,6 @@ pub mod pallet {
/// Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`
type ReserveIdentifier: Parameter + Member + MaxEncodedLen + Ord + Copy;
/// The overarching hold reason.
#[pallet::no_default]
type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Ord + Copy;
/// The ID type for freezes.
type FreezeIdentifier: Parameter + Member + MaxEncodedLen + Ord + Copy;