Skip to content

Commit

Permalink
Update our wasmd fork (#1948)
Browse files Browse the repository at this point in the history
* Update go.mod

* Bump wasmd fork.

* Remove todo.

* Update changelog.

* Update to provwasm that has updated AppModule constructor. Fix todos to supply the router.

* Update proposal handler to legacy one until gov changes are in.

* Update simulation for wasm.
  • Loading branch information
Taztingo authored Apr 25, 2024
1 parent 0a137dc commit b998684
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
* Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
* Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).

### Improvements

Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ func New(
govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
// AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasm.EnableAllProposals)). // TODO[1760]: wasm
AddRoute(wasm.RouterKey, wasmkeeper.NewLegacyWasmProposalHandler(app.WasmKeeper, wasmtypes.EnableAllProposals)). // TODO[1760]: gov: Can probably remove with gov v1
AddRoute(nametypes.ModuleName, name.NewProposalHandler(app.NameKeeper)).
AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper)).
AddRoute(msgfeestypes.ModuleName, msgfees.NewProposalHandler(app.MsgFeesKeeper, app.InterfaceRegistry()))
Expand Down Expand Up @@ -1016,7 +1016,7 @@ func New(
oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper, app.IBCKeeper.ChannelKeeper),
holdmodule.NewAppModule(appCodec, app.HoldKeeper),
exchangemodule.NewAppModule(appCodec, app.ExchangeKeeper),
provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, nil, app.GetSubspace(wasmtypes.ModuleName)), // TODO[1760]: Need to pass router instead of nil
provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, pioMessageRouter, app.GetSubspace(wasmtypes.ModuleName)),

// IBC
ibc.NewAppModule(app.IBCKeeper),
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ replace (
// Use cosmos fork of keyring (because the SDK does).
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// This is required for https://github.com/provenance-io/provenance/issues/1414
// TODO[1760]: wasm: Put this CosmWasm/wasmd replace back with an updated version (or delete it).
// github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.30.0-pio-5
github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-2
github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.5-pio-3

// TODO[1760]: Update once async-icq creates tag with our changes https://github.com/cosmos/ibc-apps/pull/168
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmd v0.50.0 h1:NVaGqCSTRfb9UTDHJwT6nQIWcb6VjlQl88iI+u1+qjE=
github.com/CosmWasm/wasmd v0.50.0/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk=
github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw=
github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=
github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=
Expand Down Expand Up @@ -918,6 +916,8 @@ github.com/provenance-io/cosmos-sdk v0.50.5-pio-3 h1:QwJ4feMM43a9fu2YZ1oSHd1wqEI
github.com/provenance-io/cosmos-sdk v0.50.5-pio-3/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ=
github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1 h1:p+7pxHB0ukO2aow+M6uW9gHgeQl7YJyYGyMSKHZ5My8=
github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1/go.mod h1:tObW9uxibh5Z22CtOaHVeTDotCSMyc/2B4MrYdaViBo=
github.com/provenance-io/wasmd v0.50.0-pio-2 h1:vuRXQ7NvqEk0TZ/dDFEfojMTwCn/ItVDjMe3/jiCDbY=
github.com/provenance-io/wasmd v0.50.0-pio-2/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk=
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down
10 changes: 6 additions & 4 deletions internal/provwasm/simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmsimulation "github.com/CosmWasm/wasmd/x/wasm/simulation"
"github.com/CosmWasm/wasmd/x/wasm/types"

sdkmath "cosmossdk.io/math"
Expand Down Expand Up @@ -43,15 +44,17 @@ type Wrapper struct {
ak authkeeper.AccountKeeperI
bk bankkeeper.Keeper
nk namekeeper.Keeper
wk *wasmkeeper.Keeper
}

func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource wasmkeeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, router *baseapp.MsgServiceRouter, ss exported.Subspace) *Wrapper {
func NewWrapper(cdc codec.Codec, keeper *wasmkeeper.Keeper, validatorSetSource wasmkeeper.ValidatorSetSource, ak authkeeper.AccountKeeperI, bk bankkeeper.Keeper, nk namekeeper.Keeper, router wasmkeeper.MessageRouter, ss exported.Subspace) *Wrapper {
return &Wrapper{
cdc: cdc,
wasm: wasm.NewAppModule(cdc, keeper, validatorSetSource, ak, bk, router, ss),
ak: ak,
bk: bk,
nk: nk,
wk: keeper,
}
}

Expand Down Expand Up @@ -82,9 +85,8 @@ func (pw Wrapper) GenerateGenesisState(input *module.SimulationState) {
}

// ProposalContents doesn't return any content functions for governance proposals.
func (pw Wrapper) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent {
// return pw.wasm.ProposalContents(simState) // TODO[1760]: wasm: Find replacement for this or delete it.
return nil
func (pw Wrapper) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg {
return wasmsimulation.ProposalMsgs(pw.bk, pw.wk)
}

// RandomizedParams returns empty list as the params don't change
Expand Down

0 comments on commit b998684

Please sign in to comment.