Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ibc-go v4 with latest neutron #60

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
"github.com/cosmos/ibc-go/v3/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
"github.com/cosmos/ibc-go/v4/modules/core/keeper"

"github.com/cosmos/cosmos-sdk/x/auth/types"
)
Expand Down
38 changes: 21 additions & 17 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

ica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v3/modules/core"
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client"
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"

"github.com/tendermint/spm/cosmoscmd"
"github.com/tendermint/spm/openapiconsole"
Expand Down Expand Up @@ -558,7 +558,7 @@ func New(
var wasmOpts []wasm.Option
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,migrate,upgrade,neutron"
supportedFeatures := "iterator,staking,stargate,migrate,upgrade,neutron,cosmwasm_1_1"
wasmOpts = append(wasmbinding.RegisterCustomPlugins(&app.InterchainTxsKeeper, &app.InterchainQueriesKeeper, app.TransferKeeper), wasmOpts...)
app.WasmKeeper = wasm.NewKeeper(
appCodec,
Expand Down Expand Up @@ -604,14 +604,18 @@ func New(
taxModule := tax.NewAppModule(appCodec, app.TaxKeeper, app.AccountKeeper, app.BankKeeper)

transferIBCModule := transferSudo.NewIBCModule(app.TransferKeeper)
icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, interchaintxs.NewIBCModule(app.InterchainTxsKeeper))

var icaControllerStack ibcporttypes.IBCModule

icaControllerStack = interchaintxs.NewIBCModule(app.InterchainTxsKeeper)
icaControllerStack = icacontroller.NewIBCMiddleware(icaControllerStack, app.ICAControllerKeeper)

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(interchaintxstypes.ModuleName, icaControllerIBCModule).
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper))
AddRoute(interchaintxstypes.ModuleName, icaControllerStack).
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper))
app.IBCKeeper.SetRouter(ibcRouter)

/**** Module Options ****/
Expand Down
8 changes: 4 additions & 4 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
icacontrollertypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"

"github.com/tendermint/spm/cosmoscmd"
"github.com/tendermint/tendermint/libs/log"
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestAppStateDeterminism(t *testing.T) {
t.Fatalf("CosmWasm module path not found: %v", err)
}

reflectContractPath := filepath.Join(pkg.Dir, "testdata/reflect.wasm")
reflectContractPath := filepath.Join(pkg.Dir, "testdata/reflect_1_1.wasm")
appParams := simtypes.AppParams{
wasmsim.OpReflectContractPath: []byte(fmt.Sprintf("\"%s\"", reflectContractPath)),
}
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ module github.com/Nolus-Protocol/nolus-core
go 1.19

require (
github.com/CosmWasm/wasmd v0.28.0
github.com/CosmWasm/wasmd v0.30.0
github.com/CosmWasm/wasmvm v1.1.1
github.com/cosmos/cosmos-sdk v0.45.11
github.com/cosmos/gogoproto v1.4.2
github.com/cosmos/ibc-go/v3 v3.4.0
github.com/cosmos/gogoproto v1.4.3
github.com/cosmos/ibc-go/v4 v4.2.0
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/neutron-org/neutron v0.1.2-0.20230118095340-1575205ad1b9
github.com/neutron-org/neutron v0.2.1-0.20230207111252-7cfba1b5dcfc
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.8.1
Expand Down Expand Up @@ -42,11 +42,10 @@ require (
github.com/cosmos/admin-module v0.0.0-00010101000000-000000000000 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect
github.com/cosmos/gaia/v8 v8.0.0-20230108202408-c3c3586e5ab8 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.4 // indirect
github.com/cosmos/interchain-security v1.0.0-rc1 // indirect
github.com/cosmos/interchain-security v1.0.0-rc3 // indirect
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
github.com/cosmos/ledger-go v0.9.3 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
Expand All @@ -56,6 +55,7 @@ require (
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
Expand All @@ -68,7 +68,7 @@ require (
github.com/golang/glog v1.0.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
Expand Down Expand Up @@ -97,15 +97,16 @@ require (
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
Expand All @@ -117,7 +118,6 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.14.0 // indirect
github.com/strangelove-ventures/packet-forward-middleware/v3 v3.0.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/btcd v0.1.1 // indirect
Expand All @@ -140,7 +140,7 @@ require (
replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

github.com/CosmWasm/wasmd v0.28.0 => github.com/neutron-org/wasmd v0.28.0-ics-support
github.com/CosmWasm/wasmd v0.30.0 => github.com/neutron-org/wasmd v0.30.0-ics-support
// For more info https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.10
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/admin-module => github.com/Ethernal-Tech/admin-module v0.0.0-20221102105340-e693f4d379c3
Expand Down
Loading