mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Do not expire HRMP open channel requests (#3543)
* Do not expire HRMP open channel requests * Fix the build and update the docs * Implement canceling requests and do not remove them automatically * Fix a borked merge * Fix fmt * Please spellchecker * Apply suggestions from code review Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Use `mutate_exists` for maintaining request counts * Apply `rustfmt` * Move newly introduced entrypoint to end to preserve ordering Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This commit is contained in:
@@ -328,7 +328,8 @@ impl<T: Encode + Decode + Default> AccountIdConversion<T> for Id {
|
||||
/// 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)`.
|
||||
/// identified by `(A, B)`. A channel with the same para id in sender and recipient is invalid. That
|
||||
/// is, however, not enforced.
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Encode, Decode, RuntimeDebug)]
|
||||
#[cfg_attr(feature = "std", derive(Hash))]
|
||||
pub struct HrmpChannelId {
|
||||
@@ -338,6 +339,13 @@ pub struct HrmpChannelId {
|
||||
pub recipient: Id,
|
||||
}
|
||||
|
||||
impl HrmpChannelId {
|
||||
/// Returns true if the given id corresponds to either the sender or the recipient.
|
||||
pub fn is_participant(&self, id: Id) -> bool {
|
||||
id == self.sender || id == self.recipient
|
||||
}
|
||||
}
|
||||
|
||||
/// A message from a parachain to its Relay Chain.
|
||||
pub type UpwardMessage = Vec<u8>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user