Skip to content

Commit 8d27a55

Browse files
committed
feat: upgrade wasm to v0.27
This address CWA-4 and force an upgrade of IBC module to v3
1 parent 0c2df0c commit 8d27a55

File tree

4 files changed

+87
-95
lines changed

4 files changed

+87
-95
lines changed

app/ante.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
sdk "github.com/cosmos/cosmos-sdk/types"
55
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
66
"github.com/cosmos/cosmos-sdk/x/auth/ante"
7-
channelkeeper "github.com/cosmos/ibc-go/v2/modules/core/04-channel/keeper"
8-
ibcante "github.com/cosmos/ibc-go/v2/modules/core/ante"
7+
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
8+
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
99

1010
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
1111
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
@@ -16,7 +16,7 @@ import (
1616
type HandlerOptions struct {
1717
ante.HandlerOptions
1818

19-
IBCChannelkeeper channelkeeper.Keeper
19+
IBCKeeper *ibckeeper.Keeper
2020
WasmConfig *wasmTypes.WasmConfig
2121
TXCounterStoreKey sdk.StoreKey
2222
}
@@ -60,7 +60,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
6060
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
6161
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
6262
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
63-
ibcante.NewAnteDecorator(options.IBCChannelkeeper),
63+
ibcante.NewAnteDecorator(options.IBCKeeper),
6464
}
6565

6666
return sdk.ChainAnteDecorators(anteDecorators...), nil

app/app.go

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,16 @@ import (
8080
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
8181
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
8282
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
83-
transfer "github.com/cosmos/ibc-go/v2/modules/apps/transfer"
84-
ibctransferkeeper "github.com/cosmos/ibc-go/v2/modules/apps/transfer/keeper"
85-
ibctransfertypes "github.com/cosmos/ibc-go/v2/modules/apps/transfer/types"
86-
ibc "github.com/cosmos/ibc-go/v2/modules/core"
87-
ibcclient "github.com/cosmos/ibc-go/v2/modules/core/02-client"
88-
ibcclientclient "github.com/cosmos/ibc-go/v2/modules/core/02-client/client"
89-
ibcclienttypes "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"
90-
porttypes "github.com/cosmos/ibc-go/v2/modules/core/05-port/types"
91-
ibchost "github.com/cosmos/ibc-go/v2/modules/core/24-host"
92-
ibckeeper "github.com/cosmos/ibc-go/v2/modules/core/keeper"
93-
83+
transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer"
84+
ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper"
85+
ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"
86+
ibc "github.com/cosmos/ibc-go/v3/modules/core"
87+
ibcclient "github.com/cosmos/ibc-go/v3/modules/core/02-client"
88+
ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client"
89+
ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
90+
porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types"
91+
ibchost "github.com/cosmos/ibc-go/v3/modules/core/24-host"
92+
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
9493
abci "github.com/tendermint/tendermint/abci/types"
9594
tmjson "github.com/tendermint/tendermint/libs/json"
9695
"github.com/tendermint/tendermint/libs/log"
@@ -365,11 +364,18 @@ func New(
365364

366365
// Create Transfer Keepers
367366
app.TransferKeeper = ibctransferkeeper.NewKeeper(
368-
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
369-
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
370-
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper,
367+
appCodec,
368+
keys[ibctransfertypes.StoreKey],
369+
app.GetSubspace(ibctransfertypes.ModuleName),
370+
app.IBCKeeper.ChannelKeeper,
371+
app.IBCKeeper.ChannelKeeper,
372+
&app.IBCKeeper.PortKeeper,
373+
app.AccountKeeper,
374+
app.BankKeeper,
375+
scopedTransferKeeper,
371376
)
372377
transferModule := transfer.NewAppModule(app.TransferKeeper)
378+
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)
373379

374380
// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
375381
evidenceKeeper := evidencekeeper.NewKeeper(
@@ -410,7 +416,12 @@ func New(
410416

411417
// Create static IBC router, add transfer route, then set and seal it
412418
ibcRouter := porttypes.NewRouter()
413-
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule)
419+
if len(enabledProposals) != 0 {
420+
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals))
421+
}
422+
ibcRouter.
423+
AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper)).
424+
AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
414425
app.IBCKeeper.SetRouter(ibcRouter)
415426

416427
/**** Module Options ****/
@@ -443,7 +454,7 @@ func New(
443454
ibc.NewAppModule(app.IBCKeeper),
444455
params.NewAppModule(app.ParamsKeeper),
445456
transferModule,
446-
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
457+
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
447458
)
448459

