From 7694d855a7fa52a279a3774b3246501fef95d1fc Mon Sep 17 00:00:00 2001 From: tarumi Date: Wed, 15 Nov 2023 14:24:21 +0100 Subject: [PATCH] upgrade cosmwasm --- app/app.go | 32 -------------------------------- app/test_helpers.go | 3 +-- cmd/myceld/cmd/root.go | 2 -- docs/static/openapi.yml | 23 +++++++++++++++++++++++ go.mod | 6 +++--- go.sum | 12 ++++++------ testutil/network/network.go | 2 -- 7 files changed, 33 insertions(+), 47 deletions(-) diff --git a/app/app.go b/app/app.go index f021f88b..a0d2a041 100644 --- a/app/app.go +++ b/app/app.go @@ -141,14 +141,6 @@ const ( MycelExponent = 6 DefaultBondDenom = BaseCoinUnit - - // If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals. - // If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals. - ProposalsEnabled = "false" - // If set to non-empty string it must be comma-separated list of values that are all a subset - // of "EnableAllProposals" (takes precedence over ProposalsEnabled) - // https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 - EnableSpecificProposals = "" ) // RegisterDenoms registers token denoms. @@ -181,22 +173,6 @@ func getGovProposalHandlers() []govclient.ProposalHandler { return govProposalHandlers } -// produce a list of enabled proposals to pass into wasmd app. -func GetEnabledProposals() []wasmtypes.ProposalType { - if EnableSpecificProposals == "" { - if ProposalsEnabled == "true" { - return wasmtypes.EnableAllProposals - } - return wasmtypes.DisableAllProposals - } - chunks := strings.Split(EnableSpecificProposals, ",") - proposals, err := wasmtypes.ConvertToProposals(chunks) - if err != nil { - panic(err) - } - return proposals -} - var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string @@ -343,7 +319,6 @@ func New( homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, - enabledProposals []wasmtypes.ProposalType, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), @@ -358,7 +333,6 @@ func New( invCheckPeriod, encodingConfig, appOpts, - enabledProposals, wasmOpts, baseAppOptions..., ) @@ -374,7 +348,6 @@ func NewApp( invCheckPeriod uint, encodingConfig appparams.EncodingConfig, appOpts servertypes.AppOptions, - enabledProposals []wasmtypes.ProposalType, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), @@ -659,11 +632,6 @@ func NewApp( authtypes.NewModuleAddress(govtypes.ModuleName).String(), wasmOpts..., ) - // The gov proposal types can be individually enabled - if len(enabledProposals) != 0 { - govRouter.AddRoute(wasmtypes.RouterKey, wasmkeeper.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) //nolint:staticcheck - } - govKeeper.SetLegacyRouter(govRouter) app.GovKeeper = *govKeeper.SetHooks( diff --git a/app/test_helpers.go b/app/test_helpers.go index c196fba6..89c88e1e 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -6,7 +6,6 @@ import ( "cosmossdk.io/math" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" @@ -40,7 +39,7 @@ func setup(withGenesis bool, invCheckPeriod uint, wasmOpt ...wasmkeeper.Option) appOptions[server.FlagInvCheckPeriod] = invCheckPeriod encCdc := MakeEncodingConfig() - app := NewApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, invCheckPeriod, encCdc, EmptyAppOptions{}, wasmtypes.EnableAllProposals, wasmOpt) + app := NewApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, invCheckPeriod, encCdc, EmptyAppOptions{}, wasmOpt) if withGenesis { return app, app.DefaultGenesis() } diff --git a/cmd/myceld/cmd/root.go b/cmd/myceld/cmd/root.go index 18e9d4cb..18f749c2 100644 --- a/cmd/myceld/cmd/root.go +++ b/cmd/myceld/cmd/root.go @@ -311,7 +311,6 @@ func (a appCreator) newApp( cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), a.encodingConfig, - app.GetEnabledProposals(), appOpts, wasmOpts, baseapp.SetPruning(pruningOpts), @@ -354,7 +353,6 @@ func (a appCreator) appExport( homePath, uint(1), a.encodingConfig, - app.GetEnabledProposals(), appOpts, emptyWasmOpts, ) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 648553c8..83054029 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -75601,6 +75601,26 @@ definitions: for executing a MsgStoreAndInstantiateContract message. Since: 0.40 + cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse: + type: object + properties: + code_id: + type: string + format: uint64 + title: CodeID is the reference to the stored WASM code + checksum: + type: string + format: byte + title: Checksum is the sha256 hash of the stored code + data: + type: string + format: byte + title: Data contains bytes to returned from the contract + description: |- + MsgStoreAndMigrateContractResponse defines the response structure + for executing a MsgStoreAndMigrateContract message. + + Since: 0.42 cosmwasm.wasm.v1.MsgStoreCodeResponse: type: object properties: @@ -75635,6 +75655,9 @@ definitions: cosmwasm.wasm.v1.MsgUpdateAdminResponse: type: object title: MsgUpdateAdminResponse returns empty data + cosmwasm.wasm.v1.MsgUpdateContractLabelResponse: + type: object + title: MsgUpdateContractLabelResponse returns empty data cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse: type: object title: MsgUpdateInstantiateConfigResponse returns empty data diff --git a/go.mod b/go.mod index 79449af7..8ad99f3a 100644 --- a/go.mod +++ b/go.mod @@ -7,14 +7,14 @@ require ( cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.2.0 filippo.io/edwards25519 v1.0.0 - github.com/CosmWasm/wasmd v0.41.0 + github.com/CosmWasm/wasmd v0.44.0 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-proto v1.0.0-beta.2 github.com/cosmos/cosmos-sdk v0.47.6 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/cosmos/ibc-go/v7 v7.3.0 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -44,7 +44,7 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/CosmWasm/wasmvm v1.3.0 // indirect + github.com/CosmWasm/wasmvm v1.5.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/go.sum b/go.sum index 49d583d4..a38d9776 100644 --- a/go.sum +++ b/go.sum @@ -224,10 +224,10 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 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.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/CosmWasm/wasmd v0.44.0 h1:2sbcoCAvfjCs1O0SWt53xULKjkV06dbSFthEViIC6Zg= +github.com/CosmWasm/wasmd v0.44.0/go.mod h1:tDyYN050qUcdd7LOxGeo2e185sEShyO3nJGl2Cf59+k= +github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw= +github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -408,8 +408,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.2.0 h1:dx0DLUl7rxdyZ8NiT6UsrbzKOJx/w7s+BOaewFRH6cg= -github.com/cosmos/ibc-go/v7 v7.2.0/go.mod h1:OOcjKIRku/j1Xs1RgKK0yvKRrJ5iFuZYMetR1n3yMlc= +github.com/cosmos/ibc-go/v7 v7.3.0 h1:QtGeVMi/3JeLWuvEuC60sBHpAF40Oenx/y+bP8+wRRw= +github.com/cosmos/ibc-go/v7 v7.3.0/go.mod h1:mUmaHFXpXrEdcxfdXyau+utZf14pGKVUiXwYftRZZfQ= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= diff --git a/testutil/network/network.go b/testutil/network/network.go index 857253e8..cd3cafa0 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -6,7 +6,6 @@ import ( "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" tmdb "github.com/cometbft/cometbft-db" tmrand "github.com/cometbft/cometbft/libs/rand" "github.com/cosmos/cosmos-sdk/baseapp" @@ -74,7 +73,6 @@ func DefaultConfig() network.Config { val.GetCtx().Config.RootDir, 0, encoding, - wasmtypes.EnableAllProposals, simtestutil.EmptyAppOptions{}, wasmOpt, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),