Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn load_spec(id: &str, is_testing: bool) -> std::result::Result<Box<dyn sc_servi
} else {
Ok(match id {
"" => Box::new(chain_spec::hydradx::parachain_config()?),
"local" => Box::new(chain_spec::local::parachain_config()?),
"local" | "dev" => Box::new(chain_spec::local::parachain_config()?),
"staging" => Box::new(chain_spec::staging::parachain_config()?),
"rococo" => Box::new(chain_spec::rococo::parachain_config()?),
path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
Expand Down Expand Up @@ -107,7 +107,7 @@ impl SubstrateCli for Cli {
} else {
Ok(match id {
"hydradx" => Box::new(chain_spec::hydradx::parachain_config()?),
"local" => Box::new(chain_spec::local::parachain_config()?),
"local" | "dev" => Box::new(chain_spec::local::parachain_config()?),
"staging" => Box::new(chain_spec::staging::parachain_config()?),
"rococo" => Box::new(chain_spec::rococo::parachain_config()?),
path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
Expand Down
2 changes: 2 additions & 0 deletions runtime/hydradx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub use common_runtime::*;
use pallet_currencies::BasicCurrencyAdapter;

mod benchmarking;
mod migrations;
mod xcm;

pub use hex_literal::hex;
Expand Down Expand Up @@ -950,6 +951,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsReversedWithSystemFirst,
migrations::OnRuntimeUpgradeMigration,
>;

impl_runtime_apis! {
Expand Down
25 changes: 25 additions & 0 deletions runtime/hydradx/src/migrations.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use super::*;

use frame_support::{traits::OnRuntimeUpgrade, weights::Weight};
pub struct OnRuntimeUpgradeMigration;
impl OnRuntimeUpgrade for OnRuntimeUpgradeMigration {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
Ok(())
}

fn on_runtime_upgrade() -> Weight {
let mut weight: Weight = Weight::zero();

frame_support::log::info!("Migrate Uniques Pallet start");
weight = weight.saturating_add(pallet_uniques::migration::migrate_to_v1::<Runtime, _, Uniques>());
frame_support::log::info!("Migrate Uniques Pallet end");

weight
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
Ok(())
}
}