From e82753435796f27670661f81e76c9974162cdc0a Mon Sep 17 00:00:00 2001 From: Biswarghya Biswas Date: Thu, 27 Jul 2023 12:08:45 +0530 Subject: [PATCH] refactor: (#4175) removed //nolint:staticcheck from deprecated tags --- modules/core/04-channel/keeper/events.go | 16 ++++++++-------- testing/events.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index a7afcb35a8b..7f2b8b65fa8 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -125,7 +125,7 @@ func emitSendPacketEvent(ctx sdk.Context, packet exported.PacketI, channel types ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeSendPacket, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), // DEPRECATED sdk.NewAttribute(types.AttributeKeyDataHex, hex.EncodeToString(packet.GetData())), sdk.NewAttribute(types.AttributeKeyTimeoutHeight, timeoutHeight.String()), sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), @@ -137,7 +137,7 @@ func emitSendPacketEvent(ctx sdk.Context, packet exported.PacketI, channel types sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), // we only support 1-hop packets now, and that is the most important hop for a relayer // (is it going to a chain I am connected to) - sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), // DEPRECATED sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), ), sdk.NewEvent( @@ -153,7 +153,7 @@ func emitRecvPacketEvent(ctx sdk.Context, packet exported.PacketI, channel types ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeRecvPacket, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), // DEPRECATED sdk.NewAttribute(types.AttributeKeyDataHex, hex.EncodeToString(packet.GetData())), sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), @@ -165,7 +165,7 @@ func emitRecvPacketEvent(ctx sdk.Context, packet exported.PacketI, channel types sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), // we only support 1-hop packets now, and that is the most important hop for a relayer // (is it going to a chain I am connected to) - sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), // DEPRECATED sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), ), sdk.NewEvent( @@ -180,7 +180,7 @@ func emitWriteAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI, cha ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeWriteAck, - sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())), // DEPRECATED sdk.NewAttribute(types.AttributeKeyDataHex, hex.EncodeToString(packet.GetData())), sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()), sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())), @@ -189,11 +189,11 @@ func emitWriteAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI, cha sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()), sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), - sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), // DEPRECATED sdk.NewAttribute(types.AttributeKeyAckHex, hex.EncodeToString(acknowledgement)), // we only support 1-hop packets now, and that is the most important hop for a relayer // (is it going to a chain I am connected to) - sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), // DEPRECATED sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), ), sdk.NewEvent( @@ -219,7 +219,7 @@ func emitAcknowledgePacketEvent(ctx sdk.Context, packet exported.PacketI, channe sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), // we only support 1-hop packets now, and that is the most important hop for a relayer // (is it going to a chain I am connected to) - sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), //nolint:staticcheck // DEPRECATED + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), // DEPRECATED sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), ), sdk.NewEvent( diff --git a/testing/events.go b/testing/events.go index 34f7a147d40..733b526e3c0 100644 --- a/testing/events.go +++ b/testing/events.go @@ -69,7 +69,7 @@ func ParsePacketFromEvents(events []abci.Event) (channeltypes.Packet, error) { packet := channeltypes.Packet{} for _, attr := range ev.Attributes { switch attr.Key { - case channeltypes.AttributeKeyData: //nolint:staticcheck // DEPRECATED + case channeltypes.AttributeKeyData: // DEPRECATED packet.Data = []byte(attr.Value) case channeltypes.AttributeKeySequence: @@ -125,7 +125,7 @@ func ParseAckFromEvents(events []abci.Event) ([]byte, error) { for _, ev := range events { if ev.Type == channeltypes.EventTypeWriteAck { for _, attr := range ev.Attributes { - if attr.Key == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED + if attr.Key == channeltypes.AttributeKeyAck { // DEPRECATED return []byte(attr.Value), nil } }