Skip to content

Commit

Permalink
transfer ibc module
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jun 22, 2023
1 parent 04d109b commit 766ea9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ run:
tests: true
# # timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
fix: true

linters:
disable-all: true
Expand Down
18 changes: 9 additions & 9 deletions modules/apps/transfer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
transferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
"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"
Expand All @@ -21,11 +21,11 @@ import (

// IBCModule implements the ICS26 interface for transfer given the transfer keeper.
type IBCModule struct {
keeper keeper.Keeper
keeper transferkeeper.Keeper
}

// NewIBCModule creates a new IBCModule given the keeper
func NewIBCModule(k keeper.Keeper) IBCModule {
func NewIBCModule(k transferkeeper.Keeper) IBCModule {
return IBCModule{
keeper: k,
}
Expand All @@ -36,7 +36,7 @@ func NewIBCModule(k keeper.Keeper) IBCModule {
// supported version. Only 2^32 channels are allowed to be created.
func ValidateTransferChannelParams(
ctx sdk.Context,
k keeper.Keeper,
keeper transferkeeper.Keeper,
order channeltypes.Order,
portID string,
channelID string,
Expand All @@ -55,7 +55,7 @@ func ValidateTransferChannelParams(
}

// Require portID is the portID transfer module is bound to
boundPort := k.GetPort(ctx)
boundPort := keeper.GetPort(ctx)
if boundPort != portID {
return errorsmod.Wrapf(porttypes.ErrInvalidPort, "invalid port: %s, expected %s", portID, boundPort)
}
Expand All @@ -67,11 +67,11 @@ func ValidateTransferChannelParams(
func (im IBCModule) OnChanOpenInit(
ctx sdk.Context,
order channeltypes.Order,
_ []string,
connectionHops []string,
portID string,
channelID string,
chanCap *capabilitytypes.Capability,
_ channeltypes.Counterparty,
counterparty channeltypes.Counterparty,
version string,
) (string, error) {
if err := ValidateTransferChannelParams(ctx, im.keeper, order, portID, channelID); err != nil {
Expand All @@ -98,11 +98,11 @@ func (im IBCModule) OnChanOpenInit(
func (im IBCModule) OnChanOpenTry(
ctx sdk.Context,
order channeltypes.Order,
_ []string,
connectionHops []string,
portID,
channelID string,
chanCap *capabilitytypes.Capability,
_ channeltypes.Counterparty,
counterparty channeltypes.Counterparty,
counterpartyVersion string,
) (string, error) {
if err := ValidateTransferChannelParams(ctx, im.keeper, order, portID, channelID); err != nil {
Expand Down

0 comments on commit 766ea9c

Please sign in to comment.