Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamewozniak committed Nov 10, 2023
1 parent d4f773d commit 53df9ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
7 changes: 3 additions & 4 deletions app/gmpmiddleware/gmp_middleware.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gmp_middleware
package gmpmiddleware

import (
"encoding/json"
Expand All @@ -8,7 +8,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
Expand Down Expand Up @@ -129,7 +128,7 @@ func (im IBCMiddleware) OnRecvPacket(
return ack
}

var data transfertypes.FungibleTokenPacketData
var data types.FungibleTokenPacketData
if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil {
return channeltypes.NewErrorAcknowledgement(
fmt.Errorf("cannot unmarshal ICS-20 transfer packet data"),
Expand Down Expand Up @@ -160,7 +159,7 @@ func (im IBCMiddleware) OnRecvPacket(
if !ok {
return channeltypes.NewErrorAcknowledgement(
errors.Wrapf(
transfertypes.ErrInvalidAmount,
types.ErrInvalidAmount,
"unable to parse transfer amount (%s) into sdk.Int",
data.Amount,
),
Expand Down
11 changes: 5 additions & 6 deletions app/gmpmiddleware/handler.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gmp_middleware
package gmpmiddleware

import (
"context"
Expand All @@ -7,14 +7,13 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ojo-network/ojo/x/gmp/types"
gmptypes "github.com/ojo-network/ojo/x/gmp/types"
)

type GmpKeeper interface {
RelayPrice(
goCtx context.Context,
msg *gmptypes.MsgRelayPrice,
) (*gmptypes.MsgRelayPriceResponse, error)
msg *types.MsgRelayPrice,
) (*types.MsgRelayPriceResponse, error)
GetParams(ctx sdk.Context) (params types.Params)
}

Expand Down Expand Up @@ -58,7 +57,7 @@ func (h GmpHandler) HandleGeneralMessage(
denomString := string(payload)
denoms := strings.Split(denomString, ",")

_, err := h.gmp.RelayPrice(ctx, &gmptypes.MsgRelayPrice{
_, err := h.gmp.RelayPrice(ctx, &types.MsgRelayPrice{
Relayer: srcAddress,
DestinationChain: srcChain,
DestinationAddress: destAddress,
Expand Down Expand Up @@ -100,7 +99,7 @@ func (h GmpHandler) HandleGeneralMessageWithToken(
denomString := string(payload)
denoms := strings.Split(denomString, ",")

_, err := h.gmp.RelayPrice(ctx, &gmptypes.MsgRelayPrice{
_, err := h.gmp.RelayPrice(ctx, &types.MsgRelayPrice{
Relayer: srcAddress,
DestinationChain: srcChain,
DestinationAddress: destAddress,
Expand Down
5 changes: 2 additions & 3 deletions app/gmpmiddleware/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package gmpmiddleware
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
)

Expand Down Expand Up @@ -40,8 +39,8 @@ func parseDenom(packet channeltypes.Packet, denom string) string {
return denom
}

prefixedDenom := transfertypes.GetDenomPrefix(packet.GetDestPort(), packet.GetDestChannel()) + denom
denom = transfertypes.ParseDenomTrace(prefixedDenom).IBCDenom()
prefixedDenom := types.GetDenomPrefix(packet.GetDestPort(), packet.GetDestChannel()) + denom
denom = types.ParseDenomTrace(prefixedDenom).IBCDenom()

return denom
}

0 comments on commit 53df9ea

Please sign in to comment.