From 70ab3772399c682d7e08e51cba2779249f7fdb15 Mon Sep 17 00:00:00 2001 From: bmo Date: Tue, 10 Dec 2024 07:16:43 +0000 Subject: [PATCH] chore: uses errors.New --- modules/apps/transfer/keeper/keeper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index 1ebb14ace71..d3d49564cc3 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -359,7 +359,7 @@ func (k Keeper) iterateForwardedPackets(ctx context.Context, cb func(packet type // Iterator key consists of types.ForwardedPacketKey/portID/channelID/sequence parts := strings.Split(string(iterator.Key()), "/") if len(parts) != 4 { - panic(fmt.Errorf("key path should always have 4 elements")) + panic(errors.New("key path should always have 4 elements")) } if parts[0] != string(types.ForwardedPacketKey) { panic(fmt.Errorf("key path does not start with expected prefix: %s", types.ForwardedPacketKey)) @@ -367,10 +367,10 @@ func (k Keeper) iterateForwardedPackets(ctx context.Context, cb func(packet type portID, channelID := parts[1], parts[2] if err := host.PortIdentifierValidator(portID); err != nil { - panic(fmt.Errorf("port identifier validation failed while parsing forward key path")) + panic(errors.New("port identifier validation failed while parsing forward key path")) } if err := host.ChannelIdentifierValidator(channelID); err != nil { - panic(fmt.Errorf("channel identifier validation failed while parsing forward key path")) + panic(errors.New("channel identifier validation failed while parsing forward key path")) } forwardPacket.ForwardKey.Sequence = sdk.BigEndianToUint64([]byte(parts[3]))