diff --git a/app/gmpmiddleware/gmp_middleware.go b/app/gmpmiddleware/gmp_middleware.go index c9528b31..7067fe21 100644 --- a/app/gmpmiddleware/gmp_middleware.go +++ b/app/gmpmiddleware/gmp_middleware.go @@ -1,4 +1,4 @@ -package gmp_middleware +package gmpmiddleware import ( "encoding/json" @@ -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" @@ -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"), @@ -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, ), diff --git a/app/gmpmiddleware/handler.go b/app/gmpmiddleware/handler.go index 473c22ae..41d2d841 100644 --- a/app/gmpmiddleware/handler.go +++ b/app/gmpmiddleware/handler.go @@ -1,4 +1,4 @@ -package gmp_middleware +package gmpmiddleware import ( "context" @@ -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) } @@ -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, @@ -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, diff --git a/app/gmpmiddleware/types.go b/app/gmpmiddleware/types.go index d049ea88..23da0da9 100644 --- a/app/gmpmiddleware/types.go +++ b/app/gmpmiddleware/types.go @@ -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" ) @@ -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 }