referrerpolicy=no-referrer-when-downgrade
bridge_hub_westend_runtime

Type Alias PolkadotXcm

Source
pub type PolkadotXcm = Pallet<Runtime>;

Aliased Type§

struct PolkadotXcm(/* private fields */);

Implementations

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn request_version_notify(dest: impl Into<Location>) -> Result<(), Error>

Request that dest informs us of its version.

Source

pub fn unrequest_version_notify(dest: impl Into<Location>) -> Result<(), Error>

Request that dest ceases informing us of its version.

Source

pub fn send_xcm( interior: impl Into<Junctions>, dest: impl Into<Location>, message: Xcm<()>, ) -> Result<[u8; 32], SendError>

Relay an XCM message from a given interior location in this context to a given dest location. The fee_payer is charged for the delivery unless None in which case fees are not charged (and instead borne by the chain).

Source

pub fn check_account() -> <T as Config>::AccountId

Source

pub fn dry_run_call<Runtime, Router, OriginCaller, RuntimeCall>( origin: OriginCaller, call: RuntimeCall, result_xcms_version: u32, ) -> Result<CallDryRunEffects<<Runtime as Config>::RuntimeEvent>, Error>
where Runtime: Config, Router: InspectMessageQueues, RuntimeCall: Dispatchable<PostInfo = PostDispatchInfo>, <RuntimeCall as Dispatchable>::RuntimeOrigin: From<OriginCaller>,

Dry-runs call with the given origin.

Returns not only the call result and events, but also the local XCM, if any, and any XCMs forwarded to other locations. Meant to be used in the xcm_runtime_apis::dry_run::DryRunApi runtime API.

Source

pub fn dry_run_xcm<Runtime, Router, RuntimeCall, XcmConfig>( origin_location: VersionedLocation, xcm: VersionedXcm<RuntimeCall>, ) -> Result<XcmDryRunEffects<<Runtime as Config>::RuntimeEvent>, Error>
where RuntimeCall: Decode + GetDispatchInfo, Runtime: Config, Router: InspectMessageQueues, XcmConfig: Config<RuntimeCall = RuntimeCall>,

Dry-runs xcm with the given origin_location.

Returns execution result, events, and any forwarded XCMs to other locations. Meant to be used in the xcm_runtime_apis::dry_run::DryRunApi runtime API.

Source

pub fn query_acceptable_payment_assets( version: u32, asset_ids: Vec<AssetId>, ) -> Result<Vec<VersionedAssetId>, Error>

Given a list of asset ids, returns the correct API response for XcmPaymentApi::query_acceptable_payment_assets.

The assets passed in have to be supported for fee payment.

Source

pub fn query_xcm_weight(message: VersionedXcm<()>) -> Result<Weight, Error>

Source

pub fn is_trusted_reserve( asset: VersionedAsset, location: VersionedLocation, ) -> Result<bool, Error>

Given an Asset and a Location, returns if the provided location is a trusted reserve for the given asset.

Source

pub fn is_trusted_teleporter( asset: VersionedAsset, location: VersionedLocation, ) -> Result<bool, Error>

Given an Asset and a Location, returns if the asset can be teleported to provided location.

Source

pub fn query_delivery_fees( destination: VersionedLocation, message: VersionedXcm<()>, ) -> Result<VersionedAssets, Error>

Source

pub fn report_outcome_notify( message: &mut Xcm<()>, responder: impl Into<Location>, notify: impl Into<<T as Config>::RuntimeCall>, timeout: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), Error>

Consume message and return another which is equivalent to it except that it reports back the outcome and dispatches notify on this chain.

  • message: The message whose outcome should be reported.
  • responder: The origin from which a response should be expected.
  • notify: A dispatchable function which will be called once the outcome of message is known. It may be a dispatchable in any pallet of the local chain, but other than the usual origin, it must accept exactly two arguments: query_id: QueryId and outcome: Response, and in that order. It should expect that the origin is Origin::Response and will contain the responder’s location.
  • timeout: The block number after which it is permissible for notify not to be called even if a response is received.

report_outcome_notify may return an error if the responder is not invertible.

