Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper function for checking if a channel is open #4152

Closed
crodriguezvega opened this issue Jul 20, 2023 · 1 comment · Fixed by #4155
Closed

Add helper function for checking if a channel is open #4152

crodriguezvega opened this issue Jul 20, 2023 · 1 comment · Fixed by #4155
Labels
04-channel good first issue Good for newcomers type: code hygiene Clean up code but without changing functionality or interfaces

Comments

@crodriguezvega
Copy link
Contributor

crodriguezvega commented Jul 20, 2023

Similary as for #3466, create an IsOpen function in the Channel type that does the open check:

if !channel.IsOpen() {
  return errorsmod.Wrapf(channeltypes.ErrInvalidChannelState, "expected %s, got %s", channeltypes.Open, channel.State)
}
func (channel Channel) IsOpen() bool {
  return channel.State == OPEN
}

And use it everywhere where we check if the channel is open or not.

@crodriguezvega crodriguezvega added good first issue Good for newcomers type: code hygiene Clean up code but without changing functionality or interfaces 04-channel labels Jul 20, 2023
AbolfazlSoltaani pushed a commit to AbolfazlSoltaani/ibc-go that referenced this issue Jul 21, 2023
AbolfazlSoltaani pushed a commit to AbolfazlSoltaani/ibc-go that referenced this issue Jul 21, 2023
@DimitrisJim
Copy link
Contributor

reminder comment: needs to be changed in 04-channel branch too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
04-channel good first issue Good for newcomers type: code hygiene Clean up code but without changing functionality or interfaces
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants