-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable async backing on moonriver (#2776)
Co-authored-by: Rodrigo Quelhas <[email protected]> Co-authored-by: Ahmad Kaouk <[email protected]>
- Loading branch information
1 parent
26a88a5
commit ae2c682
Showing
6 changed files
with
117 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2024 Moonbeam Foundation Inc. | ||
// This file is part of Moonbeam. | ||
|
||
// Moonbeam is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Moonbeam is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! # Moonriver specific Migrations | ||
|
||
use crate::Runtime; | ||
use frame_support::{traits::OnRuntimeUpgrade, weights::Weight}; | ||
use pallet_migrations::{GetMigrations, Migration}; | ||
use pallet_parachain_staking::migrations::MultiplyRoundLenBy2; | ||
use sp_std::{prelude::*, vec}; | ||
|
||
pub struct MoonriverMigrations; | ||
|
||
impl GetMigrations for MoonriverMigrations { | ||
fn get_migrations() -> Vec<Box<dyn Migration>> { | ||
vec![Box::new(PalletStakingMultiplyRoundLenBy2)] | ||
} | ||
} | ||
|
||
// This migration should only be applied to runtimes with async backing enabled | ||
pub struct PalletStakingMultiplyRoundLenBy2; | ||
impl Migration for PalletStakingMultiplyRoundLenBy2 { | ||
fn friendly_name(&self) -> &str { | ||
"MM_MultiplyRoundLenBy2" | ||
} | ||
|
||
fn migrate(&self, _available_weight: Weight) -> Weight { | ||
MultiplyRoundLenBy2::<Runtime>::on_runtime_upgrade() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters