Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set initial era payout damping factor to 100% with runtime migration #14

Open
wants to merge 1 commit into
base: luxor/reward-curve-proposal
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions runtime-modules/council/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1928,3 +1928,11 @@ impl<T: Config> frame_support::traits::Hooks<T::BlockNumber> for Pallet<T> {
Ok(())
}
}

pub mod migrations {
use super::*;

pub fn set_era_payout_damping_factor_to_one_hundred_percent<T: Config>() {
Mutations::<T>::set_era_payout_damping_factor(Percent::from_percent(100));
}
}
9 changes: 9 additions & 0 deletions runtime/src/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ impl Get<&'static str> for StakingMigrationV11OldPallet {
}
}

pub struct SetEraPayoutDampingFactorTo100Percent;
impl OnRuntimeUpgrade for SetEraPayoutDampingFactorTo100Percent {
fn on_runtime_upgrade() -> Weight {
council::migrations::set_era_payout_damping_factor_to_one_hundred_percent::<Runtime>();
Weight::from_parts(10_000_000, 0)
}
}

/// Migrations to run on runtime upgrade.
/// Migrations will run before pallet on_runtime_upgrade hooks
/// Always include 'CancelActiveAndPendingProposals' as first migration
Expand All @@ -112,6 +120,7 @@ pub type Migrations = (
pallet_election_provider_multi_phase::migrations::v1::MigrateToV1<Runtime>,
pallet_grandpa::migrations::CleanupSetIdSessionMap<Runtime>,
content::migrations::nara::MigrateToV1<Runtime>,
SetEraPayoutDampingFactorTo100Percent,
);

/// Executive: handles dispatch to the various modules with Migrations.
Expand Down
Loading