Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Merge 6d38c8f into ebecfca
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Lau authored Aug 18, 2021
2 parents ebecfca + 6d38c8f commit 8add3f1
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions bin/node/runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,28 +899,33 @@ impl dvm_rpc_runtime_api::ConvertTransaction<OpaqueExtrinsic> for TransactionCon
}
}

fn migrate_treasury() {
// --- paritytech ---
use frame_support::migration;

const MODULE: &[u8] = b"DarwiniaTreasury";

migration::remove_storage_prefix(MODULE, b"BountyCount", &[]);
log::info!("`BountyCount` Removed");
migration::remove_storage_prefix(MODULE, b"Bounties", &[]);
log::info!("`Bounties` Removed");
migration::remove_storage_prefix(MODULE, b"BountyDescriptions", &[]);
log::info!("`BountyDescriptions` Removed");
migration::remove_storage_prefix(MODULE, b"BountyApprovals", &[]);
log::info!("`BountyApprovals` Removed");
}

pub struct CustomOnRuntimeUpgrade;
impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
// <--- Hack for local test
use frame_support::traits::Currency;
let _ = Ring::deposit_creating(&BridgeMillauMessages::relayer_fund_account_id(), 1 << 50);
// --->
migrate_treasury();

Ok(())
}

fn on_runtime_upgrade() -> Weight {
// <--- Hack for local test
// use frame_support::traits::Currency;
// let _ = Ring::deposit_creating(&BridgeMillauMessages::relayer_fund_account_id(), 1 << 50);
// --->

// --- paritytech ---
use frame_support::migration;

migration::move_pallet(b"DarwiniaEthereumBacking", b"EthereumBacking");
migrate_treasury();

RuntimeBlockWeights::get().max_block
}
Expand Down

0 comments on commit 8add3f1

Please sign in to comment.