Skip to content

Commit

Permalink
Remove migration code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed May 28, 2024
1 parent 6accab8 commit d70bf79
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,38 +1170,10 @@ pub type Executive = frame_executive::Executive<
Migrations,
>;

parameter_types! {
pub const StaticPriceProviderName: &'static str = "StaticPriceProvider";
// 0.18 $
pub const InitPrice: CurrencyAmount = CurrencyAmount::from_rational(18, 100);
}

/// All migrations that will run on the next runtime upgrade.
///
/// Once done, migrations should be removed from the tuple.
pub type Migrations = (
frame_support::migrations::RemovePallet<
StaticPriceProviderName,
<Runtime as frame_system::Config>::DbWeight,
>,
OracleIntegrationLogic,
pallet_price_aggregator::PriceAggregatorInitializer<Runtime, InitPrice>,
);

use frame_support::traits::OnRuntimeUpgrade;
pub struct OracleIntegrationLogic;
impl OnRuntimeUpgrade for OracleIntegrationLogic {
fn on_runtime_upgrade() -> Weight {
// 1. Set initial storage versions for the membership pallet
use frame_support::traits::StorageVersion;
StorageVersion::new(4)
.put::<pallet_membership::Pallet<Runtime, OracleMembershipInstance>>();

// No storage version for the `orml_oracle` pallet, it's essentially 0

<Runtime as frame_system::Config>::DbWeight::get().writes(1)
}
}
pub type Migrations = ();

type EventRecord = frame_system::EventRecord<
<Runtime as frame_system::Config>::RuntimeEvent,
Expand Down

0 comments on commit d70bf79

Please sign in to comment.