Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Centrifuge 1020 & Algol 1031 migrations #1534

Merged
merged 3 commits into from
Sep 8, 2023
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
2 changes: 1 addition & 1 deletion runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeAltair1031,
migrations::UpgradeAltair1032,
>;

impl fp_self_contained::SelfContainedCall for RuntimeCall {
Expand Down
294 changes: 3 additions & 291 deletions runtime/altair/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use frame_support::{traits::OnRuntimeUpgrade, weights::Weight};
/// that have to be applied on that chain, which includes migrations that have
/// already been executed on Algol (1028 & 1029).
#[cfg(not(feature = "testnet-runtime"))]
pub type UpgradeAltair1031 = (
pub type UpgradeAltair1032 = (
// FIXME: This migration fails to decode 4 entries against Altair
// orml_tokens_migration::CurrencyIdRefactorMigration,
// At minimum, bumps storage version from 1 to 2
Expand Down Expand Up @@ -54,27 +54,10 @@ pub type UpgradeAltair1031 = (
);

/// The Upgrade set for Algol - it excludes the migrations already executed in
/// the side releases that only landed on Algol (1028 & 1029) but not yet on
/// the side releases that only landed on Algol (1028 to 1031) but not yet on
/// Altair.
#[cfg(feature = "testnet-runtime")]
pub type UpgradeAltair1031 = (
// At minimum, bumps storage version from 0 to 1
runtime_common::migrations::nuke::Migration<crate::PoolSystem, crate::RocksDbWeight, 0>,
// At minimum, bump storage version from 0 to 1
runtime_common::migrations::nuke::Migration<crate::Investments, crate::RocksDbWeight, 0>,
runtime_common::migrations::asset_registry_xcmv3::Migration<
crate::Runtime,
asset_registry::AltairAssets,
5,
5,
2,
9,
>,
// Low weight, bumps uninitialized storage version from v0 to v1
pallet_xcm::migration::v1::MigrateToV1<crate::Runtime>,
// Sets currently unset safe XCM version to v2
xcm_v2_to_v3::SetSafeXcmVersion,
);
pub type UpgradeAltair1032 = ();

mod asset_registry {
use cfg_primitives::Balance;
Expand All @@ -87,8 +70,6 @@ mod asset_registry {

pub const ALTAIR_ASSET_LOC_COUNT: u32 = 5;
pub const ALTAIR_ASSET_METADATA_COUNT: u32 = 5;
pub const ALGOL_ASSET_LOC_COUNT: u32 = 2;
pub const ALGOL_ASSET_METADATA_COUNT: u32 = 9;

pub struct AltairAssets;
impl runtime_common::migrations::asset_registry_xcmv3::AssetsToMigrate for AltairAssets {
Expand All @@ -105,11 +86,6 @@ mod asset_registry {
{
Self::get_altair_assets()
}
(loc, meta)
if (loc, meta) == (ALGOL_ASSET_LOC_COUNT, ALGOL_ASSET_METADATA_COUNT) =>
{
Self::get_algol_assets()
}
_ => vec![],
}
}
Expand Down Expand Up @@ -228,270 +204,6 @@ mod asset_registry {
),
]
}

pub fn get_algol_assets() -> Vec<(
CurrencyId,
orml_asset_registry::AssetMetadata<Balance, CustomMetadata>,
)> {
// 02f3a00dd12f644daec907013b16eb6d14bf1c4cb4
let gk_bytes: &[u8] = &[
2u8, 243u8, 160u8, 13u8, 209u8, 47u8, 100u8, 77u8, 174u8, 201u8, 7u8, 1u8, 59u8,
22u8, 235u8, 109u8, 20u8, 191u8, 28u8, 76u8, 180u8,
];
let mut gk = [0u8; 32];
gk[..gk_bytes.len()].copy_from_slice(gk_bytes);

// 0x3a39cb9fb7c1b5e5b0071d8a9396fdeb
let polka_jr_bytes = &[
58u8, 57u8, 203u8, 159u8, 183u8, 193u8, 181u8, 229u8, 176u8, 7u8, 29u8, 138u8,
147u8, 150u8, 253u8, 235u8,
];
let mut polka_jr = [0u8; 16];
polka_jr[..polka_jr_bytes.len()].copy_from_slice(polka_jr_bytes);

// 0xe0af7eeed9aa5e17667d617dbecd5975
let polka_mezz_1_bytes = &[
224u8, 175u8, 126u8, 238u8, 217u8, 170u8, 94u8, 23u8, 102u8, 125u8, 97u8, 125u8,
190u8, 205u8, 89u8, 117u8,
];
let mut polka_mezz_1 = [0u8; 16];
polka_mezz_1[..polka_mezz_1_bytes.len()].copy_from_slice(polka_mezz_1_bytes);

// 0xa52f72fd60c3f0a11b8c99fc35f54d9f
let polka_mezz_2_bytes = &[
165u8, 47u8, 114u8, 253u8, 96u8, 195u8, 240u8, 161u8, 27u8, 140u8, 153u8, 252u8,
53u8, 245u8, 77u8, 159u8,
];
let mut polka_mezz_2 = [0u8; 16];
polka_mezz_2[..polka_mezz_2_bytes.len()].copy_from_slice(polka_mezz_2_bytes);

// 0xa7e7bdcb04b43e1ab323c9690f2bc24e
let polka_mezz_3_bytes = &[
167u8, 231u8, 189u8, 203u8, 4u8, 180u8, 62u8, 26u8, 179u8, 35u8, 201u8, 105u8,
15u8, 43u8, 194u8, 78u8,
];
let mut polka_mezz_3 = [0u8; 16];
polka_mezz_3[..polka_mezz_3_bytes.len()].copy_from_slice(polka_mezz_3_bytes);

// 0x2793bae22e2db2423b056e8ec7f1cded
let polka_senior_bytes = &[
39u8, 147u8, 186u8, 226u8, 46u8, 45u8, 178u8, 66u8, 59u8, 5u8, 110u8, 142u8, 199u8,
241u8, 205u8, 237u8,
];
let mut polka_senior = [0u8; 16];
polka_senior[..polka_senior_bytes.len()].copy_from_slice(polka_senior_bytes);

// 0x5b218a7ea17e848b640087adcdd7dfb2
let just_jr_bytes = &[
91u8, 33u8, 138u8, 126u8, 161u8, 126u8, 132u8, 139u8, 100u8, 0u8, 135u8, 173u8,
205u8, 215u8, 223u8, 178u8,
];
let mut just_jr = [0u8; 16];
just_jr[..just_jr_bytes.len()].copy_from_slice(just_jr_bytes);

// 0x7acea1c8880afe5e32b41b77747ad8aa
let just_sr_bytes = &[
122u8, 206u8, 161u8, 200u8, 136u8, 10u8, 254u8, 94u8, 50u8, 180u8, 27u8, 119u8,
116u8, 122u8, 216u8, 170u8,
];
let mut just_sr = [0u8; 16];
just_sr[..just_sr_bytes.len()].copy_from_slice(just_sr_bytes);

// 0x07865c6e87b9f70255377e024ace6630c1eaa37f
let lp_eth_acc: [u8; 20] = [
7u8, 134u8, 92u8, 110u8, 135u8, 185u8, 247u8, 2u8, 85u8, 55u8, 126u8, 2u8, 74u8,
206u8, 102u8, 48u8, 193u8, 234u8, 163u8, 127u8,
];

vec![
(
CurrencyId::Native,
orml_asset_registry::AssetMetadata {
decimals: 18,
name: b"Algol".to_vec(),
symbol: b"ALGL".to_vec(),
existential_deposit: 1_000_000_000_000u128,
location: Some(VersionedMultiLocation::V3(MultiLocation::new(
1,
Junctions::X2(
Parachain(crate::ParachainInfo::parachain_id().into()),
GeneralKey {
length: 2,
data: gk,
},
),
))),
additional: CustomMetadata {
mintable: false,
permissioned: false,
pool_currency: false,
transferability: CrossChainTransferability::Xcm(XcmMetadata {
fee_per_second: None,
}),
},
},
),
(
CurrencyId::Tranche(3151673055, polka_jr),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Polka Pool Junior".to_vec(),
symbol: b"PP1J".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3151673055, polka_mezz_1),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Polka Pool Mezz 1".to_vec(),
symbol: b"PP1M1".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3151673055, polka_mezz_2),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Polka Pool Mezz 2".to_vec(),
symbol: b"PP1M2".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3151673055, polka_mezz_3),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Polka Pool Mezz 3".to_vec(),
symbol: b"PP1M3".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3151673055, polka_senior),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Polka Pool Senior".to_vec(),
symbol: b"PP1S".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3581766799, just_jr),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Just Logistics Series 3 Junior".to_vec(),
symbol: b"JL3JR".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::Tranche(3581766799, just_sr),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Just Logistics Series 3 Senior".to_vec(),
symbol: b"JL3SR".to_vec(),
existential_deposit: 0u128,
location: None,
additional: CustomMetadata {
mintable: false,
permissioned: true,
pool_currency: false,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
(
CurrencyId::ForeignAsset(1),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"Tether USD".to_vec(),
symbol: b"USDT".to_vec(),
existential_deposit: 0u128,
location: Some(VersionedMultiLocation::V3(MultiLocation::new(
1,
Junctions::X3(Parachain(1000), PalletInstance(50), GeneralIndex(1984)),
))),
additional: CustomMetadata {
mintable: false,
permissioned: false,
pool_currency: true,
transferability: CrossChainTransferability::Xcm(XcmMetadata {
fee_per_second: None,
}),
},
},
),
(
CurrencyId::ForeignAsset(100001),
orml_asset_registry::AssetMetadata {
decimals: 6,
name: b"LP Ethereum Wrapped USDC".to_vec(),
symbol: b"LpEthUSDC".to_vec(),
existential_deposit: 1_000u128,
location: Some(VersionedMultiLocation::V3(MultiLocation::new(
0,
Junctions::X3(
PalletInstance(108),
GlobalConsensus(Ethereum { chain_id: 5 }),
AccountKey20 {
network: None,
key: lp_eth_acc,
},
),
))),
additional: CustomMetadata {
mintable: false,
permissioned: false,
pool_currency: true,
transferability: CrossChainTransferability::LiquidityPools,
},
},
),
]
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
migrations::UpgradeCentrifuge1020,
migrations::UpgradeCentrifuge1021,
>;

pub struct TransactionConverter;
Expand Down
Loading