Trait pallet_xcm::benchmarking::Config
source · pub trait Config: Config {
type DeliveryHelper: EnsureDelivery;
// Required method
fn get_asset() -> Asset;
// Provided methods
fn reachable_dest() -> Option<Location> { ... }
fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { ... }
fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { ... }
fn set_up_complex_asset_transfer( ) -> Option<(Assets, u32, Location, Box<dyn FnOnce()>)> { ... }
}
Expand description
Trait that must be implemented by runtime to be able to benchmark pallet properly.
Required Associated Types§
sourcetype DeliveryHelper: EnsureDelivery
type DeliveryHelper: EnsureDelivery
Helper that ensures successful delivery for extrinsics/benchmarks which need SendXcm
.
Required Methods§
Provided Methods§
sourcefn reachable_dest() -> Option<Location>
fn reachable_dest() -> Option<Location>
A Location
that can be reached via XcmRouter
. Used only in benchmarks.
If None
, the benchmarks that depend on a reachable destination will be skipped.
sourcefn teleportable_asset_and_dest() -> Option<(Asset, Location)>
fn teleportable_asset_and_dest() -> Option<(Asset, Location)>
A (Asset, Location)
pair representing asset and the destination it can be
teleported to. Used only in benchmarks.
Implementation should also make sure dest
is reachable/connected.
If None
, the benchmarks that depend on this will default to Weight::MAX
.
sourcefn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)>
fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)>
A (Asset, Location)
pair representing asset and the destination it can be
reserve-transferred to. Used only in benchmarks.
Implementation should also make sure dest
is reachable/connected.
If None
, the benchmarks that depend on this will default to Weight::MAX
.
sourcefn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, Box<dyn FnOnce()>)>
fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, Box<dyn FnOnce()>)>
Sets up a complex transfer (usually consisting of a teleport and reserve-based transfer), so
that runtime can properly benchmark transfer_assets()
extrinsic. Should return a tuple
(Asset, u32, Location, dyn FnOnce())
representing the assets to transfer, the
u32
index of the asset to be used for fees, the destination chain for the transfer, and a
verify()
closure to verify the intended transfer side-effects.
Implementation should make sure the provided assets can be transacted by the runtime, there
are enough balances in the involved accounts, and that dest
is reachable/connected.
Used only in benchmarks.
If None
, the benchmarks that depend on this will default to Weight::MAX
.