It is assumed that the querier of the response will be Here.

NOTE: notify gets called as part of handling an incoming message, so it should be lightweight. Its weight is estimated during this function and stored ready for weighing ReportOutcome on the way back. If it turns out to be heavier once it returns then reporting the outcome will fail. Futhermore if the estimate is too high, then it may be put in the overweight queue and need to be manually executed.

Source

pub fn new_notify_query( responder: impl Into<Location>, notify: impl Into<<T as Config>::RuntimeCall>, timeout: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, match_querier: impl Into<Location>, ) -> u64

Attempt to create a new query ID and register it as a query that is yet to respond, and which will call a dispatchable when a response happens.

Source

pub fn do_try_state() -> Result<(), DispatchError>

Ensure the correctness of the state of this pallet.

This should be valid before and after each state transition of this pallet.

§Invariants

All entries stored in the SupportedVersion / VersionNotifiers / VersionNotifyTargets need to be migrated to the XCM_VERSION. If they are not, then CurrentMigration has to be set.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn query<KArg>( k: KArg, ) -> Option<QueryStatus<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>>
where KArg: EncodeLike<u64>,

An auto-generated getter for Queries.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn asset_trap<KArg>(k: KArg) -> u32
where KArg: EncodeLike<H256>,

An auto-generated getter for AssetTraps.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn send( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, message: Box<VersionedXcm<()>>, ) -> Result<(), DispatchError>

Source

pub fn teleport_assets( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, beneficiary: Box<VersionedLocation>, assets: Box<VersionedAssets>, fee_asset_item: u32, ) -> Result<(), DispatchError>

👎Deprecated: This extrinsic uses WeightLimit::Unlimited, please migrate to limited_teleport_assets or transfer_assets

Teleport some assets from the local chain to some destination chain.

This function is deprecated: Use limited_teleport_assets instead.

Fee payment on the destination side is made from the asset in the assets vector of index fee_asset_item. The weight limit for fees is not provided and thus is unlimited, with all fees taken as needed from the asset.

  • origin: Must be capable of withdrawing the assets and executing XCM.
  • dest: Destination context for the assets. Will typically be [Parent, Parachain(..)] to send from parachain to parachain, or [Parachain(..)] to send from relay to parachain.
  • beneficiary: A beneficiary location for the assets in the context of dest. Will generally be an AccountId32 value.
  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest chain.
  • fee_asset_item: The index into assets of the item which should be used to pay fees.
Source

pub fn reserve_transfer_assets( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, beneficiary: Box<VersionedLocation>, assets: Box<VersionedAssets>, fee_asset_item: u32, ) -> Result<(), DispatchError>

👎Deprecated: This extrinsic uses WeightLimit::Unlimited, please migrate to limited_reserve_transfer_assets or transfer_assets

Transfer some assets from the local chain to the destination chain through their local, destination or remote reserve.

assets must have same reserve location and may not be teleportable to dest.

  • assets have local reserve: transfer assets to sovereign account of destination chain and forward a notification XCM to dest to mint and deposit reserve-based assets to beneficiary.
  • assets have destination reserve: burn local assets and forward a notification to dest chain to withdraw the reserve assets from this chain’s sovereign account and deposit them to beneficiary.
  • assets have remote reserve: burn local assets, forward XCM to reserve chain to move reserves from this chain’s SA to dest chain’s SA, and forward another XCM to dest to mint and deposit reserve-based assets to beneficiary.

This function is deprecated: Use limited_reserve_transfer_assets instead.

Fee payment on the destination side is made from the asset in the assets vector of index fee_asset_item. The weight limit for fees is not provided and thus is unlimited, with all fees taken as needed from the asset.

  • origin: Must be capable of withdrawing the assets and executing XCM.
  • dest: Destination context for the assets. Will typically be [Parent, Parachain(..)] to send from parachain to parachain, or [Parachain(..)] to send from relay to parachain.
  • beneficiary: A beneficiary location for the assets in the context of dest. Will generally be an AccountId32 value.
  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest (and possibly reserve) chains.
  • fee_asset_item: The index into assets of the item which should be used to pay fees.
