Skip to content

Commit

Permalink
return instead of just print
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Aug 8, 2023
1 parent f57aa64 commit afbe04c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/ccv/consumer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (k Keeper) SendPackets(ctx sdk.Context) {
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error {
if res := ack.GetResult(); res != nil {
if len(res) != 1 {
k.Logger(ctx).Error("recv invalid ack; expected length 1", "channel", packet.SourceChannel, "ack", res)
return fmt.Errorf("acknowledgement result length must be 1, got %d", len(res))
}

// Unmarshal into V1 consumer packet data type. We trust data is formed correctly
Expand Down Expand Up @@ -266,7 +266,7 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac
k.UpdateSlashRecordOnBounce(ctx)
// Note slash is still at head of queue and will now be retried after appropriate delay period.
default:
k.Logger(ctx).Error("recv invalid result ack; expected 1, 2, or 3", "channel", packet.SourceChannel, "ack", res)
return fmt.Errorf("unrecognized acknowledgement result: %c", res[0])
}
}

Expand Down

0 comments on commit afbe04c

Please sign in to comment.