--- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -202,7 +202,6 @@ accounts: BTreeMap::new(), }, ethereum: EthereumConfig {}, - foreign_assets: Default::default(), polkadot_xcm: Default::default(), transaction_payment: Default::default(), } @@ -255,7 +254,6 @@ accounts: BTreeMap::new(), }, ethereum: EthereumConfig {}, - foreign_assets: Default::default(), polkadot_xcm: Default::default(), transaction_payment: Default::default(), } --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -276,62 +276,7 @@ StorageMap<_, Twox64Concat, ForeignAssetId, CollectionId, OptionQuery>; #[pallet::pallet] - #[pallet::without_storage_info] pub struct Pallet(_); - - pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_runtime_upgrade() -> Weight { - let mut weight = Weight::default(); - // 0-1 -- xcmv2 => xcmv3 - if StorageVersion::get::>() <= 0 { - pub trait V0ToV1 { - type Pallet: 'static + PalletInfoAccess; - } - #[frame_support::storage_alias] - type LocationToCurrencyIds = - StorageMap, Twox64Concat, xcm::v2::MultiLocation, ForeignAssetId>; - >::translate_values::(|loc| { - weight += T::DbWeight::get().reads_writes(1, 1); - Some( - xcm::v3::MultiLocation::try_from(loc) - .expect("failed to migrate multilocation from XCMv2 to XCMv3"), - ) - }); - - let old_values: Vec<(xcm::v2::MultiLocation, _)> = - >::drain().collect(); - weight += T::DbWeight::get() - .reads_writes(old_values.len() as u64, old_values.len() as u64); - for (loc, asset_id) in old_values { - let loc = xcm::v3::MultiLocation::try_from(loc) - .expect("failed to migrate multilocation from XCMv2 to XCMv3"); - >::insert(loc, asset_id); - } - } - STORAGE_VERSION.put::>(); - weight += T::DbWeight::get().writes(1); - weight - } - } - - #[pallet::genesis_config] - pub struct GenesisConfig; - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self - } - } - - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { - fn build(&self) { - STORAGE_VERSION.put::>(); - } - } #[pallet::call] impl Pallet {