Source

pub fn execute( origin: <T as Config>::RuntimeOrigin, message: Box<VersionedXcm<<T as Config>::RuntimeCall>>, max_weight: Weight, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Execute an XCM message from a local, signed, origin.

An event is deposited indicating whether msg could be executed completely or only partially.

No more than max_weight will be used in its attempted execution. If this is less than the maximum amount of weight that the message could take to be executed, then no execution attempt will be made.

Source

pub fn force_xcm_version( origin: <T as Config>::RuntimeOrigin, location: Box<Location>, version: u32, ) -> Result<(), DispatchError>

Extoll that a particular destination can be communicated with through a particular version of XCM.

  • origin: Must be an origin specified by AdminOrigin.
  • location: The destination that is being described.
  • xcm_version: The latest version of XCM that location supports.
Source

pub fn force_default_xcm_version( origin: <T as Config>::RuntimeOrigin, maybe_xcm_version: Option<u32>, ) -> Result<(), DispatchError>

Set a safe XCM version (the version that XCM should be encoded with if the most recent version a destination can accept is unknown).

  • origin: Must be an origin specified by AdminOrigin.
  • maybe_xcm_version: The default XCM encoding version, or None to disable.
Source

pub fn force_subscribe_version_notify( origin: <T as Config>::RuntimeOrigin, location: Box<VersionedLocation>, ) -> Result<(), DispatchError>

Ask a location to notify us regarding their XCM version and any changes to it.

  • origin: Must be an origin specified by AdminOrigin.
  • location: The location to which we should subscribe for XCM version notifications.
Source

pub fn force_unsubscribe_version_notify( origin: <T as Config>::RuntimeOrigin, location: Box<VersionedLocation>, ) -> Result<(), DispatchError>

Require that a particular destination should no longer notify us regarding any XCM version changes.

  • origin: Must be an origin specified by AdminOrigin.
  • location: The location to which we are currently subscribed for XCM version notifications which we no longer desire.
Source

pub fn limited_reserve_transfer_assets( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, beneficiary: Box<VersionedLocation>, assets: Box<VersionedAssets>, fee_asset_item: u32, weight_limit: WeightLimit, ) -> Result<(), DispatchError>

Transfer some assets from the local chain to the destination chain through their local, destination or remote reserve.

assets must have same reserve location and may not be teleportable to dest.

  • assets have local reserve: transfer assets to sovereign account of destination chain and forward a notification XCM to dest to mint and deposit reserve-based assets to beneficiary.
  • assets have destination reserve: burn local assets and forward a notification to dest chain to withdraw the reserve assets from this chain’s sovereign account and deposit them to beneficiary.
  • assets have remote reserve: burn local assets, forward XCM to reserve chain to move reserves from this chain’s SA to dest chain’s SA, and forward another XCM to dest to mint and deposit reserve-based assets to beneficiary.

Fee payment on the destination side is made from the asset in the assets vector of index fee_asset_item, up to enough to pay for weight_limit of weight. If more weight is needed than weight_limit, then the operation will fail and the sent assets may be at risk.

  • origin: Must be capable of withdrawing the assets and executing XCM.
  • dest: Destination context for the assets. Will typically be [Parent, Parachain(..)] to send from parachain to parachain, or [Parachain(..)] to send from relay to parachain.
  • beneficiary: A beneficiary location for the assets in the context of dest. Will generally be an AccountId32 value.
  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest (and possibly reserve) chains.
  • fee_asset_item: The index into assets of the item which should be used to pay fees.
  • weight_limit: The remote-side weight limit, if any, for the XCM fee purchase.
Source

pub fn limited_teleport_assets( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, beneficiary: Box<VersionedLocation>, assets: Box<VersionedAssets>, fee_asset_item: u32, weight_limit: WeightLimit, ) -> Result<(), DispatchError>

Teleport some assets from the local chain to some destination chain.

Fee payment on the destination side is made from the asset in the assets vector of index fee_asset_item, up to enough to pay for weight_limit of weight. If more weight is needed than weight_limit, then the operation will fail and the sent assets may be at risk.

  • origin: Must be capable of withdrawing the assets and executing XCM.
  • dest: Destination context for the assets. Will typically be [Parent, Parachain(..)] to send from parachain to parachain, or [Parachain(..)] to send from relay to parachain.
  • beneficiary: A beneficiary location for the assets in the context of dest. Will generally be an AccountId32 value.
  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest chain.
  • fee_asset_item: The index into assets of the item which should be used to pay fees.
  • weight_limit: The remote-side weight limit, if any, for the XCM fee purchase.
Source

pub fn force_suspension( origin: <T as Config>::RuntimeOrigin, suspended: bool, ) -> Result<(), DispatchError>

Set or unset the global suspension state of the XCM executor.

  • origin: Must be an origin specified by AdminOrigin.
  • suspended: true to suspend, false to resume.
Source

pub fn transfer_assets( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, beneficiary: Box<VersionedLocation>, assets: Box<VersionedAssets>, fee_asset_item: u32, weight_limit: WeightLimit, ) -> Result<(), DispatchError>

Transfer some assets from the local chain to the destination chain through their local, destination or remote reserve, or through teleports.

Fee payment on the destination side is made from the asset in the assets vector of index fee_asset_item (hence referred to as fees), up to enough to pay for weight_limit of weight. If more weight is needed than weight_limit, then the operation will fail and the sent assets may be at risk.

assets (excluding fees) must have same reserve location or otherwise be teleportable to dest, no limitations imposed on fees.

  • for local reserve: transfer assets to sovereign account of destination chain and forward a notification XCM to dest to mint and deposit reserve-based assets to beneficiary.

  • for destination reserve: burn local assets and forward a notification to dest chain to withdraw the reserve assets from this chain’s sovereign account and deposit them to beneficiary.

  • for remote reserve: burn local assets, forward XCM to reserve chain to move reserves from this chain’s SA to dest chain’s SA, and forward another XCM to dest to mint and deposit reserve-based assets to beneficiary.

  • for teleports: burn local assets and forward XCM to dest chain to mint/teleport assets and deposit them to beneficiary.

  • origin: Must be capable of withdrawing the assets and executing XCM.

  • dest: Destination context for the assets. Will typically be X2(Parent, Parachain(..)) to send from parachain to parachain, or X1(Parachain(..)) to send from relay to parachain.

  • beneficiary: A beneficiary location for the assets in the context of dest. Will generally be an AccountId32 value.

  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest (and possibly reserve) chains.

  • fee_asset_item: The index into assets of the item which should be used to pay fees.

  • weight_limit: The remote-side weight limit, if any, for the XCM fee purchase.

Source

pub fn claim_assets( origin: <T as Config>::RuntimeOrigin, assets: Box<VersionedAssets>, beneficiary: Box<VersionedLocation>, ) -> Result<(), DispatchError>

Claims assets trapped on this pallet because of leftover assets during XCM execution.

  • origin: Anyone can call this extrinsic.
  • assets: The exact assets that were trapped. Use the version to specify what version was the latest when they were trapped.
  • beneficiary: The location/account where the claimed assets will be deposited.
Source

pub fn transfer_assets_using_type_and_then( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, assets: Box<VersionedAssets>, assets_transfer_type: Box<TransferType>, remote_fees_id: Box<VersionedAssetId>, fees_transfer_type: Box<TransferType>, custom_xcm_on_dest: Box<VersionedXcm<()>>, weight_limit: WeightLimit, ) -> Result<(), DispatchError>

Transfer assets from the local chain to the destination chain using explicit transfer types for assets and fees.

assets must have same reserve location or may be teleportable to dest. Caller must provide the assets_transfer_type to be used for assets:

  • TransferType::LocalReserve: transfer assets to sovereign account of destination chain and forward a notification XCM to dest to mint and deposit reserve-based assets to beneficiary.
  • TransferType::DestinationReserve: burn local assets and forward a notification to dest chain to withdraw the reserve assets from this chain’s sovereign account and deposit them to beneficiary.
  • TransferType::RemoteReserve(reserve): burn local assets, forward XCM to reserve chain to move reserves from this chain’s SA to dest chain’s SA, and forward another XCM to dest to mint and deposit reserve-based assets to beneficiary. Typically the remote reserve is Asset Hub.
  • TransferType::Teleport: burn local assets and forward XCM to dest chain to mint/teleport assets and deposit them to beneficiary.

On the destination chain, as well as any intermediary hops, BuyExecution is used to buy execution using transferred assets identified by remote_fees_id. Make sure enough of the specified remote_fees_id asset is included in the given list of assets. remote_fees_id should be enough to pay for weight_limit. If more weight is needed than weight_limit, then the operation will fail and the sent assets may be at risk.

remote_fees_id may use different transfer type than rest of assets and can be specified through fees_transfer_type.

The caller needs to specify what should happen to the transferred assets once they reach the dest chain. This is done through the custom_xcm_on_dest parameter, which contains the instructions to execute on dest as a final step. This is usually as simple as: Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }]), but could be something more exotic like sending the assets even further.

  • origin: Must be capable of withdrawing the assets and executing XCM.
  • dest: Destination context for the assets. Will typically be [Parent, Parachain(..)] to send from parachain to parachain, or [Parachain(..)] to send from relay to parachain, or (parents: 2, (GlobalConsensus(..), ..)) to send from parachain across a bridge to another ecosystem destination.
  • assets: The assets to be withdrawn. This should include the assets used to pay the fee on the dest (and possibly reserve) chains.
  • assets_transfer_type: The XCM TransferType used to transfer the assets.
  • remote_fees_id: One of the included assets to be used to pay fees.
  • fees_transfer_type: The XCM TransferType used to transfer the fees assets.
  • custom_xcm_on_dest: The XCM to be executed on dest chain as the last step of the transfer, which also determines what happens to the assets on the destination chain.
  • weight_limit: The remote-side weight limit, if any, for the XCM fee purchase.