449460
// During begin block slashing happens after distribution.BeginBlocker so that
@@ -543,7 +554,7 @@ func New(
543554
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
544555
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
545556
},
546-
IBCChannelkeeper: app.IBCKeeper.ChannelKeeper,
557+
IBCKeeper: app.IBCKeeper,
547558
WasmConfig: &wasmConfig,
548559
TXCounterStoreKey: keys[wasm.StoreKey],
549560
},

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module github.com/fetchai/fetchd
33
go 1.17
44

55
require (
6-
github.com/CosmWasm/wasmd v0.26.0
6+
github.com/CosmWasm/wasmd v0.27.0
77
github.com/cosmos/cosmos-sdk v0.45.4
8-
github.com/cosmos/ibc-go/v2 v2.2.0
8+
github.com/cosmos/ibc-go/v3 v3.1.0
99
github.com/gorilla/mux v1.8.0
1010
github.com/prometheus/client_golang v1.12.1
1111
github.com/rakyll/statik v0.1.7
@@ -19,7 +19,7 @@ require (
1919
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
2020
github.com/99designs/keyring v1.1.6 // indirect
2121
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
22-
github.com/CosmWasm/wasmvm v1.0.0-beta10 // indirect
22+
github.com/CosmWasm/wasmvm v1.0.0 // indirect
2323
github.com/DataDog/zstd v1.4.5 // indirect
2424
github.com/Workiva/go-datastructures v1.0.53 // indirect
2525
github.com/armon/go-metrics v0.3.10 // indirect
@@ -55,7 +55,6 @@ require (
5555
github.com/golang/protobuf v1.5.2 // indirect
5656
github.com/golang/snappy v0.0.3 // indirect
5757
github.com/google/btree v1.0.0 // indirect
58-
github.com/google/go-cmp v0.5.7 // indirect
5958
github.com/google/gofuzz v1.2.0 // indirect
6059
github.com/google/orderedcode v0.0.1 // indirect
6160
github.com/gorilla/handlers v1.5.1 // indirect
@@ -76,7 +75,7 @@ require (
7675
github.com/klauspost/compress v1.13.6 // indirect
7776
github.com/lib/pq v1.10.4 // indirect
7877
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
79-
github.com/magiconair/properties v1.8.5 // indirect
78+
github.com/magiconair/properties v1.8.6 // indirect
8079
github.com/mattn/go-isatty v0.0.14 // indirect
8180
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
8281
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
@@ -85,6 +84,7 @@ require (
8584
github.com/mitchellh/mapstructure v1.4.3 // indirect
8685
github.com/mtibben/percent v0.2.1 // indirect
8786
github.com/pelletier/go-toml v1.9.4 // indirect
87+
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
8888
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
8989
github.com/pkg/errors v0.9.1 // indirect
9090
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -96,10 +96,10 @@ require (
9696
github.com/rs/cors v1.8.2 // indirect
9797
github.com/rs/zerolog v1.26.0 // indirect
9898
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
99-
github.com/spf13/afero v1.6.0 // indirect
99+
github.com/spf13/afero v1.8.2 // indirect
100100
github.com/spf13/jwalterweatherman v1.1.0 // indirect
101101
github.com/spf13/pflag v1.0.5 // indirect
102-
github.com/spf13/viper v1.10.1 // indirect
102+
github.com/spf13/viper v1.11.0 // indirect
103103
github.com/stretchr/testify v1.7.1 // indirect
104104
github.com/subosito/gotenv v1.2.0 // indirect
105105
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
@@ -108,15 +108,15 @@ require (
108108
github.com/tendermint/go-amino v0.16.0 // indirect
109109
github.com/zondax/hid v0.9.0 // indirect
110110
go.etcd.io/bbolt v1.3.6 // indirect
111-
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
112-
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
113-
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
111+
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
112+
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
113+
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
114114
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
115115
golang.org/x/text v0.3.7 // indirect
116-
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a // indirect
116+
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
117117
google.golang.org/grpc v1.45.0 // indirect
118-
google.golang.org/protobuf v1.27.1 // indirect
119-
gopkg.in/ini.v1 v1.66.2 // indirect
118+
google.golang.org/protobuf v1.28.0 // indirect
119+
gopkg.in/ini.v1 v1.66.4 // indirect
120120
gopkg.in/yaml.v2 v2.4.0 // indirect
121121
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
122122
nhooyr.io/websocket v1.8.6 // indirect

0 commit comments

Comments
 (0)