Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshvarma committed Feb 29, 2024
1 parent f3240f0 commit f40c1f8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("astar"),
impl_name: create_runtime_str!("astar"),
authoring_version: 1,
spec_version: 81,
spec_version: 80,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shibuya"),
impl_name: create_runtime_str!("shibuya"),
authoring_version: 1,
spec_version: 123,
spec_version: 122,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
29 changes: 27 additions & 2 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shiden"),
impl_name: create_runtime_str!("shiden"),
authoring_version: 1,
spec_version: 120,
spec_version: 119,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down Expand Up @@ -1111,7 +1111,32 @@ parameter_types! {
/// All migrations that will run on the next runtime upgrade.
///
/// Once done, migrations should be removed from the tuple.
pub type Migrations = (pallet_contracts::Migration<Runtime>,);
pub type Migrations = (
// Part of shiden-119
frame_support::migrations::RemovePallet<
DappStakingMigrationName,
<Runtime as frame_system::Config>::DbWeight,
>,
// Part of shiden-119
RecalculationEraFix,
);

use frame_support::traits::OnRuntimeUpgrade;
pub struct RecalculationEraFix;
impl OnRuntimeUpgrade for RecalculationEraFix {
fn on_runtime_upgrade() -> Weight {
let first_dapp_staking_v3_era = 743;

let expected_recalculation_era =
InflationCycleConfig::eras_per_cycle().saturating_add(first_dapp_staking_v3_era);

pallet_inflation::ActiveInflationConfig::<Runtime>::mutate(|config| {
config.recalculation_era = expected_recalculation_era;
});

<Runtime as frame_system::Config>::DbWeight::get().reads_writes(1, 1)
}
}

type EventRecord = frame_system::EventRecord<
<Runtime as frame_system::Config>::RuntimeEvent,
Expand Down

0 comments on commit f40c1f8

Please sign in to comment.