Trait Implementations

Source§

impl<T> AssetLock for Pallet<T>
where T: Config,

Source§

type LockTicket = LockTicket<T>

Enact implementer for prepare_lock. This type may be dropped safely to avoid doing the lock.
Source§

type UnlockTicket = UnlockTicket<T>

Enact implementer for prepare_unlock. This type may be dropped safely to avoid doing the unlock.
Source§

type ReduceTicket = ReduceTicket<T>

Enact implementer for prepare_reduce_unlockable. This type may be dropped safely to avoid doing the unlock.
Source§

fn prepare_lock( unlocker: Location, asset: Asset, owner: Location, ) -> Result<LockTicket<T>, LockError>

Prepare to lock an asset. On success, a Self::LockTicket it returned, which can be used to actually enact the lock. Read more
Source§

fn prepare_unlock( unlocker: Location, asset: Asset, owner: Location, ) -> Result<UnlockTicket<T>, LockError>

Prepare to unlock an asset. On success, a Self::UnlockTicket it returned, which can be used to actually enact the lock. Read more
Source§

fn note_unlockable( locker: Location, asset: Asset, owner: Location, ) -> Result<(), LockError>

Handler for when a location reports to us that an asset has been locked for us to unlock at a later stage. Read more
Source§

fn prepare_reduce_unlockable( locker: Location, asset: Asset, owner: Location, ) -> Result<<Pallet<T> as AssetLock>::ReduceTicket, LockError>

