pub struct Pallet<T>(/* private fields */);
Expand description
Pallet messenger used to communicate between chains and other blockchains.
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn initiate_channel(
origin: OriginFor<T>,
dst_chain_id: ChainId,
params: InitiateChannelParams,
) -> DispatchResult
pub fn initiate_channel( origin: OriginFor<T>, dst_chain_id: ChainId, params: InitiateChannelParams, ) -> DispatchResult
A new Channel is initiated with a foreign chain. Next Channel ID is used to assign the new channel. Channel is set to initiated and do not accept or receive any messages.
sourcepub fn close_channel(
origin: OriginFor<T>,
chain_id: ChainId,
channel_id: ChannelId,
) -> DispatchResult
pub fn close_channel( origin: OriginFor<T>, chain_id: ChainId, channel_id: ChannelId, ) -> DispatchResult
An open channel is closed with a foreign chain. Channel is set to Closed and do not accept or receive any messages.
sourcepub fn relay_message(
origin: OriginFor<T>,
msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>,
) -> DispatchResult
pub fn relay_message( origin: OriginFor<T>, msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, ) -> DispatchResult
Receives an Inbox message that needs to be validated and processed.
sourcepub fn relay_message_response(
origin: OriginFor<T>,
msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>,
) -> DispatchResult
pub fn relay_message_response( origin: OriginFor<T>, msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, ) -> DispatchResult
Receives a response from the dst_chain for a message in Outbox.
sourcepub fn update_consensus_chain_allowlist(
origin: OriginFor<T>,
update: ChainAllowlistUpdate,
) -> DispatchResult
pub fn update_consensus_chain_allowlist( origin: OriginFor<T>, update: ChainAllowlistUpdate, ) -> DispatchResult
A call to update consensus chain allow list.
sourcepub fn initiate_domain_update_chain_allowlist(
origin: OriginFor<T>,
domain_id: DomainId,
update: ChainAllowlistUpdate,
) -> DispatchResult
pub fn initiate_domain_update_chain_allowlist( origin: OriginFor<T>, domain_id: DomainId, update: ChainAllowlistUpdate, ) -> DispatchResult
A call to initiate chain allowlist update on domains
sourcepub fn update_domain_allowlist(
origin: OriginFor<T>,
updates: DomainAllowlistUpdates,
) -> DispatchResult
pub fn update_domain_allowlist( origin: OriginFor<T>, updates: DomainAllowlistUpdates, ) -> DispatchResult
An inherent call to update allowlist for domain.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn get_open_channel_for_chain(
dst_chain_id: ChainId,
) -> Option<(ChannelId, FeeModel<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>)>
pub fn get_open_channel_for_chain( dst_chain_id: ChainId, ) -> Option<(ChannelId, FeeModel<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>)>
Returns the last open channel for a given chain.
pub fn validate_relay_message( xdm: &CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, pre_dispatch: bool, consensus_state_root: <<T as Config>::Hashing as Hash>::Output, ) -> Result<ValidatedRelayMessage, TransactionValidityError>
pub fn validate_relay_message_response( xdm: &CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, pre_dispatch: bool, consensus_state_root: <<T as Config>::Hashing as Hash>::Output, ) -> Result<ValidatedRelayMessage, TransactionValidityError>
pub fn outbox_storage_key(message_key: MessageKey) -> Vec<u8> ⓘ
pub fn inbox_response_storage_key(message_key: MessageKey) -> Vec<u8> ⓘ
pub fn channel_storage_key(chain_id: ChainId, channel_id: ChannelId) -> Vec<u8> ⓘ
pub fn domain_chains_allowlist_update( domain_id: DomainId, ) -> Option<DomainAllowlistUpdates>
pub fn domain_allow_list_update_storage_key(domain_id: DomainId) -> Vec<u8> ⓘ
pub fn updated_channels() -> BTreeSet<(ChainId, ChannelId)>
pub fn pre_dispatch_with_trusted_mmr_proof( call: &Call<T>, ) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn next_channel_id<KArg>(k: KArg) -> ChannelIdwhere
KArg: EncodeLike<ChainId>,
pub fn next_channel_id<KArg>(k: KArg) -> ChannelIdwhere
KArg: EncodeLike<ChainId>,
An auto-generated getter for NextChannelId
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn inbox_fees<KArg>(
k: KArg,
) -> Option<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>where
KArg: EncodeLike<(ChainId, MessageId)>,
pub fn inbox_fees<KArg>(
k: KArg,
) -> Option<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>where
KArg: EncodeLike<(ChainId, MessageId)>,
An auto-generated getter for InboxFee
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn outbox_fees<KArg>(
k: KArg,
) -> Option<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>where
KArg: EncodeLike<(ChainId, MessageId)>,
pub fn outbox_fees<KArg>(
k: KArg,
) -> Option<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>where
KArg: EncodeLike<(ChainId, MessageId)>,
An auto-generated getter for OutboxFee
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn inbox_responses<KArg>(
k: KArg,
) -> Option<Message<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>where
KArg: EncodeLike<(ChainId, ChannelId, Nonce)>,
pub fn inbox_responses<KArg>(
k: KArg,
) -> Option<Message<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>where
KArg: EncodeLike<(ChainId, ChannelId, Nonce)>,
An auto-generated getter for InboxResponses
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn outbox_responses() -> Option<Message<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>
pub fn outbox_responses() -> Option<Message<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>>
An auto-generated getter for OutboxResponses
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn chain_allowlist() -> BTreeSet<ChainId>
pub fn chain_allowlist() -> BTreeSet<ChainId>
An auto-generated getter for ChainAllowlist
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn domain_chain_allowlist_updates<KArg>(
k: KArg,
) -> Option<DomainAllowlistUpdates>where
KArg: EncodeLike<DomainId>,
pub fn domain_chain_allowlist_updates<KArg>(
k: KArg,
) -> Option<DomainAllowlistUpdates>where
KArg: EncodeLike<DomainId>,
An auto-generated getter for DomainChainAllowlistUpdate
.
source§impl<T> Pallet<T>
impl<T> Pallet<T>
pub fn outbox_message_unsigned( msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, ) -> Option<T::Extrinsic>
pub fn inbox_response_message_unsigned( msg: CrossDomainMessage<BlockNumberFor<T>, T::Hash, T::MmrHash>, ) -> Option<T::Extrinsic>
sourcepub fn should_relay_outbox_message(
dst_chain_id: ChainId,
msg_id: MessageId,
) -> bool
pub fn should_relay_outbox_message( dst_chain_id: ChainId, msg_id: MessageId, ) -> bool
Returns true if the outbox message has not received the response yet.
sourcepub fn should_relay_inbox_message_response(
dst_chain_id: ChainId,
msg_id: MessageId,
) -> bool
pub fn should_relay_inbox_message_response( dst_chain_id: ChainId, msg_id: MessageId, ) -> bool
Returns true if the inbox message response has not received acknowledgement yet.
Trait Implementations§
source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
source§impl<T: Config> DomainBundleSubmitted for Pallet<T>
impl<T: Config> DomainBundleSubmitted for Pallet<T>
source§fn domain_bundle_submitted(domain_id: DomainId)
fn domain_bundle_submitted(domain_id: DomainId)
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
source§type InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§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: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(_n: BlockNumberFor<T>) -> Weight
fn on_initialize(_n: BlockNumberFor<T>) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnDomainInstantiated for Pallet<T>
impl<T: Config> OnDomainInstantiated for Pallet<T>
fn on_domain_instantiated(domain_id: DomainId)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T: Config> ProvideInherent for Pallet<T>
impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
fn create_inherent(data: &InherentData) -> Option<Self::Call>
InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData,
) -> Result<Option<Self::Error>, Self::Error>
fn is_inherent_required( data: &InherentData, ) -> Result<Option<Self::Error>, Self::Error>
source§fn check_inherent(
call: &Self::Call,
data: &InherentData,
) -> Result<(), Self::Error>
fn check_inherent( call: &Self::Call, data: &InherentData, ) -> Result<(), Self::Error>
source§fn is_inherent(call: &Self::Call) -> bool
fn is_inherent(call: &Self::Call) -> bool
source§impl<T: Config> ValidateUnsigned for Pallet<T>
impl<T: Config> ValidateUnsigned for Pallet<T>
source§fn validate_unsigned(
_source: TransactionSource,
call: &Self::Call,
) -> TransactionValidity
fn validate_unsigned( _source: TransactionSource, call: &Self::Call, ) -> TransactionValidity
Validate unsigned call to this module.
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
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.impl<T> Eq for Pallet<T>
Auto Trait Implementations§
impl<T> Freeze for Pallet<T>
impl<T> RefUnwindSafe for Pallet<T>where
T: RefUnwindSafe,
impl<T> Send for Pallet<T>where
T: Send,
impl<T> Sync for Pallet<T>where
T: Sync,
impl<T> Unpin for Pallet<T>where
T: Unpin,
impl<T> UnwindSafe for Pallet<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.