Crate xcm_emulator

Source

Re-exports§

pub use array_bytes;
pub use log;
pub use paste;
pub use pallet_message_queue;
pub use sp_tracing;
pub use polkadot_primitives;
pub use xcm::latest::prelude::AccountId32 as AccountId32Junction;
pub use xcm::latest::prelude::Here;
pub use xcm::latest::prelude::Parachain as ParachainJunction;

Modules§

fmt
Utilities for formatting and printing Strings.
helpers
sr25519
Simple sr25519 (Schnorr-Ristretto) API.

Macros§

__impl_check_assertion
__impl_test_ext_for_parachain
__impl_test_ext_for_relay_chain
assert_expected_events
assert_ok
Panic if an expression doesn’t evaluate to Ok.
bx
decl_test_bridges
decl_test_networks
decl_test_parachains
decl_test_relay_chains
decl_test_sender_receiver_accounts_parameter_types
parameter_types
Create new implementations of the Get trait.

Structs§

AbridgedHrmpChannel
Abridged version of HrmpChannel (from the Hrmp parachains host runtime module) meant to be used by a parachain or PDK such as cumulus.
AccountData
All balance information for an account.
Ancestor
A unit struct which can be converted into a Location of the inner parents value.
Assets
A Vec of Assets.
BlockWeightsLimits
Block weight limits & base values configuration.
BoundedSlice
A bounded slice.
BridgeMessage
BridgeMessageDispatchError
DefaultParaMessageProcessor
DefaultRelayMessageProcessor
Digest
Generic header digest.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HeadData
Parachain head data included in the chain.
HrmpChannelId
A type that uniquely identifies an HRMP channel. An HRMP channel is established between two paras. In text, we use the notation (A, B) to specify a channel between A and B. The channels are unidirectional, meaning that (A, B) and (B, A) refer to different channels. The convention is that we use the first item tuple for the sender and the second for the recipient. Only one channel is allowed between two participants in one direction, i.e. there cannot be 2 different channels identified by (A, B). A channel with the same para id in sender and recipient is invalid. That is, however, not enforced.
LazyLock
A value which is initialized on the first access.
Location
A relative path between state-bearing consensus systems.
MessageQueuePallet
The Pallet struct, the main type that implements traits and standalone functions within the pallet.
Mutex
A mutual exclusion primitive useful for protecting shared data
ParaId
Unique identifier of a parachain.
ParachainInherentData
The inherent data that is passed by the collator to the parachain runtime.
ParachainSystemPallet
The Pallet struct, the main type that implements traits and standalone functions within the pallet.
Parent
A unit struct which can be converted into a Location of parents value 1.
PersistedValidationData
The validation data provides information about how to create the inputs for validation of a candidate. This information is derived from the chain state and will vary from para to para, although some fields may be the same for every para.
PhantomData
Zero-sized type used to mark things that “act like” they own a T.
RefCell
A mutable memory location with dynamically checked borrow rules
RelayStateSproofBuilder
Builds a sproof (portmanteau of ‘spoof’ and ‘proof’) of the relay chain state.
Storage
Struct containing data needed for a storage.
SystemPallet
The Pallet struct, the main type that implements traits and standalone functions within the pallet.
Test
Struct that helps with tests where either dispatchables or assertions need to be reused. The struct keeps the test’s arguments of your choice in the generic Args. These arguments can be easily reused and shared between the assertion functions and dispatchable functions, which are also stored in Test. Origin corresponds to the chain where the XCM interaction starts with an initial execution. Destination corresponds to the last chain where an effect of the initial execution is expected to happen. Hops refer to all the ordered intermediary chains an initial XCM execution can provoke some effect on.
TestAccount
Struct that keeps account’s id and balance
TestArgs
Default Args provided by xcm-emulator to be stored in a Test instance
TestContext
Auxiliar struct to help creating a new Test instance
VecDeque
A double-ended queue implemented with a growable ring buffer.
Weight
WeightMeter
Meters consumed weight and a hard limit for the maximal consumable weight.

Enums§

