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

build(deps)!: bump wasmd to 0.41.0 from 0.40.0 #1209

Merged
merged 3 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
22 changes: 8 additions & 14 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ type DesmosApp struct {
FeeGrantKeeper feegrantkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper

WasmKeeper wasm.Keeper
WasmKeeper wasmkeeper.Keeper

// IBC modules
TransferKeeper ibctransferkeeper.Keeper
Expand Down Expand Up @@ -179,8 +179,7 @@ type DesmosApp struct {

func NewDesmosApp(
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
appOpts servertypes.AppOptions, wasmEnabledProposals []wasm.ProposalType,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove wasmEnabledProposals since it is unused in the latest wasmd.

baseAppOptions ...func(*baseapp.BaseApp),
appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
) *DesmosApp {
var (
app = &DesmosApp{}
Expand Down Expand Up @@ -306,7 +305,7 @@ func NewDesmosApp(
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedIBCTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedProfilesKeeper := app.CapabilityKeeper.ScopeToModule(profilestypes.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName)
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)

Expand Down Expand Up @@ -401,10 +400,10 @@ func NewDesmosApp(
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
// See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md
availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2"
app.WasmKeeper = wasm.NewKeeper(
availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3"
app.WasmKeeper = wasmkeeper.NewKeeper(
app.appCodec,
app.GetKey(wasm.StoreKey),
app.GetKey(wasmtypes.StoreKey),
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
Expand All @@ -423,11 +422,6 @@ func NewDesmosApp(
wasmOpts...,
)

// The gov proposal types can be individually enabled
if len(wasmEnabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals))
}
Comment on lines -426 to -429
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it since WasmProposalHandler was deprecated, now using gov1 to handle proposals. See:
https://github.com/CosmWasm/wasmd/blob/33df4aeaaa419f6aad07b94d64c0423bee0a2d21/x/wasm/keeper/proposal_handler.go#L19
CosmWasm/wasmd#1246


// Set legacy router for backwards compatibility with gov v1beta1
app.GovKeeper.SetLegacyRouter(govRouter)

Expand All @@ -451,7 +445,7 @@ func NewDesmosApp(
ibcRouter := porttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(profilestypes.ModuleName, profilesIBCModule).
AddRoute(wasm.ModuleName, wasmIBCModule).
AddRoute(wasmtypes.ModuleName, wasmIBCModule).
AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)

Expand Down Expand Up @@ -511,7 +505,7 @@ func NewDesmosApp(
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
IBCkeeper: app.IBCKeeper,
TxCounterStoreKey: app.GetKey(wasm.StoreKey),
TxCounterStoreKey: app.GetKey(wasmtypes.StoreKey),
WasmConfig: &wasmConfig,
SubspacesKeeper: *app.SubspacesKeeper,
},
Expand Down
15 changes: 8 additions & 7 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import (

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)

const (
Expand All @@ -122,8 +123,8 @@ func GetWasmOpts(
postsKeeper postskeeper.Keeper,
reportsKeeper reportskeeper.Keeper,
reactionsKeeper reactionskeeper.Keeper,
) []wasm.Option {
var wasmOpts []wasm.Option
) []wasmkeeper.Option {
var wasmOpts []wasmkeeper.Option
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
}
Expand Down Expand Up @@ -209,7 +210,7 @@ var (
{Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, authtypes.Staking}},
{Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
{Account: wasm.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: wasmtypes.ModuleName, Permissions: []string{authtypes.Burner}},
{Account: ibcfeetypes.ModuleName},
{Account: icatypes.ModuleName},
{Account: tokenfactorytypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
Expand Down Expand Up @@ -255,7 +256,7 @@ var (
supplytypes.ModuleName,
tokenfactorytypes.ModuleName,

wasm.ModuleName,
wasmtypes.ModuleName,
}

endBlockerOrder = []string{
Expand Down Expand Up @@ -293,7 +294,7 @@ var (
supplytypes.ModuleName,
tokenfactorytypes.ModuleName,

wasm.ModuleName,
wasmtypes.ModuleName,
}

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -339,7 +340,7 @@ var (
tokenfactorytypes.ModuleName,

// wasm module should be at the end of app modules
wasm.ModuleName,
wasmtypes.ModuleName,
crisistypes.ModuleName,
}

Expand Down Expand Up @@ -380,7 +381,7 @@ var (
supplytypes.ModuleName,
tokenfactorytypes.ModuleName,

wasm.ModuleName,
wasmtypes.ModuleName,
crisistypes.ModuleName,
}
)
Expand Down
6 changes: 2 additions & 4 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

"github.com/CosmWasm/wasmd/x/wasm"
)

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
db := dbm.NewMemDB()
app := NewDesmosApp(
log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true,
simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), wasm.EnableAllProposals,
simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
)

privVal := mock.NewPV()
Expand Down Expand Up @@ -79,7 +77,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {

// Making a new app object with the db, so that initchain hasn't been called
app2 := NewDesmosApp(
log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), wasm.EnableAllProposals,
log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
)
_, err = app2.ExportAppStateAndValidators(false, []string{}, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
Expand Down
3 changes: 0 additions & 3 deletions app/desmos/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"

simappparams "cosmossdk.io/simapp/params"
"github.com/CosmWasm/wasmd/x/wasm"
serverconfig "github.com/cosmos/cosmos-sdk/server/config"

"github.com/cosmos/cosmos-sdk/client/config"
Expand Down Expand Up @@ -257,7 +256,6 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty
return app.NewDesmosApp(
logger, db, traceStore, true,
appOpts,
wasm.DisableAllProposals,
server.DefaultBaseappOptions(appOpts)...,
)
}
Expand Down Expand Up @@ -292,7 +290,6 @@ func createDesmosappAndExport(
desmosApp = app.NewDesmosApp(
logger, db, traceStore, height == -1,
appOpts,
wasm.DisableAllProposals,
)

if height != -1 {
Expand Down
13 changes: 6 additions & 7 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

profilestypes "github.com/desmos-labs/desmos/v5/x/profiles/types"

"github.com/CosmWasm/wasmd/x/wasm"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -105,7 +104,7 @@ func TestFullAppSimulation(t *testing.T) {
appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue

app := NewDesmosApp(
logger, db, nil, true, appOptions, wasm.EnableAllProposals, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
)
require.Equal(t, appName, app.Name())

Expand Down Expand Up @@ -152,7 +151,7 @@ func TestAppImportExport(t *testing.T) {
appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue

app := NewDesmosApp(
logger, db, nil, true, appOptions, wasm.EnableAllProposals, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
)
require.Equal(t, appName, app.Name())

Expand Down Expand Up @@ -205,7 +204,7 @@ func TestAppImportExport(t *testing.T) {
}()

newApp := NewDesmosApp(
log.NewNopLogger(), newDB, nil, true, appOptions, wasm.EnableAllProposals, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
)
require.Equal(t, appName, newApp.Name())

Expand Down Expand Up @@ -296,7 +295,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue

app := NewDesmosApp(
logger, db, nil, true, appOptions, wasm.EnableAllProposals, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
)
require.Equal(t, appName, app.Name())

Expand Down Expand Up @@ -343,7 +342,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
}()

newApp := NewDesmosApp(
log.NewNopLogger(), newDB, nil, true, appOptions, wasm.EnableAllProposals, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(SimAppChainID),
)
require.Equal(t, appName, newApp.Name())

Expand Down Expand Up @@ -402,7 +401,7 @@ func TestAppStateDeterminism(t *testing.T) {
db := dbm.NewMemDB()

app := NewDesmosApp(
logger, db, nil, true, appOptions, wasm.EnableAllProposals, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID),
logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(SimAppChainID),
)

fmt.Printf(
Expand Down
13 changes: 6 additions & 7 deletions app/wasm_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app
import (
"fmt"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -34,7 +33,7 @@ import (
subspacestypes "github.com/desmos-labs/desmos/v5/x/subspaces/types"
subspaceswasm "github.com/desmos-labs/desmos/v5/x/subspaces/wasm"

wasmtypes "github.com/desmos-labs/desmos/v5/x/wasm/types"
desmoswasmtypes "github.com/desmos-labs/desmos/v5/x/wasm/types"
)

const (
Expand Down Expand Up @@ -67,7 +66,7 @@ func NewDesmosCustomQueryPlugin(
postsKeeper postskeeper.Keeper,
reportsKeeper reportskeeper.Keeper,
reactionsKeeper reactionskeeper.Keeper,
) wasm.QueryPlugins {
) wasmkeeper.QueryPlugins {
queriers := map[string]wasmdesmos.Querier{
wasmdesmos.QueryRouteProfiles: profileswasm.NewProfilesWasmQuerier(profilesKeeper, cdc),
wasmdesmos.QueryRouteSubspaces: subspaceswasm.NewSubspacesWasmQuerier(subspacesKeeper, cdc),
Expand All @@ -85,8 +84,8 @@ func NewDesmosCustomQueryPlugin(
panic(fmt.Errorf("codec must be *codec.ProtoCodec type: actual: %T", cdc))
}

stargateCdc := codec.NewProtoCodec(wasmtypes.NewWasmInterfaceRegistry(protoCdc.InterfaceRegistry()))
return wasm.QueryPlugins{
stargateCdc := codec.NewProtoCodec(desmoswasmtypes.NewWasmInterfaceRegistry(protoCdc.InterfaceRegistry()))
return wasmkeeper.QueryPlugins{
Stargate: wasmkeeper.AcceptListStargateQuerier(GetStargateAcceptedQueries(), grpcQueryRouter, stargateCdc),
Custom: querier.QueryCustom,
}
Expand Down Expand Up @@ -146,7 +145,7 @@ func GetStargateAcceptedQueries() wasmkeeper.AcceptedStargateQueries {
}

// NewDesmosCustomMessageEncoder initialize the custom message encoder to desmos app for contracts
func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasm.MessageEncoders {
func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasmkeeper.MessageEncoders {
// Initialization of custom Desmos messages for contracts
parserRouter := wasmdesmos.NewParserRouter()
parsers := map[string]wasmdesmos.MsgParserInterface{
Expand All @@ -160,7 +159,7 @@ func NewDesmosCustomMessageEncoder(cdc codec.Codec) wasm.MessageEncoders {
}

parserRouter.Parsers = parsers
return wasm.MessageEncoders{
return wasmkeeper.MessageEncoders{
Custom: parserRouter.ParseCustom,
}
}
4 changes: 2 additions & 2 deletions cosmwasm/msg_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"

"cosmossdk.io/errors"
"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

Expand Down Expand Up @@ -81,5 +81,5 @@ func (router ParserRouter) ParseCustom(contractAddr sdk.AccAddress, data json.Ra
if parser, ok := router.Parsers[route]; ok {
return parser.ParseCustomMsgs(contractAddr, msg)
}
return nil, errors.Wrap(wasm.ErrInvalidMsg, "unimplemented route")
return nil, errors.Wrap(wasmtypes.ErrInvalidMsg, "unimplemented route")
}
4 changes: 2 additions & 2 deletions cosmwasm/query_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"

"cosmossdk.io/errors"
"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

Expand Down Expand Up @@ -81,5 +81,5 @@ func (q QuerierRouter) QueryCustom(ctx sdk.Context, data json.RawMessage) ([]byt
if querier, ok := q.Queriers[route]; ok {
return querier.QueryCustom(ctx, query)
}
return nil, errors.Wrap(wasm.ErrQueryFailed, "unimplemented route")
return nil, errors.Wrap(wasmtypes.ErrQueryFailed, "unimplemented route")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.0.1
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721ff
github.com/CosmWasm/wasmd v0.40.0
github.com/CosmWasm/wasmd v0.41.0
github.com/CosmWasm/wasmvm v1.3.0
github.com/armon/go-metrics v0.4.1
github.com/btcsuite/btcd/btcec/v2 v2.3.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmd v0.40.0 h1:3Vvq1m8dPQdvZR+QJc86VIx6QoWAEVnuHxqBPshJvyo=
github.com/CosmWasm/wasmd v0.40.0/go.mod h1:SuxskRBB7+bpwXGhUXaEfdpjg5WKpdxBy7Tm36VRMUU=
github.com/CosmWasm/wasmd v0.41.0 h1:fmwxSbwb50zZDcBaayYFRLIaSFca+EFld1WOaQi49jg=
github.com/CosmWasm/wasmd v0.41.0/go.mod h1:0Sds1q2IsPaTN1gHa3BNOYcUFgtGvxH7CXEXPgoihns=
github.com/CosmWasm/wasmvm v1.3.0 h1:x12X4bKlUPS7TT9QQP45+fJo2sp30GEbiSSgb9jsec8=
github.com/CosmWasm/wasmvm v1.3.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
Expand Down
3 changes: 1 addition & 2 deletions testutil/ibctesting/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
Expand Down Expand Up @@ -34,7 +33,7 @@ func setup(chainID string, withGenesis bool, invCheckPeriod uint) (*simapp.Desmo
appOptions[flags.FlagHome] = simapp.DefaultNodeHome // ensure unique folder
appOptions[server.FlagInvCheckPeriod] = invCheckPeriod

app := simapp.NewDesmosApp(log.NewNopLogger(), db, nil, true, appOptions, wasm.DisableAllProposals, baseapp.SetChainID(chainID))
app := simapp.NewDesmosApp(log.NewNopLogger(), db, nil, true, appOptions, baseapp.SetChainID(chainID))
if withGenesis {
return app, simapp.NewDefaultGenesisState(app.AppCodec())
}
Expand Down
2 changes: 0 additions & 2 deletions testutil/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"time"

"github.com/CosmWasm/wasmd/x/wasm"
dbm "github.com/cometbft/cometbft-db"
tmrand "github.com/cometbft/cometbft/libs/rand"
"github.com/cosmos/cosmos-sdk/baseapp"
Expand All @@ -27,7 +26,6 @@ func NewAppConstructor() network.AppConstructor {
return app.NewDesmosApp(
val.GetCtx().Logger, dbm.NewMemDB(), nil, true,
simtestutil.NewAppOptionsWithFlagHome(val.GetCtx().Config.RootDir),
wasm.DisableAllProposals,
baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),
baseapp.SetMinGasPrices(val.GetAppConfig().MinGasPrices),
baseapp.SetChainID(val.GetCtx().Viper.GetString(flags.FlagChainID)),
Expand Down
Loading
Loading