Handler for when an owner wishes to unlock an asset on a remote chain. Read more
Source§

impl<T> BeforeAllRuntimeMigrations for Pallet<T>
where T: Config,

Source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
Source§

impl<T> Callable<T> for Pallet<T>
where T: Config,

Source§

impl<T> CheckSuspension for Pallet<T>
where T: Config,

Source§

fn is_suspended<Call>( _origin: &Location, _instructions: &mut [Instruction<Call>], _max_weight: Weight, _properties: &mut Properties, ) -> bool

Source§

impl<T> ClaimAssets for Pallet<T>
where T: Config,

Source§

fn claim_assets( origin: &Location, ticket: &Location, assets: &Assets, _context: &XcmContext, ) -> bool

Claim any assets available to origin and return them in a single Assets value, together with the weight used by this operation.
Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Pallet<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Pallet<T>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> DispatchViewFunction for Pallet<T>
where T: Config,

Source§

fn dispatch_view_function<O>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>
where O: Output,

Source§

impl<T> DropAssets for Pallet<T>
where T: Config,

Source§

fn drop_assets( origin: &Location, assets: AssetsInHolding, _context: &XcmContext, ) -> Weight

Handler for receiving dropped assets. Returns the weight consumed by this operation.
Source§

impl<T> EventEmitter for Pallet<T>
where T: Config,

