diff --git a/runtime/calamari/src/migrations/asset_manager.rs b/runtime/calamari/src/migrations/asset_manager.rs index 6df50b771..06ca1e845 100644 --- a/runtime/calamari/src/migrations/asset_manager.rs +++ b/runtime/calamari/src/migrations/asset_manager.rs @@ -382,6 +382,18 @@ impl OnRuntimeUpgrade fo })) = v1_location { match interior { + // kusama location + v1::Junctions::Here => { + let v3_junctions = Junctions::Here; + let v3_location = + VersionedMultiLocation::V3(MultiLocation::new(parents, v3_junctions)); + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&asset_id.encode()), + v3_location, + ); + } // we have two X1::Junction::Parachain: 2004 and 2084 // { Parachain }: 2 v1::Junctions::X1(v1::Junction::Parachain(para_id)) => { @@ -402,7 +414,7 @@ impl OnRuntimeUpgrade fo ) => { let v3_general_key = { let mut data = [0u8; 32]; - data.copy_from_slice(&general_key[..]); + data[..general_key.len()].copy_from_slice(&general_key[..]); Junction::GeneralKey { length: general_key.len() as u8, data, @@ -484,6 +496,18 @@ impl OnRuntimeUpgrade fo })) = v1_location { match interior { + // kusama location + v1::Junctions::Here => { + let v3_junctions = Junctions::Here; + let v3_location = + VersionedMultiLocation::V3(MultiLocation::new(parents, v3_junctions)); + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&v3_location.encode()), + asset_id, + ); + } // we have two X1::Junction::Parachain: 2004 and 2084 // { Parachain }: 2 v1::Junctions::X1(v1::Junction::Parachain(para_id)) => { @@ -504,7 +528,7 @@ impl OnRuntimeUpgrade fo ) => { let v3_general_key = { let mut data = [0u8; 32]; - data.copy_from_slice(&general_key[..]); + data[..general_key.len()].copy_from_slice(&general_key[..]); Junction::GeneralKey { length: general_key.len() as u8, data, @@ -586,6 +610,18 @@ impl OnRuntimeUpgrade fo })) = v1_location { match interior { + // kusama location + v1::Junctions::Here => { + let v3_junctions = Junctions::Here; + let v3_location = + VersionedMultiLocation::V3(MultiLocation::new(parents, v3_junctions)); + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&v3_location.encode()), + fees, + ); + } // we have two X1::Junction::Parachain: 2004 and 2084 // { Parachain }: 2 v1::Junctions::X1(v1::Junction::Parachain(para_id)) => { @@ -606,7 +642,7 @@ impl OnRuntimeUpgrade fo ) => { let v3_general_key = { let mut data = [0u8; 32]; - data.copy_from_slice(&general_key[..]); + data[..general_key.len()].copy_from_slice(&general_key[..]); Junction::GeneralKey { length: general_key.len() as u8, data, diff --git a/runtime/manta/src/migrations/asset_manager.rs b/runtime/manta/src/migrations/asset_manager.rs index b2393ad41..ec8cb862b 100644 --- a/runtime/manta/src/migrations/asset_manager.rs +++ b/runtime/manta/src/migrations/asset_manager.rs @@ -382,6 +382,18 @@ impl OnRuntimeUpgrade fo })) = v1_location { match interior { + // polkadot location + v1::Junctions::Here => { + let v3_junctions = Junctions::Here; + let v3_location = + VersionedMultiLocation::V3(MultiLocation::new(parents, v3_junctions)); + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&asset_id.encode()), + v3_location, + ); + } // we have two X1::Junction::Parachain: 2004 and 2084 // { Parachain }: 2 v1::Junctions::X1(v1::Junction::Parachain(para_id)) => { @@ -402,7 +414,7 @@ impl OnRuntimeUpgrade fo ) => { let v3_general_key = { let mut data = [0u8; 32]; - data.copy_from_slice(&general_key[..]); + data[..general_key.len()].copy_from_slice(&general_key[..]); Junction::GeneralKey { length: general_key.len() as u8, data, @@ -505,6 +517,18 @@ impl OnRuntimeUpgrade fo })) = v1_location { match interior { + // polkadot location + v1::Junctions::Here => { + let v3_junctions = Junctions::Here; + let v3_location = + VersionedMultiLocation::V3(MultiLocation::new(parents, v3_junctions)); + put_storage_value( + pallet_prefix, + storage_item_prefix, + &Blake2_128Concat::hash(&v3_location.encode()), + asset_id, + ); + } // we have 1 X1::Junction::Parachain: 2104 // { Parachain }: 1 v1::Junctions::X1(v1::Junction::Parachain(para_id)) => { @@ -525,7 +549,7 @@ impl OnRuntimeUpgrade fo ) => { let v3_general_key = { let mut data = [0u8; 32]; - data.copy_from_slice(&general_key[..]); + data[..general_key.len()].copy_from_slice(&general_key[..]); Junction::GeneralKey { length: general_key.len() as u8, data,