Skip to content

Commit 6056ce2

Browse files
committed
use ibc v2
1 parent 812de6a commit 6056ce2

6 files changed

Lines changed: 17 additions & 28 deletions

File tree

app/app.go

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package app
22

33
import (
4-
"github.com/ethereum/go-ethereum/common"
54
"github.com/tharsis/ethermint/x/feemarket"
65
"io"
76
"net/http"
@@ -85,16 +84,15 @@ import (
8584
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
8685

8786
appparams "github.com/cosmos/cosmos-sdk/simapp/params"
88-
"github.com/cosmos/ibc-go/modules/apps/transfer"
89-
ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper"
90-
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
91-
ibc "github.com/cosmos/ibc-go/modules/core"
92-
ibcclient "github.com/cosmos/ibc-go/modules/core/02-client"
93-
ibcclientclient "github.com/cosmos/ibc-go/modules/core/02-client/client"
94-
porttypes "github.com/cosmos/ibc-go/modules/core/05-port/types"
95-
ibchost "github.com/cosmos/ibc-go/modules/core/24-host"
96-
ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper"
97-
ibckeeperv2 "github.com/cosmos/ibc-go/v2/modules/core/keeper"
87+
"github.com/cosmos/ibc-go/v2/modules/apps/transfer"
88+
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
89+
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
90+
ibc "github.com/cosmos/ibc-go/v2/modules/core"
91+
ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client"
92+
ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client"
93+
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
94+
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
95+
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"
9896
tmjson "github.com/tendermint/tendermint/libs/json"
9997

10098
evmante "github.com/tharsis/ethermint/app/ante"
@@ -399,7 +397,7 @@ func New(
399397
keys[cronostypes.MemStoreKey],
400398
app.GetSubspace(cronostypes.ModuleName),
401399
app.BankKeeper,
402-
app.TransferKeeper,
400+
nil,
403401
app.EvmKeeper,
404402
)
405403
cronosModule := cronos.NewAppModule(appCodec, app.CronosKeeper)
@@ -414,7 +412,6 @@ func New(
414412
AddRoute(cronostypes.RouterKey, cronos.NewTokenMappingChangeProposalHandler(app.CronosKeeper))
415413

416414
// Set IBC hooks
417-
app.TransferKeeper = *app.TransferKeeper.SetHooks(app.CronosKeeper)
418415
transferModule := transfer.NewAppModule(app.TransferKeeper)
419416

420417
app.GovKeeper = govkeeper.NewKeeper(
@@ -569,12 +566,9 @@ func New(
569566

570567
// use Ethermint's custom AnteHandler
571568
// TODO remove
572-
ibcKeeperv2 := ibckeeperv2.NewKeeper(
573-
appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper,
574-
)
575569
app.SetAnteHandler(
576570
evmante.NewAnteHandler(
577-
app.AccountKeeper, app.BankKeeper, app.EvmKeeper, app.FeeGrantKeeper, ibcKeeperv2.ChannelKeeper,
571+
app.AccountKeeper, app.BankKeeper, app.EvmKeeper, app.FeeGrantKeeper, app.IBCKeeper.ChannelKeeper,
578572
app.FeeMarketKeeper,
579573
encodingConfig.TxConfig.SignModeHandler(),
580574
),

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.17
55
require (
66
github.com/armon/go-metrics v0.3.9
77
github.com/cosmos/cosmos-sdk v0.44.3
8-
github.com/cosmos/ibc-go v1.2.2
8+
github.com/cosmos/ibc-go/v2 v2.0.0-rc0
99
github.com/ethereum/go-ethereum v1.10.11
1010
github.com/gogo/protobuf v1.3.3
1111
github.com/golang/protobuf v1.5.2
@@ -154,9 +154,6 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp
154154
// TODO: fix keyring upstream
155155
replace github.com/99designs/keyring => github.com/crypto-org-chain/keyring v1.1.6-fixes
156156

157-
// TODO: remove when middleware will be implemented
158-
replace github.com/cosmos/ibc-go => github.com/crypto-org-chain/ibc-go v1.2.1-hooks
159-
160157
replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.17.1
161158

162159
// TODO: remove when ibc-go and ethermint upgrades cosmos-sdk

x/cronos/keeper/ibc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/cosmos/cosmos-sdk/telemetry"
1111
sdk "github.com/cosmos/cosmos-sdk/types"
1212
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
13-
ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
14-
ibcclienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
13+
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
14+
ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"
1515
"github.com/crypto-org-chain/cronos/x/cronos/types"
1616
)
1717

x/cronos/keeper/ibc_hooks.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ import (
44
"fmt"
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
7-
"github.com/cosmos/ibc-go/modules/apps/transfer/types"
87
)
98

10-
var _ types.TransferHooks = Keeper{}
119

1210
func (k Keeper) AfterSendTransfer(
1311
ctx sdk.Context,

x/cronos/keeper/params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
sdk "github.com/cosmos/cosmos-sdk/types"
77
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
8-
transferTypes "github.com/cosmos/ibc-go/modules/apps/transfer/types"
8+
transferTypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
99
"github.com/crypto-org-chain/cronos/x/cronos/types"
1010
evmTypes "github.com/tharsis/ethermint/x/evm/types"
1111
)

x/cronos/types/interfaces.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package types
33
import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
55
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
6-
"github.com/cosmos/ibc-go/modules/apps/transfer/types"
7-
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
6+
"github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
7+
clienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"
88
"github.com/ethereum/go-ethereum/common"
99
tmbytes "github.com/tendermint/tendermint/libs/bytes"
1010
)

0 commit comments

Comments
 (0)