Source§

fn emit_sent_event( origin: Location, destination: Location, message: Option<Xcm<()>>, message_id: [u8; 32], )

Emits an event when an XCM is successfully sent. Read more
Source§

fn emit_send_failure_event( origin: Location, destination: Location, error: SendError, message_id: [u8; 32], )

Emits an event when an XCM fails to send. Read more
Source§

fn emit_process_failure_event( origin: Location, error: Error, message_id: [u8; 32], )

Emits an event when an XCM fails to process. Read more
Source§

impl<T> ExecuteController<<T as Config>::RuntimeOrigin, <T as Config>::RuntimeCall> for Pallet<T>
where T: Config,

Source§

type WeightInfo = Pallet<T>

Weight information for ExecuteController functions.
Source§

fn execute( origin: <T as Config>::RuntimeOrigin, message: Box<VersionedXcm<<T as Config>::RuntimeCall>>, max_weight: Weight, ) -> Result<Weight, DispatchErrorWithPostInfo<PostDispatchInfo>>

Attempt to execute an XCM locally, returns Ok with the weight consumed if the execution complete successfully, Err otherwise. Read more
Source§

impl<T> ExecuteControllerWeightInfo for Pallet<T>
where T: Config,

Source§

impl<T> GetStorageVersion for Pallet<T>
where T: Config,

Source§

type InCodeStorageVersion = StorageVersion

This type is generated by the pallet macro. Read more
Source§

fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or NoStorageVersionSet if the attribute is missing.
Source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
Source§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use Self::current_storage_version instead. Read more
Source§

impl<T> GetVersion for Pallet<T>
where T: Config,

Source§

impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
Source§

fn try_state( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>

Execute the sanity checks of this pallet, per block. Read more
Source§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
Source§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before Hooks::on_finalize). Read more
Source§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
Source§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
Source§

fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
Source§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
Source§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
Source§

impl<T> IntegrityTest for Pallet<T>
where T: Config,

Source§

impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

This function is being called after every block import (when fully synced). Read more
Source§

impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

Source§

impl<T> OnGenesis for Pallet<T>
where T: Config,

Source§

fn on_genesis()

Something that should happen at genesis.
Source§

impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight, ) -> Weight

Source§

impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Source§

impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter, )

Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§

impl<T> OnResponse for Pallet<T>
where T: Config,

Source§

fn expecting_response( origin: &Location, query_id: u64, querier: Option<&Location>, ) -> bool

Returns true if we are expecting a response from origin for query query_id that was queried by querier.
Source§

fn on_response( origin: &Location, query_id: u64, querier: Option<&Location>, response: Response, max_weight: Weight, _context: &XcmContext, ) -> Weight

Handler for receiving a response from origin relating to query_id initiated by querier.
Source§

impl<T> OnRuntimeUpgrade for Pallet<T>
where T: Config,

Source§

fn on_runtime_upgrade() -> Weight

Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Source§

fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>

Source§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
Source§

impl<T> PalletInfoAccess for Pallet<T>
where T: Config,

Source§

fn index() -> usize

Index of the pallet as configured in the runtime.
Source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
Source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
Source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
Source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
Source§

impl<T> PalletsInfoAccess for Pallet<T>
where T: Config,

Source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
Source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
Source§

impl<T> PartialEq for Pallet<T>

Source§

