Skip to content

Commit

Permalink
Migrate elections-phragmen
Browse files Browse the repository at this point in the history
  • Loading branch information
icodezjb committed Feb 7, 2022
1 parent d36bd18 commit 59b36b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
RemoveCollectiveFlip
(RemoveCollectiveFlip, PhragmenElectionDepositRuntimeUpgrade),
>;

impl_runtime_apis! {
Expand Down
19 changes: 19 additions & 0 deletions runtime/dev/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,22 @@ impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip {
<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}

// 10 PCX
const OLD_CANDIDACY_BOND: Balance = 1000 * DOLLARS;
// 10 mPCX
const OLD_VOTING_BOND: Balance = DOLLARS;
pub struct PhragmenElectionDepositRuntimeUpgrade;
impl pallet_elections_phragmen::migrations::v3::V2ToV3 for PhragmenElectionDepositRuntimeUpgrade {
type Pallet = Elections;
type AccountId = AccountId;
type Balance = Balance;
}
impl frame_support::traits::OnRuntimeUpgrade for PhragmenElectionDepositRuntimeUpgrade {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
pallet_elections_phragmen::migrations::v3::apply::<Self>(
OLD_VOTING_BOND,
OLD_CANDIDACY_BOND,
)
}
}

0 comments on commit 59b36b5

Please sign in to comment.