Skip to content
Snippets Groups Projects
Commit d4987172 authored by Éloïs's avatar Éloïs
Browse files

migration v400

parent 9fc65cc2
No related branches found
No related tags found
1 merge request!102Smith members can't revoke idty nor change its address
This commit is part of merge request !102. Comments created here will be created in the context of that merge request.
......@@ -28,6 +28,8 @@ extern crate frame_benchmarking;
pub mod parameters;
mod migrations_v400;
pub use self::parameters::*;
pub use common_runtime::{
constants::*, entities::*, handlers::*, AccountId, Address, Balance, BlockNumber,
......@@ -127,6 +129,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations_v400::MigrationsV400,
>;
pub type TechnicalCommitteeInstance = Instance2;
......
// Copyright 2021-2022 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use crate::*;
pub struct MigrationsV400;
impl frame_support::traits::OnRuntimeUpgrade for MigrationsV400 {
fn on_runtime_upgrade() -> Weight {
let mut weight = 1_000_000_000; // Safety margin
type OldvalueType = AccountId;
pallet_membership::PendingMembership::<Runtime, Instance1>::translate_values(
|_: OldvalueType| {
weight += <Runtime as frame_system::Config>::DbWeight::get().write;
Some(())
},
);
weight
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
Ok(())
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
Ok(())
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment