Skip to content

Commit 60fec8a

Browse files
authored
feat: separate custom features in x/wasm into x/wasmplus module (CosmWasm#7)
* featremove custom proto changes of genesis and types * feat!: extract custom wasm logic for lbm-sdk * feat: move custom cli of lbm-sdk to `wasmplus` client package * feat: remove params for wasmplus. just use original params of x/wasm * chore: remove unused customEncoding and customQuerier * chore: apply a changes about separated ibc-go import path * doc: add readme of `x/wasmplus` * fix: lint error * chore: add more unittest * chore: add more unittest * chore: add more unittest * chore: add more unittest * chore: update changelog * chore: remove interchain-accounts * chore: feedback reviews * doc: update proto changes * chore: apply review feedback - move all function of `wasmplus/keeper/keeper_extension.go` to `wasmplus/keeper/keeper.go` - remove no need files (keeper_extension.go, metrics.go)
1 parent 51dd725 commit 60fec8a

File tree

137 files changed

+8055
-2594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+8055
-2594
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Improvements
66
* [\#1](https://github.com/line/wasmd/pull/1) apply all changes of `x/wasm` in lbm-sdk until [lbm-sdk@3bdcb6ffe01c81615bedb777ca0e039cc46ef00c](https://github.com/line/lbm-sdk/tree/3bdcb6ffe01c81615bedb777ca0e039cc46ef00c)
77
* [\#5](https://github.com/line/wasmd/pull/5) bump up wasmd v0.29.1
8+
* [\#7](https://github.com/line/wasmd/pull/7) separate custom features in `x/wasm` into `x/wasmplus` module
89

910
### Bug Fixes
1011

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ build: go.sum
8282
ifeq ($(OS),Windows_NT)
8383
exit 1
8484
else
85-
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmd
85+
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmplusd
8686
endif
8787

8888
build-contract-tests-hooks:
@@ -93,7 +93,8 @@ else
9393
endif
9494

9595
install: go.sum
96-
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmd
96+
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmplusd
97+
mv $(BINDIR)/wasmplusd $(BINDIR)/wasmd
9798

9899
########################################
99100
### Tools & dependencies

app/app.go

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"path/filepath"
99
"strings"
1010

11-
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
1211
"github.com/gorilla/mux"
1312
"github.com/rakyll/statik/fs"
1413
"github.com/spf13/cast"
@@ -203,7 +202,6 @@ var (
203202
vesting.AppModuleBasic{},
204203
wasm.AppModuleBasic{},
205204
ica.AppModuleBasic{},
206-
// intertx.AppModuleBasic{}, // TODO support later
207205
)
208206

209207
// module account permissions
@@ -262,16 +260,14 @@ type WasmApp struct {
262260
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
263261
ICAControllerKeeper icacontrollerkeeper.Keeper
264262
ICAHostKeeper icahostkeeper.Keeper
265-
// InterTxKeeper intertxkeeper.Keeper // TODO support later
266-
TransferKeeper ibctransferkeeper.Keeper
267-
FeeGrantKeeper feegrantkeeper.Keeper
268-
AuthzKeeper authzkeeper.Keeper
269-
WasmKeeper wasm.Keeper
263+
TransferKeeper ibctransferkeeper.Keeper
264+
FeeGrantKeeper feegrantkeeper.Keeper
265+
AuthzKeeper authzkeeper.Keeper
266+
WasmKeeper wasm.Keeper
270267

271268
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
272269
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
273270
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
274-
ScopedInterTxKeeper capabilitykeeper.ScopedKeeper
275271
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
276272
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
277273

@@ -316,7 +312,7 @@ func NewWasmApp(
316312
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
317313
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
318314
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
319-
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, intertxtypes.StoreKey,
315+
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey,
320316
)
321317
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
322318
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
@@ -351,7 +347,6 @@ func NewWasmApp(
351347
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
352348
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
353349
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
354-
scopedInterTxKeeper := app.CapabilityKeeper.ScopeToModule(intertxtypes.ModuleName)
355350
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
356351
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName)
357352
app.CapabilityKeeper.Seal()
@@ -489,15 +484,6 @@ func NewWasmApp(
489484
icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper)
490485
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)
491486

492-
// For wasmd we use the demo controller from https://github.com/cosmos/interchain-accounts but see notes below
493-
// app.InterTxKeeper = intertxkeeper.NewKeeper(appCodec, keys[intertxtypes.StoreKey], app.ICAControllerKeeper, scopedInterTxKeeper)
494-
// Note: please do your research before using this in production app, this is a demo and not an officially
495-
// supported IBC team implementation. Do your own research before using it.
496-
// interTxModule := intertx.NewAppModule(appCodec, app.InterTxKeeper)
497-
// interTxIBCModule := intertx.NewIBCModule(app.InterTxKeeper)
498-
// You will likely want to swap out the second argument with your own reviewed and maintained ica auth module
499-
// icaControllerIBCModule := icacontroller.NewIBCModule(app.ICAControllerKeeper, interTxIBCModule)
500-
501487
// create evidence keeper with router
502488
evidenceKeeper := evidencekeeper.NewKeeper(
503489
appCodec,
@@ -533,8 +519,6 @@ func NewWasmApp(
533519
wasmDir,
534520
wasmConfig,
535521
availableCapabilities,
536-
nil,
537-
nil,
538522
wasmOpts...,
539523
)
540524

@@ -595,7 +579,6 @@ func NewWasmApp(
595579
params.NewAppModule(app.ParamsKeeper),
596580
transferModule,
597581
icaModule,
598-
// interTxModule,
599582
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), // always be last to make sure that it checks for all invariants and not only part of them
600583
)
601584

@@ -681,7 +664,6 @@ func NewWasmApp(
681664
ibctransfertypes.ModuleName,
682665
ibchost.ModuleName,
683666
icatypes.ModuleName,
684-
// intertxtypes.ModuleName,
685667
// wasm after ibc transfer
686668
wasm.ModuleName,
687669
)
@@ -763,7 +745,6 @@ func NewWasmApp(
763745
app.ScopedWasmKeeper = scopedWasmKeeper
764746
app.ScopedICAHostKeeper = scopedICAHostKeeper
765747
app.ScopedICAControllerKeeper = scopedICAControllerKeeper
766-
app.ScopedInterTxKeeper = scopedInterTxKeeper
767748

768749
if loadLatest {
769750
if err := app.LoadLatestVersion(); err != nil {

0 commit comments

Comments
 (0)