Skip to content

Commit

Permalink
Proper fix, really
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Feb 2, 2024
1 parent 6a5b177 commit a47794c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pallets/inflation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,9 @@ pub trait PayoutPerBlock<Imbalance> {
/// `OnRuntimeUpgrade` logic for integrating this pallet into the live network.
#[cfg(feature = "try-runtime")]
use sp_std::vec::Vec;
pub struct PalletInflationInitConfig<T, P, W>(PhantomData<(T, P, W)>);
pub struct PalletInflationInitConfig<T, P>(PhantomData<(T, P, Weight)>);
impl<T: Config, P: Get<(InflationParameters, EraNumber, Weight)>> OnRuntimeUpgrade
for PalletInflationInitConfig<T, P, W>
for PalletInflationInitConfig<T, P>
{
fn on_runtime_upgrade() -> Weight {
if Pallet::<T>::on_chain_storage_version() >= STORAGE_VERSION {
Expand Down
7 changes: 4 additions & 3 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,7 @@ pub type Migrations = (
pallet_static_price_provider::InitActivePrice<Runtime, InitActivePriceGet>,
);

use sp_arithmetic::fixed_point::FixedU64;
pub struct InitActivePriceGet;
impl Get<FixedU64> for InitActivePriceGet {
fn get() -> FixedU64 {
Expand All @@ -1143,8 +1144,8 @@ impl Get<FixedU64> for InitActivePriceGet {

/// Used to initialize inflation parameters for the runtime.
pub struct InitInflationParamsHelper;
impl Get<(pallet_inflation::InflationParameters, EraNumber)> for InitInflationParamsHelper {
fn get() -> (pallet_inflation::InflationParameters, EraNumber) {
impl Get<(pallet_inflation::InflationParameters, EraNumber, Weight)> for InitInflationParamsHelper {
fn get() -> (pallet_inflation::InflationParameters, EraNumber, Weight) {
(
pallet_inflation::InflationParameters {
// Recalculation is done every two weeks, hence the small %.
Expand All @@ -1158,7 +1159,7 @@ impl Get<(pallet_inflation::InflationParameters, EraNumber)> for InitInflationPa
ideal_staking_rate: Perquintill::from_percent(50),
},
pallet_dapps_staking::CurrentEra::<Runtime>::get().saturating_add(1),
T::DbWeight::get().reads(1),
<Runtime as frame_system::Config>::DbWeight::get().reads(1),
)
}
}
Expand Down

0 comments on commit a47794c

Please sign in to comment.