Skip to content

Commit

Permalink
Add storage migrations for Combinatorial Tokens Upgrade (#1401)
Browse files Browse the repository at this point in the history
* add todos for storage migrations

* remove todo for asset storage migration

* add storage migration and try-runtime tests

* correct migration and tests

* update todos

* update migration tests

* add migration to runtime, fix clippy

* bump storage version

* remove corrupted pools

* correct clippy

* correct CI
  • Loading branch information
Chralt98 authored Jan 30, 2025
1 parent 93f0663 commit 33a736e
Show file tree
Hide file tree
Showing 4 changed files with 402 additions and 3 deletions.
1 change: 0 additions & 1 deletion primitives/src/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ pub enum Asset<MarketId> {
ForeignAsset(u32),
ParimutuelShare(MarketId, CategoryIndex),
}
// TODO Needs storage migration

#[cfg(feature = "runtime-benchmarks")]
impl<MarketId: MaxEncodedLen> ZeitgeistAssetEnumerator<MarketId> for Asset<MarketId> {
Expand Down
4 changes: 3 additions & 1 deletion runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ macro_rules! decl_common_types {
#[cfg(feature = "runtime-benchmarks")]
use zrml_prediction_markets::types::PredictionMarketsCombinatorialTokensBenchmarkHelper;

use zrml_neo_swaps::migration::MigratePoolStorageItems;

pub type Block = generic::Block<Header, UncheckedExtrinsic>;

type Address = sp_runtime::MultiAddress<AccountId, ()>;

type Migrations = ();
type Migrations = (MigratePoolStorageItems<Runtime, RemovableMarketIds>);

pub type Executive = frame_executive::Executive<
Runtime,
Expand Down
2 changes: 1 addition & 1 deletion zrml/neo-swaps/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mod pallet {
};
use zrml_market_commons::MarketCommonsPalletApi;

pub(crate) const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
pub(crate) const STORAGE_VERSION: StorageVersion = StorageVersion::new(3);

// These should not be config parameters to avoid misconfigurations.
pub(crate) const EXIT_FEE: u128 = CENT / 10;
Expand Down
Loading

0 comments on commit 33a736e

Please sign in to comment.