Expand description
Test kit to simulate cross-chain message passing and XCM execution.
Re-exports§
pub use paste;
Modules§
- dmp
- To prevent Out of Memory errors on the
DownwardMessageQueue
, an exponential fee factor (DeliveryFeeFactor
) is set. The fee factor increments exponentially after the number of messages in theDownwardMessageQueue
passes a threshold. This threshold is set as: - helpers
- mock_
message_ queue - Implementation of a simple message queue. Used for sending messages. Simple mock message queue.
- opaque
Macros§
- __
impl_ ext - Implements the
TestExt
trait for a specified struct. - decl_
test_ network - Declares a test network that consists of a relay chain and multiple
parachains. Expects a network struct as an argument and implements testing
functionality,
ParachainXcmRouter
and theRelayChainXcmRouter
. The struct needs to contain the relay chain struct and an indexed list of parachains that are going to be in the network. - decl_
test_ parachain - The macro is implementing the
XcmMessageHandlerT
andDmpMessageHandlerT
traits for the provided parachain struct. Expects the provided parachain struct to define the XcmpMessageHandler and DmpMessageHandler pallets that contain the message handling logic. - decl_
test_ relay_ chain - The macro is implementing upward message passing(UMP) for the provided relay chain struct. The struct has to provide the XCM configuration for the relay chain.
Structs§
- Ancestor
- A unit struct which can be converted into a
Location
of the innerparents
value. - Ancestor
Then - A unit struct which can be converted into a
Location
of the innerparents
value and the inner interior. - Asset
- Either an amount of a single fungible asset, or a single well-identified non-fungible asset.
- AssetId
- Location to identify an asset.
- Assets
- A
Vec
ofAsset
s. - Hint
NumVariants - Instruction
Error - XCM error and the index of the instruction that caused it.
- Location
- A relative path between state-bearing consensus systems.
- MaxAsset
Transfer Filters - Pallet
Info - ParaId
- Unique identifier of a parachain.
- Parent
- A unit struct which can be converted into a
Location
ofparents
value 1. - Parent
Then - A tuple struct which can be converted into a
Location
ofparents
value 1 with the inner interior. - Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T
. - Process
XcmMessage - A message processor that delegates execution to an
XcmExecutor
. - Query
Response Info - Information regarding the composition of a query response.
- RefCell
- A mutable memory location with dynamically checked borrow rules
- VecDeque
- A double-ended queue implemented with a growable ring buffer.
- Weight
- Weight
Meter - Meters consumed weight and a hard limit for the maximal consumable weight.
- Xcm
- XcmContext
- Contextual data pertaining to a specific list of XCM instructions.
- XcmExecutor
- The XCM executor.
Enums§
- Aggregate
Message Origin - Aggregate message origin for the
MessageQueue
pallet. - Asset
Filter Asset
collection, defined either by a number ofAssets
or a single wildcard.- Asset
Instance - A general identifier for an instance of a non-fungible asset class.
- BodyId
- An identifier of a pluralistic body.
- Body
Part - A part of a pluralistic body.
- Fungibility
- Classification of whether an asset is fungible or not, along with a mandatory amount or instance.
- Hint
- Instruction
- Cross-Consensus Message: A message from one consensus system to another.
- Junction
- A single item in a path to describe the relative location of a consensus system.
- Junctions
- Non-parent junctions that can be constructed, up to the length of 8. This specific
Junctions
implementation uses a Rustenum
in order to make pattern matching easier. - Maybe
Error Code - Message
Kind - Network
Id - A global identifier of a data structure existing within consensus.
- Origin
Kind - Basically just the XCM (more general) version of
ParachainDispatchOrigin
. - Outcome
- Outcome of an XCM execution.
- Process
Message Error - Errors that can happen when attempting to process a message with
ProcessMessage::process_message()
. - Response
- Response data to a query.
- Send
Error - Error result value when attempting to send an XCM message.
- UmpQueue
Id - Identifies a UMP queue inside the
MessageQueue
pallet. - Versioned
Xcm - A single XCM message, together with its version code.
- Weight
Limit - An optional weight limit.
- Wild
Asset - A wildcard representing a set of assets.
- Wild
Fungibility - Classification of whether an asset is fungible or not.
- XcmError
- Error codes used in XCM. The first errors codes have explicit indices and are part of the XCM format. Those trailing are merely part of the XCM implementation; there is no expectation that they will retain the same index over time.
- Xcmp
Message Format - The aggregate XCMP message format.
Constants§
Traits§
- DmpMessage
HandlerT - Something that should be called when a downward message is received.
- Encode
- Trait that allows zero-copy write of value-references to slices in LE format.
- Enqueue
Message - Can enqueue messages for multiple origins.
- Execute
Xcm - Type of XCM message executor.
- Get
- A trait for querying a single value from a type.
- Prepared
Message - Process
Message - Can process messages from a specific origin.
- Reanchorable
- SendXcm
- Utility for sending an XCM message to a given location.
- Service
Queues - Can service queues and execute overweight messages.
- TestExt
- XcmWeight
Info - Xcmp
Message HandlerT - Something that should be called for each batch of messages received over XCMP.
Functions§
- blake2_
256 - Conduct a 256-bit Blake2 hash.
- encode_
xcm - Encodes the provided XCM message based on the
message_kind
. - fake_
message_ hash - send_
xcm - Convenience function for using a
SendXcm
implementation. Just interprets thedest
and wraps both inSome
before passing them as mutable references intoT::send_xcm
. - validate_
send - Convenience function for using a
SendXcm
implementation. Just interprets thedest
and wraps both inSome
before passing them as mutable references intoT::send_xcm
.
Type Aliases§
- Instruction
Index - The index of an instruction in an XCM.
- Interior
Location - A relative location which is constrained to be an interior location of the context.
- QueryId
- An identifier for a query.
- Relay
Block Number - The block number type used by Polkadot. 32-bits will allow for 136 years of blocks assuming 1 block per second.
- Send
Result - Result value when attempting to send an XCM message.
- Test
Externalities - Type alias for Externalities implementation used in tests.
- XcmHash
- A hash type for identifying messages.
- XcmResult
Derive Macros§
- Encode
- Derive
parity_scale_codec::Encode
andparity_scale_codec::EncodeLike
for struct and enum.