fn eq(&self, other: &Pallet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> QueryController<<T as Config>::RuntimeOrigin, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

type WeightInfo = Pallet<T>

Weight information for QueryController functions.
Source§

fn query( origin: <T as Config>::RuntimeOrigin, timeout: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, match_querier: VersionedLocation, ) -> Result<u64, DispatchError>

Query a remote location. Read more
Source§

impl<T> QueryControllerWeightInfo for Pallet<T>
where T: Config,

Source§

impl<T> QueryHandler for Pallet<T>
where T: Config,

Source§

fn new_query( responder: impl Into<Location>, timeout: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, match_querier: impl Into<Location>, ) -> u64

Attempt to create a new query ID and register it as a query that is yet to respond.

Source§

fn report_outcome( message: &mut Xcm<()>, responder: impl Into<Location>, timeout: <Pallet<T> as QueryHandler>::BlockNumber, ) -> Result<u64, <Pallet<T> as QueryHandler>::Error>

To check the status of the query, use fn query() passing the resultant QueryId value.

Source§

fn take_response( query_id: u64, ) -> QueryResponseStatus<<Pallet<T> as QueryHandler>::BlockNumber>

Removes response when ready and emits Event::ResponseTaken event.

Source§

type BlockNumber = <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number

Source§

type Error = Error

Source§

type UniversalLocation = <T as Config>::UniversalLocation

Source§

fn expect_response(id: u64, response: Response)

Makes sure to expect a response with the given id.
Source§

impl<T> RecordXcm for Pallet<T>
where T: Config,

Source§

fn should_record() -> bool

Whether or not we should record incoming XCMs.
Source§

fn set_record_xcm(enabled: bool)

Enable or disable recording.
Source§

fn recorded_xcm() -> Option<Xcm<()>>

Get recorded XCM. Returns None if no message was sent, or if recording was off.
Source§

fn record(xcm: Xcm<()>)

Record xcm.
Source§

impl<T> SendController<<T as Config>::RuntimeOrigin> for Pallet<T>
where T: Config,

Source§

type WeightInfo = Pallet<T>

Weight information for SendController functions.
Source§

fn send( origin: <T as Config>::RuntimeOrigin, dest: Box<VersionedLocation>, message: Box<VersionedXcm<()>>, ) -> Result<[u8; 32], DispatchError>

Send an XCM to be executed by a remote location. Read more
Source§

impl<T> SendControllerWeightInfo for Pallet<T>
where T: Config,

Source§

impl<T> StorageInfoTrait for Pallet<T>
where T: Config,

Source§

impl<T> TryDecodeEntireStorage for Pallet<T>
where T: Config,

Source§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning Ok(bytes_decoded) if success.
Source§

impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, _s: Select, ) -> Result<(), DispatchError>

Execute the state checks.
Source§

impl<T> VersionChangeNotifier for Pallet<T>
where T: Config,

Source§

fn start( dest: &Location, query_id: u64, max_weight: Weight, _context: &XcmContext, ) -> Result<(), Error>

Start notifying location should the XCM version of this chain change.

When it does, this type should ensure a QueryResponse message is sent with the given query_id & max_weight and with a response of Response::Version. This should happen until/unless stop is called with the correct query_id.

If the location has an ongoing notification and when this function is called, then an error should be returned.

Source§

fn stop(dest: &Location, _context: &XcmContext) -> Result<(), Error>

Stop notifying location should the XCM change. This is a no-op if there was never a subscription.

Source§

fn is_subscribed(dest: &Location) -> bool

Return true if a location is subscribed to XCM version changes.

Source§

impl<T> ViewFunctionIdPrefix for Pallet<T>
where T: Config,

Source§

fn prefix() -> [u8; 16]

Source§

impl<T> WhitelistedStorageKeys for Pallet<T>
where T: Config,

Source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
Source§

impl<T> WrapVersion for Pallet<T>
where T: Config,

Source§

fn wrap_version<RuntimeCall>( dest: &Location, xcm: impl Into<VersionedXcm<RuntimeCall>>, ) -> Result<VersionedXcm<RuntimeCall>, ()>
where RuntimeCall: Decode + GetDispatchInfo,

Source§

impl<T> Eq for Pallet<T>