AggregateMessageOrigin
Aggregate message origin for the MessageQueue pallet.
CumulusAggregateMessageOrigin
The origin of an inbound message.
ExecuteOverweightError
Errors that can happen when attempting to execute an overweight message with ServiceQueues::execute_overweight().
ParachainSystemCall
Contains a variant per dispatchable extrinsic that this pallet has.
ProcessMessageError
Errors that can happen when attempting to process a message with ProcessMessage::process_message().
TimestampCall
Contains a variant per dispatchable extrinsic that this pallet has.
UmpQueueId
Identifies a UMP queue inside the MessageQueue pallet.
WeightLimit
An optional weight limit.

Constants§

BRIDGED_MESSAGES
Bridged messages, each message is: BridgeMessage
DMP_DONE
Downward messages that already processed by parachains, each message is: (to_para_id, relay_block_number, Vec<u8>)
DOWNWARD_MESSAGES
Downward messages, each message is: (to_para_id, [(relay_block_number, msg)])
HORIZONTAL_MESSAGES
Horizontal messages, each message is: (to_para_id, [(from_para_id, relay_block_number, msg)])
INITIALIZED
Flag indicating if global variables have been initialized for a certain Network
LAST_HEAD
Most recent HeadData of each parachain, encoded.
PARA_IDS
Parachains Ids a the Network
UPWARD_MESSAGES
Upward messages, each message is: (from_para_id, msg)

Traits§

Bounded
Numbers which have upper and lower bounds
Bridge
BridgeMessageHandler
Chain
CheckAssertion
Convert
Infallible conversion trait. Generic over both source and destination types.
ConvertLocation
Means of converting a location into an account identifier.
Debug
? formatting.
Decode
Trait that allows zero-copy read of value-references from slices in LE format.
Deref
Used for immutable dereferencing operations, like *v.
Dispatchable
A lazy call (module function and argument values) that can be executed via its dispatch method.
DmpMessageHandler
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.
EncodeLike
A marker trait that tells the compiler that a type encode to the same representation as another type.
EnqueueMessage
Can enqueue messages for multiple origins.
Error
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>.
Get
A trait for querying a single value from a type.
HeaderT
Something which fulfills the abstract idea of a Substrate header. It has types for a Number, a Hash and a Hashing. It provides access to an extrinsics_root, state_root and parent_hash, as well as a digest and a block number.
Hooks
The pallet hooks trait. This is merely an umbrella trait for:
MaxEncodedLen
Items implementing MaxEncodedLen have a statically known maximum encoded size.
MessageQueueConfig
Configuration trait of this pallet.
Network
OnFinalize
See Hooks::on_finalize.
OnIdle
See Hooks::on_idle.
OnInitialize
See Hooks::on_initialize.
OriginTrait
Methods available on frame_system::Config::RuntimeOrigin.
Pair
Trait suitable for typical cryptographic PKI key pair type.
Parachain
ProcessMessage
Can process messages from a specific origin.
RelayChain
ServiceQueues
Can service queues and execute overweight messages.
SystemConfig
Configuration trait of this pallet.
TestExt
XcmpMessageHandler
Something that should be called for each batch of messages received over XCMP.
Zero
Defines an additive identity element for Self.

Functions§

blake2_256
Do a Blake2 256-bit hash and return result.
get_public_from_string_or_panic
Interprets the string s in order to generate a public key without password.
type_name
Returns the name of a type as a string slice.

Type Aliases§

AccountId
Some way of identifying an account on the chain. We intentionally make it equivalent to the public key of our transaction signing scheme.
AccountIdOf
Balance
Balance of an account.
BlockNumberFor
Type alias for the BlockNumber associated type of system config.
BridgeLaneId
DispatchResult
This is the legacy return type of Dispatchable. It is still exposed for compatibility reasons. The new return type is DispatchResultWithInfo. FRAME runtimes should use frame_support::dispatch::DispatchResult.
RelayBlockNumber
The block number type used by Polkadot. 32-bits will allow for 136 years of blocks assuming 1 block per second.
RelayChainBlockNumber
The block number type used by Polkadot. 32-bits will allow for 136 years of blocks assuming 1 block per second.
TestExternalities
Type alias for Externalities implementation used in tests.
XcmHash
A hash type for identifying messages.

Derive Macros§

Debug
Derive macro generating an impl of the trait Debug.
Decode
Derive parity_scale_codec::Decode for struct and enum.
Encode
Derive parity_scale_codec::Encode and parity_scale_codec::EncodeLike for struct and enum.
MaxEncodedLen
Derive parity_scale_codec::MaxEncodedLen for struct and enum.