Skip to content
Merged
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
48 changes: 1 addition & 47 deletions runtime/bifrost-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
VsbondAuctionOnRuntimeUpgrade<Runtime, ()>,
(),
>;

impl_runtime_apis! {
Expand Down Expand Up @@ -1993,52 +1993,6 @@ impl_runtime_apis! {
}
}

pub struct VsbondAuctionOnRuntimeUpgrade<T, I>(PhantomData<(T, I)>);
impl<T: bifrost_vsbond_auction::Config<I>, I: 'static> OnRuntimeUpgrade
for VsbondAuctionOnRuntimeUpgrade<T, I>
{
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
#[allow(unused_imports)]
use frame_support::{migration, Identity};
log::info!("Bifrost `pre_upgrade`...");

// check the on-going order number
let order_iter = bifrost_vsbond_auction::TotalOrderInfos::<T, I>::iter();
let order_count = order_iter.count();
log::info!("Old order count is {:?}", order_count);

Ok(())
}

fn on_runtime_upgrade() -> Weight {
log::info!("Bifrost `on_runtime_upgrade`...");

let weight = bifrost_vsbond_auction::migration::migrate_orders::<Runtime, _>();

log::info!("Bifrost `on_runtime_upgrade finished`");

weight

// RocksDbWeight::get().writes(1)
}

#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
#[allow(unused_imports)]
use frame_support::{migration, Identity};
log::info!("Bifrost `post_upgrade`...");

// check the post-upgrader remaining order number
let order_iter = bifrost_vsbond_auction::TotalOrderInfos::<T, I>::iter();
let order_count = order_iter.count();

log::info!("New order count is {:?}", order_count);

Ok(())
}
}

struct CheckInherents;

impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {
Expand Down