mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 22:07:58 +00:00
Remove Kusama Nomination Pools Init (#5605)
* remove kusama nomination pools init * remove OnRuntimeUpgrade import * remove stale migrations from westend Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{
|
||||
ConstU32, Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier,
|
||||
OnRuntimeUpgrade, PrivilegeCmp,
|
||||
PrivilegeCmp,
|
||||
},
|
||||
weights::ConstantMultiplier,
|
||||
PalletId, RuntimeDebug,
|
||||
@@ -1457,32 +1457,6 @@ impl pallet_nomination_pools::Config for Runtime {
|
||||
type MinPointsToBalance = MinPointsToBalance;
|
||||
}
|
||||
|
||||
pub struct InitiatePoolConfigs;
|
||||
impl OnRuntimeUpgrade for InitiatePoolConfigs {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
// we use one as an indicator if this has already been set.
|
||||
if pallet_nomination_pools::MaxPools::<Runtime>::get().is_none() {
|
||||
// 1/600 KSM to join a pool.
|
||||
pallet_nomination_pools::MinJoinBond::<Runtime>::put(50 * CENTS);
|
||||
// 1 KSM to create a pool.
|
||||
pallet_nomination_pools::MinCreateBond::<Runtime>::put(UNITS);
|
||||
|
||||
// 128 initial pools: only for initial safety: can be set to infinity when needed.
|
||||
pallet_nomination_pools::MaxPools::<Runtime>::put(128);
|
||||
// 64k total pool members: only for initial safety: can be set to infinity when needed.
|
||||
pallet_nomination_pools::MaxPoolMembers::<Runtime>::put(64 * 1024);
|
||||
// 1024 members per pool: only for initial safety: can be set to infinity when needed.
|
||||
pallet_nomination_pools::MaxPoolMembersPerPool::<Runtime>::put(1024);
|
||||
|
||||
log::info!(target: "runtime::kusama", "pools config initiated 🎉");
|
||||
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(1, 5)
|
||||
} else {
|
||||
log::info!(target: "runtime::kusama", "pools config already initiated 😏");
|
||||
<Runtime as frame_system::Config>::DbWeight::get().reads(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
construct_runtime! {
|
||||
pub enum Runtime where
|
||||
Block = Block,
|
||||
@@ -1629,7 +1603,6 @@ pub type Executive = frame_executive::Executive<
|
||||
(
|
||||
RenameBagsListToVoterList,
|
||||
pallet_bags_list::migrations::AddScore<Runtime>,
|
||||
InitiatePoolConfigs,
|
||||
pallet_nomination_pools::migration::v1::MigrateToV1<Runtime>,
|
||||
),
|
||||
>;
|
||||
|
||||
@@ -1171,30 +1171,11 @@ pub type Executive = frame_executive::Executive<
|
||||
frame_system::ChainContext<Runtime>,
|
||||
Runtime,
|
||||
AllPalletsWithSystem,
|
||||
(
|
||||
RenameBagsListToVoterList,
|
||||
pallet_bags_list::migrations::AddScore<Runtime>,
|
||||
pallet_nomination_pools::migration::v1::MigrateToV1<Runtime>,
|
||||
),
|
||||
(),
|
||||
>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
/// A migration which renames the pallet `BagsList` to `VoterList`
|
||||
pub struct RenameBagsListToVoterList;
|
||||
impl frame_support::traits::OnRuntimeUpgrade for RenameBagsListToVoterList {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
// For other pre-upgrade checks, we need the storage to already be migrated.
|
||||
frame_support::storage::migration::move_pallet(b"BagsList", b"VoterList");
|
||||
Ok(())
|
||||
}
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
frame_support::storage::migration::move_pallet(b"BagsList", b"VoterList");
|
||||
frame_support::weights::Weight::MAX
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
#[macro_use]
|
||||
extern crate frame_benchmarking;
|
||||
|
||||
Reference in New Issue
Block a user