Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
use new benchmark weights
  • Loading branch information
apopiak committed Oct 3, 2023
commit 2ae6c05a46adc79cf65105178b5eafe7febd17bd
6 changes: 5 additions & 1 deletion pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ pub mod pallet {
/// - `maybe_position`: The position in the bucket of the message to be discarded. Will discard the whole bucket
/// if `None`.
#[pallet::call_index(11)]
#[pallet::weight((T::WeightInfo::discard_deferred(), DispatchClass::Operational))]
#[pallet::weight((
T::WeightInfo::discard_deferred_individual().max(T::WeightInfo::discard_deferred_bucket()),
DispatchClass::Operational
))]
pub fn discard_deferred(
origin: OriginFor<T>,
para_id: ParaId,
Expand Down Expand Up @@ -869,6 +872,7 @@ impl<T: Config> Pallet<T> {
let deferred_to = relay_block.saturating_add(defer_by);

let hash = xcm.using_encoded(sp_io::hashing::blake2_256);
weight_used.saturating_accrue(T::WeightInfo::try_place_in_deferred_queue());
let _ = Self::try_place_in_deferred_queue(
sender,
deferred_to,
Expand Down
4 changes: 3 additions & 1 deletion pallets/xcmp-queue/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ pub trait WeightInfo {
fn set_config_with_u32() -> Weight;
fn set_config_with_weight() -> Weight;
fn service_deferred() -> Weight;
fn discard_deferred() -> Weight;
fn discard_deferred_bucket() -> Weight;
fn discard_deferred_individual() -> Weight;
fn try_place_in_deferred_queue() -> Weight;
}

pub struct SubstrateWeight<T>(PhantomData<T>);
Expand Down