From abbfd4b51c5100be22a5959ca10cc99800aa74f6 Mon Sep 17 00:00:00 2001 From: Florian Franzen Date: Mon, 10 Feb 2025 17:31:04 +0100 Subject: [PATCH] launch: cleanup old migrations --- pallets/launch/src/allocation.rs | 2 +- pallets/launch/src/data/mod.rs | 3 +-- pallets/launch/src/data/v25.rs | 9 --------- pallets/launch/src/data/v26.rs | 9 --------- pallets/launch/src/lib.rs | 20 +++----------------- pallets/launch/src/tests.rs | 18 ++++-------------- 6 files changed, 9 insertions(+), 52 deletions(-) delete mode 100644 pallets/launch/src/data/v25.rs delete mode 100644 pallets/launch/src/data/v26.rs diff --git a/pallets/launch/src/allocation.rs b/pallets/launch/src/allocation.rs index 5929d798c..76cfa92e0 100644 --- a/pallets/launch/src/allocation.rs +++ b/pallets/launch/src/allocation.rs @@ -126,7 +126,7 @@ impl Allocation { Strategic => Some((376_857_707_180 * mANLOG, 47_669 * mANLOG, 1_950_870)), Team => Some((1_714_673_910_300 * mANLOG, 108_446 * mANLOG, 4_586_070)), Airdrop => None, - Initiatives => Some((1_449_275_360_000 * mANLOG, 68_745 * mANLOG, 633_270)), + Initiatives => Some((1_086_956_520_000 * mANLOG, 68_745 * mANLOG, 633_270)), Ecosystem => Some((679_553_171_595 * mANLOG, 32_234 * mANLOG, 633_270)), } } diff --git a/pallets/launch/src/data/mod.rs b/pallets/launch/src/data/mod.rs index b109523d2..c52505bad 100644 --- a/pallets/launch/src/data/mod.rs +++ b/pallets/launch/src/data/mod.rs @@ -1,2 +1 @@ -pub mod v25; -pub mod v26; +// Include data files here diff --git a/pallets/launch/src/data/v25.rs b/pallets/launch/src/data/v25.rs deleted file mode 100644 index 7f6e116fd..000000000 --- a/pallets/launch/src/data/v25.rs +++ /dev/null @@ -1,9 +0,0 @@ -use crate::deposits::RawVestedDepositStage; - -use time_primitives::ANLOG; - -pub const DEPOSITS_OTC_INITIATIVES_2: RawVestedDepositStage = &[ - ("an9vo3CG2q2usecaYwzxUspC8ni3CbH8VJ9dJpS27As1Wkg8E", 181_159_420 * ANLOG, None), - ("an6aY9KJ2NApWthxDBkpMXFyTuoKSYdd26WTYdfiCMHv995Hn", 90_579_710 * ANLOG, None), - ("an6mYVNQjyUTdigSPnPy2iXQbypaYJmw2jzEtZLirFFUB3Uwh", 90_579_710 * ANLOG, None), -]; diff --git a/pallets/launch/src/data/v26.rs b/pallets/launch/src/data/v26.rs deleted file mode 100644 index e7e4a5c8e..000000000 --- a/pallets/launch/src/data/v26.rs +++ /dev/null @@ -1,9 +0,0 @@ -use crate::deposits::RawVestedDepositStage; - -use time_primitives::MILLIANLOG; - -pub const DEPOSITS_LAUNCHDAY_2: RawVestedDepositStage = &[( - "an6VSnazjK7HAkvpv5UmgX6RGbvdFh5Zo3pn8z1RaXVdiDajo", - (7_295_834_400 + 7_154_068_950) * MILLIANLOG, - None, -)]; diff --git a/pallets/launch/src/lib.rs b/pallets/launch/src/lib.rs index 62a480f42..a4b99d832 100644 --- a/pallets/launch/src/lib.rs +++ b/pallets/launch/src/lib.rs @@ -48,7 +48,7 @@ pub mod pallet { use frame_support::traits::{Currency, ExistenceRequirement, StorageVersion, VestingSchedule}; use frame_support::PalletId; use frame_system::pallet_prelude::*; - use sp_runtime::traits::CheckedConversion; + //use sp_runtime::traits::CheckedConversion; use sp_std::{vec, vec::Vec}; /// Updating this number will automatically execute the next launch stages on update @@ -108,19 +108,9 @@ pub mod pallet { // OTC Preparation 2 (24, Allocation::Initiatives, 249_094_202_500 * MILLIANLOG, Stage::Retired), // OTC Preparation 3 - ( - 25, - Allocation::Initiatives, - 362_318_840 * ANLOG, - Stage::DepositFromUnlocked(data::v25::DEPOSITS_OTC_INITIATIVES_2), - ), + (25, Allocation::Initiatives, 362_318_840 * ANLOG, Stage::Retired), // Launchday transfer 2 - ( - 26, - Allocation::Ecosystem, - 14_449_903_350 * MILLIANLOG, - Stage::DepositFromUnlocked(data::v26::DEPOSITS_LAUNCHDAY_2), - ), + (26, Allocation::Ecosystem, 14_449_903_350 * MILLIANLOG, Stage::Retired), ]; /// TODO: Difference that was actually minted for airdrops: @@ -212,10 +202,6 @@ pub mod pallet { Balance: From> + From>, { fn on_runtime_upgrade() -> frame_support::weights::Weight { - // Correct token schedule to supply OTC demand, 20% additional unlock. - Allocation::Initiatives - .set_locked::(BalanceOf::::checked_from(1_086_956_520 * ANLOG).unwrap()); - match LaunchLedger::compile(LAUNCH_LEDGER) { Ok(plan) => return plan.run(), Err(error) => { diff --git a/pallets/launch/src/tests.rs b/pallets/launch/src/tests.rs index 77632a6fb..6ba9c85ef 100644 --- a/pallets/launch/src/tests.rs +++ b/pallets/launch/src/tests.rs @@ -8,12 +8,12 @@ use crate::{ use polkadot_sdk::*; use frame_support::traits::{Currency, StorageVersion, VestingSchedule}; -use sp_runtime::traits::CheckedConversion; +//use sp_runtime::traits::CheckedConversion; use time_primitives::{ANLOG, MILLIANLOG as mANLOG}; /// Current expected on-chain stage version to test -const ON_CHAIN_STAGE: u16 = 24; +const ON_CHAIN_STAGE: u16 = 26; /// Wrapped expected on-chain stage version to test const ON_CHAIN_VERSION: StorageVersion = StorageVersion::new(ON_CHAIN_STAGE); @@ -49,18 +49,8 @@ fn launch_ledger_validation() { mint_virtual(Allocation::Team, 1_669_384_055_300 * mANLOG); mint_virtual(Allocation::Airdrop, 19_626_240_537_386_317_029); - mint_virtual(Allocation::Initiatives, 1_501_013_514_500 * mANLOG); - mint_virtual(Allocation::Ecosystem, 708_390_838_154 * mANLOG); - - Allocation::Initiatives - .set_locked::(BalanceOf::::checked_from(1_086_956_520 * ANLOG).unwrap()); - - assert_eq!( - ::VestingSchedule::vesting_balance( - &Allocation::Initiatives.account_id::() - ), - Some(1_086_956_520 * ANLOG) - ); + mint_virtual(Allocation::Initiatives, 1_501_013_514_500 * mANLOG - 362_318_840 * ANLOG); + mint_virtual(Allocation::Ecosystem, 708_390_838_154 * mANLOG - 14_449_903_350 * mANLOG); // Start new block to collect events System::set_block_number(1);