Skip to content

Introduce (PortId, ChannelId) domain type #84

Closed
@adizere

Description

@adizere

Crate

ibc

Summary

Since we started working on ICS04 handlers(#452) we noticed that there is a recurring need to encapsulate the tuple (PortId, ChannelId) as a type. This tuple is needed in error types:

#[error("Missing channel for port_id {0} and channel_id {1} ")]
ChannelNotFound(PortId, ChannelId),

or as parameters to structures:

https://github.com/informalsystems/ibc-rs/blob/71d9baa6a2eed5a9286f9fe88f1cfacbd51e19d8/modules/src/mock/context.rs#L86-L86

or as parameters to methods:

https://github.com/informalsystems/ibc-rs/blob/71d9baa6a2eed5a9286f9fe88f1cfacbd51e19d8/modules/src/mock/context.rs#L279-L282

So there's ample reasons to introduce a new type for capturing the two.

Proposal

The new type should probably reside in ICS04. Potential names:

pub struct PortChannel(PortId, ChannelId);
pub struct BoundChannel(PortId, ChannelId);
pub struct AuthorizedChannel(PortId, ChannelId);

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions