pub type Hrmp = Pallet<Runtime>;
Aliased Type§
struct Hrmp(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn hrmp_init_open_channel(
origin: <T as Config>::RuntimeOrigin,
recipient: Id,
proposed_max_capacity: u32,
proposed_max_message_size: u32,
) -> Result<(), DispatchError>
pub fn hrmp_init_open_channel( origin: <T as Config>::RuntimeOrigin, recipient: Id, proposed_max_capacity: u32, proposed_max_message_size: u32, ) -> Result<(), DispatchError>
Initiate opening a channel from a parachain to a given recipient with given channel parameters.
proposed_max_capacity
- specifies how many messages can be in the channel at once.proposed_max_message_size
- specifies the maximum size of the messages.
These numbers are a subject to the relay-chain configuration limits.
The channel can be opened only after the recipient confirms it and only on a session change.
Sourcepub fn hrmp_accept_open_channel(
origin: <T as Config>::RuntimeOrigin,
sender: Id,
) -> Result<(), DispatchError>
pub fn hrmp_accept_open_channel( origin: <T as Config>::RuntimeOrigin, sender: Id, ) -> Result<(), DispatchError>
Accept a pending open channel request from the given sender.
The channel will be opened only on the next session boundary.
Sourcepub fn hrmp_close_channel(
origin: <T as Config>::RuntimeOrigin,
channel_id: HrmpChannelId,
) -> Result<(), DispatchError>
pub fn hrmp_close_channel( origin: <T as Config>::RuntimeOrigin, channel_id: HrmpChannelId, ) -> Result<(), DispatchError>
Initiate unilateral closing of a channel. The origin must be either the sender or the recipient in the channel being closed.
The closure can only happen on a session change.
Sourcepub fn force_clean_hrmp(
origin: <T as Config>::RuntimeOrigin,
para: Id,
num_inbound: u32,
num_outbound: u32,
) -> Result<(), DispatchError>
pub fn force_clean_hrmp( origin: <T as Config>::RuntimeOrigin, para: Id, num_inbound: u32, num_outbound: u32, ) -> Result<(), DispatchError>
This extrinsic triggers the cleanup of all the HRMP storage items that a para may have. Normally this happens once per session, but this allows you to trigger the cleanup immediately for a specific parachain.
Number of inbound and outbound channels for para
must be provided as witness data.
Origin must be the ChannelManager
.
Sourcepub fn force_process_hrmp_open(
origin: <T as Config>::RuntimeOrigin,
channels: u32,
) -> Result<(), DispatchError>
pub fn force_process_hrmp_open( origin: <T as Config>::RuntimeOrigin, channels: u32, ) -> Result<(), DispatchError>
Force process HRMP open channel requests.
If there are pending HRMP open channel requests, you can use this function to process all of those requests immediately.
Total number of opening channels must be provided as witness data.
Origin must be the ChannelManager
.
Sourcepub fn force_process_hrmp_close(
origin: <T as Config>::RuntimeOrigin,
channels: u32,
) -> Result<(), DispatchError>
pub fn force_process_hrmp_close( origin: <T as Config>::RuntimeOrigin, channels: u32, ) -> Result<(), DispatchError>
Force process HRMP close channel requests.
If there are pending HRMP close channel requests, you can use this function to process all of those requests immediately.
Total number of closing channels must be provided as witness data.
Origin must be the ChannelManager
.
Sourcepub fn hrmp_cancel_open_request(
origin: <T as Config>::RuntimeOrigin,
channel_id: HrmpChannelId,
open_requests: u32,
) -> Result<(), DispatchError>
pub fn hrmp_cancel_open_request( origin: <T as Config>::RuntimeOrigin, channel_id: HrmpChannelId, open_requests: u32, ) -> Result<(), DispatchError>
This cancels a pending open channel request. It can be canceled by either of the sender or the recipient for that request. The origin must be either of those.
The cancellation happens immediately. It is not possible to cancel the request if it is already accepted.
Total number of open requests (i.e. HrmpOpenChannelRequestsList
) must be provided as
witness data.
Sourcepub fn force_open_hrmp_channel(
origin: <T as Config>::RuntimeOrigin,
sender: Id,
recipient: Id,
max_capacity: u32,
max_message_size: u32,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn force_open_hrmp_channel( origin: <T as Config>::RuntimeOrigin, sender: Id, recipient: Id, max_capacity: u32, max_message_size: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Open a channel from a sender
to a recipient
ParaId
. Although opened by governance,
the max_capacity
and max_message_size
are still subject to the Relay Chain’s
configured limits.
Expected use is when one (and only one) of the ParaId
s involved in the channel is
governed by the system, e.g. a system parachain.
Origin must be the ChannelManager
.
Sourcepub fn establish_system_channel(
origin: <T as Config>::RuntimeOrigin,
sender: Id,
recipient: Id,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn establish_system_channel( origin: <T as Config>::RuntimeOrigin, sender: Id, recipient: Id, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Establish an HRMP channel between two system chains. If the channel does not already exist, the transaction fees will be refunded to the caller. The system does not take deposits for channels between system chains, and automatically sets the message number and size limits to the maximum allowed by the network’s configuration.
Arguments:
sender
: A system chain,ParaId
.recipient
: A system chain,ParaId
.
Any signed origin can call this function, but both inputs MUST be system chains. If the channel does not exist yet, there is no fee.
Sourcepub fn poke_channel_deposits(
origin: <T as Config>::RuntimeOrigin,
sender: Id,
recipient: Id,
) -> Result<(), DispatchError>
pub fn poke_channel_deposits( origin: <T as Config>::RuntimeOrigin, sender: Id, recipient: Id, ) -> Result<(), DispatchError>
Update the deposits held for an HRMP channel to the latest Configuration
. Channels
with system chains do not require a deposit.
Arguments:
sender
: A chain,ParaId
.recipient
: A chain,ParaId
.
Any signed origin can call this function.
Sourcepub fn establish_channel_with_system(
origin: <T as Config>::RuntimeOrigin,
target_system_chain: Id,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn establish_channel_with_system( origin: <T as Config>::RuntimeOrigin, target_system_chain: Id, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Establish a bidirectional HRMP channel between a parachain and a system chain.
Arguments:
target_system_chain
: A system chain,ParaId
.
The origin needs to be the parachain origin.
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Routines and getters related to HRMP.
Sourcepub fn init_open_channel(
origin: Id,
recipient: Id,
proposed_max_capacity: u32,
proposed_max_message_size: u32,
) -> Result<(), DispatchError>
pub fn init_open_channel( origin: Id, recipient: Id, proposed_max_capacity: u32, proposed_max_message_size: u32, ) -> Result<(), DispatchError>
Initiate opening a channel from a parachain to a given recipient with given channel
parameters. If neither chain is part of the system, then a deposit from the Configuration
will be required for origin
(the sender) upon opening the request and the recipient
upon
accepting it.
Basically the same as hrmp_init_open_channel
but
intended for calling directly from other pallets rather than dispatched.
Sourcepub fn accept_open_channel(origin: Id, sender: Id) -> Result<(), DispatchError>
pub fn accept_open_channel(origin: Id, sender: Id) -> Result<(), DispatchError>
Accept a pending open channel request from the given sender.
Basically the same as hrmp_accept_open_channel
but
intended for calling directly from other pallets rather than dispatched.
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> Benchmarking for Pallet<T>
impl<T> Benchmarking for Pallet<T>
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
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,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
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
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
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,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
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.