From afbe04c03a6ba00b43b7f9bed6d658e307a2dac0 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:29:44 -0700 Subject: [PATCH] return instead of just print --- x/ccv/consumer/keeper/relay.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/ccv/consumer/keeper/relay.go b/x/ccv/consumer/keeper/relay.go index 71abd0d914..060aadff20 100644 --- a/x/ccv/consumer/keeper/relay.go +++ b/x/ccv/consumer/keeper/relay.go @@ -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 @@ -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]) } }