Skip to content

Commit

Permalink
resolve lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hungdinh82 committed Feb 17, 2025
1 parent f3ecc9c commit f706382
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions modules/core/04-channel/v2/keeper/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

// emitSendPacketEvents emits events for the SendPacket handler.
func emitSendPacketEvents(ctx sdk.Context, packet types.Packet) {
encodedPacket:= k.cdc.MustMarshal(&packet)
func emitSendPacketEvents(ctx sdk.Context, packet types.Packet, k Keeper) {
encodedPacket := k.cdc.MustMarshal(&packet)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand All @@ -30,8 +30,8 @@ func emitSendPacketEvents(ctx sdk.Context, packet types.Packet) {
}

// emitRecvPacketEvents emits events for the RecvPacket handler.
func emitRecvPacketEvents(ctx sdk.Context, packet types.Packet) {
encodedPacket:= k.cdc.MustMarshal(&packet)
func emitRecvPacketEvents(ctx sdk.Context, packet types.Packet, k Keeper) {
encodedPacket := k.cdc.MustMarshal(&packet)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand All @@ -50,10 +50,10 @@ func emitRecvPacketEvents(ctx sdk.Context, packet types.Packet) {
}

// emitWriteAcknowledgementEvents emits events for WriteAcknowledgement.
func emitWriteAcknowledgementEvents(ctx sdk.Context, packet types.Packet, ack types.Acknowledgement) {
encodedPacket:= k.cdc.MustMarshal(&packet)
func emitWriteAcknowledgementEvents(ctx sdk.Context, packet types.Packet, ack types.Acknowledgement, k Keeper) {
encodedPacket := k.cdc.MustMarshal(&packet)

encodedAck:= k.cdc.MustMarshal(&ack)
encodedAck := k.cdc.MustMarshal(&ack)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand All @@ -73,8 +73,8 @@ func emitWriteAcknowledgementEvents(ctx sdk.Context, packet types.Packet, ack ty
}

// emitAcknowledgePacketEvents emits events for the AcknowledgePacket handler.
func emitAcknowledgePacketEvents(ctx sdk.Context, packet types.Packet) {
encodedPacket:= k.cdc.MustMarshal(&packet)
func emitAcknowledgePacketEvents(ctx sdk.Context, packet types.Packet, k Keeper) {
encodedPacket := k.cdc.MustMarshal(&packet)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand All @@ -93,8 +93,8 @@ func emitAcknowledgePacketEvents(ctx sdk.Context, packet types.Packet) {
}

// emitTimeoutPacketEvents emits events for the TimeoutPacket handler.
func emitTimeoutPacketEvents(ctx sdk.Context, packet types.Packet) {
encodedPacket:= k.cdc.MustMarshal(&packet)
func emitTimeoutPacketEvents(ctx sdk.Context, packet types.Packet, k Keeper) {
encodedPacket := k.cdc.MustMarshal(&packet)

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
Expand Down
10 changes: 5 additions & 5 deletions modules/core/04-channel/v2/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (k *Keeper) sendPacket(
k.Logger(ctx).Info("packet sent", "sequence", strconv.FormatUint(packet.Sequence, 10), "dst_client_id",
packet.DestinationClient, "src_client_id", packet.SourceClient)

emitSendPacketEvents(ctx, packet)
emitSendPacketEvents(ctx, packet, k)

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

Check failure on line 78 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitSendPacketEvents

return sequence, counterparty.ClientId, nil
}
Expand Down Expand Up @@ -140,7 +140,7 @@ func (k *Keeper) recvPacket(

k.Logger(ctx).Info("packet received", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_client_id", packet.SourceClient, "dst_client_id", packet.DestinationClient)

emitRecvPacketEvents(ctx, packet)
emitRecvPacketEvents(ctx, packet, k)

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

Check failure on line 143 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitRecvPacketEvents

return nil
}
Expand Down Expand Up @@ -181,7 +181,7 @@ func (k Keeper) writeAcknowledgement(

k.Logger(ctx).Info("acknowledgement written", "sequence", strconv.FormatUint(packet.Sequence, 10), "dst_client_id", packet.DestinationClient)

emitWriteAcknowledgementEvents(ctx, packet, ack)
emitWriteAcknowledgementEvents(ctx, packet, ack, k)

return nil
}
Expand Down Expand Up @@ -258,7 +258,7 @@ func (k *Keeper) acknowledgePacket(ctx sdk.Context, packet types.Packet, acknowl

k.Logger(ctx).Info("packet acknowledged", "sequence", strconv.FormatUint(packet.GetSequence(), 10), "src_client_id", packet.GetSourceClient(), "dst_client_id", packet.GetDestinationClient())

emitAcknowledgePacketEvents(ctx, packet)
emitAcknowledgePacketEvents(ctx, packet, k)

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

Check failure on line 261 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitAcknowledgePacketEvents

return nil
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func (k *Keeper) timeoutPacket(

k.Logger(ctx).Info("packet timed out", "sequence", strconv.FormatUint(packet.Sequence, 10), "src_client_id", packet.SourceClient, "dst_client_id", packet.DestinationClient)

emitTimeoutPacketEvents(ctx, packet)
emitTimeoutPacketEvents(ctx, packet, k)

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents) (typecheck)

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents) (typecheck)

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents) (typecheck)

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / lint

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents) (typecheck)

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents

Check failure on line 339 in modules/core/04-channel/v2/keeper/packet.go

View workflow job for this annotation

GitHub Actions / tests (01)

cannot use k (variable of type *Keeper) as Keeper value in argument to emitTimeoutPacketEvents

return nil
}

0 comments on commit f706382

Please sign in to comment.