Skip to content

Commit

Permalink
chore: remove CancelAuctions
Browse files Browse the repository at this point in the history
  • Loading branch information
al3mart committed Nov 5, 2024
1 parent 2a93292 commit c7d23e9
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions relay/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use frame_support::{
traits::{
fungible::HoldConsideration, tokens::UnityOrOuterConversion, ConstU32, ConstU8, EitherOf,
EitherOfDiverse, Everything, FromContains, Get, InstanceFilter, KeyOwnerProofSystem,
LinearStoragePrice, OnRuntimeUpgrade, PrivilegeCmp, ProcessMessage, ProcessMessageError,
LinearStoragePrice, PrivilegeCmp, ProcessMessage, ProcessMessageError,
WithdrawReasons,
},
weights::{
Expand Down Expand Up @@ -1999,43 +1999,6 @@ pub mod migrations {
}
}

/// Cancel all ongoing auctions.
///
/// Any leases that come into existence after coretime was launched will not be served. Yet,
/// any ongoing auctions must be cancelled.
///
/// Safety:
///
/// - After coretime is launched, there are no auctions anymore. So if this forgotten to
/// be removed after the runtime upgrade, running this again on the next one is harmless.
/// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry
/// multiple times should also be fine.
pub struct CancelAuctions;
impl OnRuntimeUpgrade for CancelAuctions {
fn on_runtime_upgrade() -> Weight {
if let Err(err) = Auctions::cancel_auction(frame_system::RawOrigin::Root.into()) {
log::debug!(target: "runtime", "Cancelling auctions failed: {:?}", err);
}
// Cancel scheduled auction as well:
if let Err(err) = Scheduler::cancel_named(
pallet_custom_origins::Origin::AuctionAdmin.into(),
[
0x87, 0xa8, 0x71, 0xb4, 0xd6, 0x21, 0xf0, 0xb9, 0x73, 0x47, 0x5a, 0xaf, 0xcc,
0x32, 0x61, 0x0b, 0xd7, 0x68, 0x8f, 0x15, 0x02, 0x33, 0x8a, 0xcd, 0x00, 0xee,
0x48, 0x8a, 0xc3, 0x62, 0x0f, 0x4c,
],
) {
log::debug!(target: "runtime", "Cancelling scheduled auctions failed: {:?}", err);
}
use pallet_scheduler::WeightInfo as _;
use polkadot_runtime_common::auctions::WeightInfo as _;
weights::polkadot_runtime_common_auctions::WeightInfo::<Runtime>::cancel_auction()
.saturating_add(weights::pallet_scheduler::WeightInfo::<Runtime>::cancel_named(
<Runtime as pallet_scheduler::Config>::MaxScheduledPerBlock::get(),
))
}
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
parachains_configuration::migration::v12::MigrateToV12<Runtime>,
Expand All @@ -2056,7 +2019,6 @@ pub mod migrations {
crate::xcm_config::XcmRouter,
GetLegacyLeaseImpl,
>,
CancelAuctions,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
Expand Down

0 comments on commit c7d23e9

Please sign in to comment.