referrerpolicy=no-referrer-when-downgrade
collectives_westend_integration_tests::v3::prelude::opaque

Trait ExecuteXcm

Source
pub trait ExecuteXcm<Call> {
    type Prepared: PreparedMessage;

    // Required methods
    fn prepare(message: Xcm<Call>) -> Result<Self::Prepared, Xcm<Call>>;
    fn execute(
        origin: impl Into<MultiLocation>,
        pre: Self::Prepared,
        id: &mut [u8; 32],
        weight_credit: Weight,
    ) -> Outcome;
    fn charge_fees(
        location: impl Into<MultiLocation>,
        fees: MultiAssets,
    ) -> Result<(), Error>;

    // Provided methods
    fn prepare_and_execute(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        id: &mut [u8; 32],
        weight_limit: Weight,
        weight_credit: Weight,
    ) -> Outcome { ... }
    fn execute_xcm(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        hash: [u8; 32],
        weight_limit: Weight,
    ) -> Outcome { ... }
    fn execute_xcm_in_credit(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        hash: [u8; 32],
        weight_limit: Weight,
        weight_credit: Weight,
    ) -> Outcome { ... }
}
Expand description

Type of XCM message executor.

Required Associated Types§

Required Methods§

Source

fn prepare(message: Xcm<Call>) -> Result<Self::Prepared, Xcm<Call>>

Source

fn execute( origin: impl Into<MultiLocation>, pre: Self::Prepared, id: &mut [u8; 32], weight_credit: Weight, ) -> Outcome

Source

fn charge_fees( location: impl Into<MultiLocation>, fees: MultiAssets, ) -> Result<(), Error>

Deduct some fees to the sovereign account of the given location and place them as per the convention for fees.

Provided Methods§

Source

fn prepare_and_execute( origin: impl Into<MultiLocation>, message: Xcm<Call>, id: &mut [u8; 32], weight_limit: Weight, weight_credit: Weight, ) -> Outcome

Source

fn execute_xcm( origin: impl Into<MultiLocation>, message: Xcm<Call>, hash: [u8; 32], weight_limit: Weight, ) -> Outcome

Execute some XCM message with the message hash from origin using no more than weight_limit weight.

The weight limit is a basic hard-limit and the implementation may place further restrictions or requirements on weight and other aspects.

Source

fn execute_xcm_in_credit( origin: impl Into<MultiLocation>, message: Xcm<Call>, hash: [u8; 32], weight_limit: Weight, weight_credit: Weight, ) -> Outcome

Execute some XCM message with the message hash from origin using no more than weight_limit weight.

Some amount of weight_credit may be provided which, depending on the implementation, may allow execution without associated payment.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C> ExecuteXcm<C> for ()

Source§

type Prepared = Weightless

Source§

fn prepare(message: Xcm<C>) -> Result<<() as ExecuteXcm<C>>::Prepared, Xcm<C>>

Source§

fn execute( _: impl Into<MultiLocation>, _: <() as ExecuteXcm<C>>::Prepared, _: &mut [u8; 32], _: Weight, ) -> Outcome

Source§

fn charge_fees( _location: impl Into<MultiLocation>, _fees: MultiAssets, ) -> Result<(), Error>

Implementors§