Skip to content

Commit

Permalink
chore: use IsOpen method in missed places (#4354)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Rodriguez authored Aug 16, 2023
1 parent 0940b0c commit 53d349b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions modules/core/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ func (k Keeper) SendPacket(
return 0, errorsmod.Wrap(types.ErrChannelNotFound, sourceChannel)
}

if channel.State != types.OPEN {
if !channel.IsOpen() {
return 0, errorsmod.Wrapf(
types.ErrInvalidChannelState,
"channel is not OPEN (got %s)", channel.State.String(),
"channel state is not OPEN (got %s)", channel.State.String(),
)
}

Expand Down Expand Up @@ -130,7 +130,7 @@ func (k Keeper) RecvPacket(
return errorsmod.Wrap(types.ErrChannelNotFound, packet.GetDestChannel())
}

if channel.State != types.OPEN {
if !channel.IsOpen() {
return errorsmod.Wrapf(
types.ErrInvalidChannelState,
"channel state is not OPEN (got %s)", channel.State.String(),
Expand Down Expand Up @@ -296,7 +296,7 @@ func (k Keeper) WriteAcknowledgement(
return errorsmod.Wrap(types.ErrChannelNotFound, packet.GetDestChannel())
}

if channel.State != types.OPEN {
if !channel.IsOpen() {
return errorsmod.Wrapf(
types.ErrInvalidChannelState,
"channel state is not OPEN (got %s)", channel.State.String(),
Expand Down Expand Up @@ -371,7 +371,7 @@ func (k Keeper) AcknowledgePacket(
)
}

if channel.State != types.OPEN {
if !channel.IsOpen() {
return errorsmod.Wrapf(
types.ErrInvalidChannelState,
"channel state is not OPEN (got %s)", channel.State.String(),
Expand Down
2 changes: 1 addition & 1 deletion modules/core/04-channel/keeper/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (k Keeper) TimeoutPacket(
return types.ErrNoOpMsg
}

if channel.State != types.OPEN {
if !channel.IsOpen() {
return errorsmod.Wrapf(
types.ErrInvalidChannelState,
"channel state is not OPEN (got %s)", channel.State.String(),
Expand Down

0 comments on commit 53d349b

Please sign in to comment.