Skip to content

Commit

Permalink
launch: cleanup old migrations (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianFranzen authored Feb 11, 2025
1 parent 1b97b13 commit 80496ff
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 52 deletions.
2 changes: 1 addition & 1 deletion pallets/launch/src/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
}
Expand Down
3 changes: 1 addition & 2 deletions pallets/launch/src/data/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pub mod v25;
pub mod v26;
// Include data files here
9 changes: 0 additions & 9 deletions pallets/launch/src/data/v25.rs

This file was deleted.

9 changes: 0 additions & 9 deletions pallets/launch/src/data/v26.rs

This file was deleted.

20 changes: 3 additions & 17 deletions pallets/launch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -212,10 +202,6 @@ pub mod pallet {
Balance: From<BalanceOf<T>> + From<AirdropBalanceOf<T>>,
{
fn on_runtime_upgrade() -> frame_support::weights::Weight {
// Correct token schedule to supply OTC demand, 20% additional unlock.
Allocation::Initiatives
.set_locked::<T>(BalanceOf::<T>::checked_from(1_086_956_520 * ANLOG).unwrap());

match LaunchLedger::compile(LAUNCH_LEDGER) {
Ok(plan) => return plan.run(),
Err(error) => {
Expand Down
18 changes: 4 additions & 14 deletions pallets/launch/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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::<Test>(BalanceOf::<Test>::checked_from(1_086_956_520 * ANLOG).unwrap());

assert_eq!(
<Test as Config>::VestingSchedule::vesting_balance(
&Allocation::Initiatives.account_id::<Test>()
),
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);
Expand Down

0 comments on commit 80496ff

Please sign in to comment.