Trait xcm::v3::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 XcmHash,
        weight_credit: Weight
    ) -> Outcome;
    fn charge_fees(
        location: impl Into<MultiLocation>,
        fees: MultiAssets
    ) -> Result;

    // Provided methods
    fn prepare_and_execute(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        id: &mut XcmHash,
        weight_limit: Weight,
        weight_credit: Weight
    ) -> Outcome { ... }
    fn execute_xcm(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        hash: XcmHash,
        weight_limit: Weight
    ) -> Outcome { ... }
    fn execute_xcm_in_credit(
        origin: impl Into<MultiLocation>,
        message: Xcm<Call>,
        hash: XcmHash,
        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 XcmHash, weight_credit: Weight ) -> Outcome

source

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

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 XcmHash, weight_limit: Weight, weight_credit: Weight ) -> Outcome

source

fn execute_xcm( origin: impl Into<MultiLocation>, message: Xcm<Call>, hash: XcmHash, 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: XcmHash, 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.

Implementations on Foreign Types§

source§

impl<C> ExecuteXcm<C> for ()

§

type Prepared = Weightless

source§

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

source§

fn execute( _: impl Into<MultiLocation>, _: Self::Prepared, _: &mut XcmHash, _: Weight ) -> Outcome

source§

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

Implementors§