Skip to content

Commit

Permalink
refactor: (#4175)
Browse files Browse the repository at this point in the history
removed
//nolint:staticcheck from deprecated tags
  • Loading branch information
lazyfuhrer authored Jul 27, 2023
1 parent ac6300b commit e827534
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions modules/core/04-channel/keeper/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
Expand All @@ -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(
Expand All @@ -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())),
Expand All @@ -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(
Expand All @@ -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())),
Expand All @@ -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(
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions testing/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit e827534

Please # to comment.