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§

source

type DeliveryHelper: EnsureDelivery

Helper that ensures successful delivery for extrinsics/benchmarks which need SendXcm.

Required Methods§

source

fn get_asset() -> Asset

Gets an asset that can be handled by the AssetTransactor.

Used only in benchmarks.

Used, for example, in the benchmark for claim_assets.

Provided Methods§

source

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.

source

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.

source

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.

source

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.

Object Safety§

This trait is not object safe.

Implementors§