From d3d28a0d9440f89ff0b4cce17d247dc9483bc1a3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:26:11 +0200 Subject: [PATCH 01/11] Add label validation for non printable chars (#1650) (#1659) * Add label validation for non printable chars * Fix printable chars check (cherry picked from commit 1a22c29ea463adad37da5329865f83a199b237d9) Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com> --- x/wasm/types/tx_test.go | 36 ++++++++++++++++++++++++++++++++++++ x/wasm/types/validation.go | 10 ++++++++++ 2 files changed, 46 insertions(+) diff --git a/x/wasm/types/tx_test.go b/x/wasm/types/tx_test.go index 2e980fd795..52605edba1 100644 --- a/x/wasm/types/tx_test.go +++ b/x/wasm/types/tx_test.go @@ -115,6 +115,42 @@ func TestInstantiateContractValidation(t *testing.T) { }, valid: false, }, + "white space ending label": { + msg: MsgInstantiateContract{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo ", + Msg: []byte("{}"), + }, + valid: false, + }, + "non printable chars ending label": { + msg: MsgInstantiateContract{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo\v", + Msg: []byte("{}"), + }, + valid: false, + }, + "non printable chars in label": { + msg: MsgInstantiateContract{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "f\voo", + Msg: []byte("{}"), + }, + valid: false, + }, + "non printable chars beginning label": { + msg: MsgInstantiateContract{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "\vfoo", + Msg: []byte("{}"), + }, + valid: false, + }, "label too long": { msg: MsgInstantiateContract{ Sender: goodAddress, diff --git a/x/wasm/types/validation.go b/x/wasm/types/validation.go index 7282c01e1d..cbdeb77d57 100644 --- a/x/wasm/types/validation.go +++ b/x/wasm/types/validation.go @@ -4,6 +4,7 @@ import ( "fmt" "net/url" "strings" + "unicode" "github.com/docker/distribution/reference" @@ -45,6 +46,15 @@ func ValidateLabel(label string) error { if label != strings.TrimSpace(label) { return ErrInvalid.Wrap("label must not start/end with whitespaces") } + labelWithPrintableCharsOnly := strings.Map(func(r rune) rune { + if unicode.IsPrint(r) { + return r + } + return -1 + }, label) + if label != labelWithPrintableCharsOnly { + return ErrInvalid.Wrap("label must have printable characters only") + } return nil } From 981d438a107048872c1a4ad90847d739cca787a7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:58:23 +0200 Subject: [PATCH 02/11] Classic address tests (backport #1666) (#1669) * Added tests for classic addresses. (cherry picked from commit 1445baa4902088439fefc8e8065d6922e8dfafda) * Used another prefix. (cherry picked from commit d8fe3f94677d45fb4ff5daaa9ee1066cc0d2a5f9) * Fixes. (cherry picked from commit f79a694bbd39b8551df3f9fe500563a35bd80281) * Fixes. (cherry picked from commit 29d10f3af20a0680aa520f4dd47f56f97b094b23) * Refactoring. (cherry picked from commit 99ade09b37b8b5e92d1977b85cae82250a3860cc) * Maybe this will fix the problem. (cherry picked from commit 9394faf3be48f65658b486005dbbafe1a7df298b) * Refactoring. (cherry picked from commit 3af3036a79fce5098772ca844948725b1c5a3000) * Refactoring. (cherry picked from commit 76f6f3d5487ab5c9e35bf8eeaa460db187bb6c92) * Made cleanup function private. (cherry picked from commit 257cd7e0bca334ff9b4f9ca44e75c7287b47e8ba) --------- Co-authored-by: Dariusz Depta --- x/wasm/keeper/addresses.go | 2 +- x/wasm/keeper/addresses_test.go | 60 +++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/x/wasm/keeper/addresses.go b/x/wasm/keeper/addresses.go index 9df74f40da..d9136f26d0 100644 --- a/x/wasm/keeper/addresses.go +++ b/x/wasm/keeper/addresses.go @@ -31,7 +31,7 @@ func PredicableAddressGenerator(creator sdk.AccAddress, salt, msg []byte, fixMsg } } -// BuildContractAddressClassic builds an sdk account address for a contract. +// BuildContractAddressClassic builds an address for a contract. func BuildContractAddressClassic(codeID, instanceID uint64) sdk.AccAddress { contractID := make([]byte, 16) binary.BigEndian.PutUint64(contractID[:8], codeID) diff --git a/x/wasm/keeper/addresses_test.go b/x/wasm/keeper/addresses_test.go index 84f3e54b22..c3b24bc41a 100644 --- a/x/wasm/keeper/addresses_test.go +++ b/x/wasm/keeper/addresses_test.go @@ -3,21 +3,75 @@ package keeper import ( "encoding/json" "fmt" + tmbytes "github.com/cometbft/cometbft/libs/bytes" "testing" - tmbytes "github.com/cometbft/cometbft/libs/bytes" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" ) -func TestBuildContractAddress(t *testing.T) { +func prepareCleanup(t *testing.T) { + // preserve current Bech32 settings and restore them after test completion x, y := sdk.GetConfig().GetBech32AccountAddrPrefix(), sdk.GetConfig().GetBech32AccountPubPrefix() + c := sdk.IsAddrCacheEnabled() t.Cleanup(func() { sdk.GetConfig().SetBech32PrefixForAccount(x, y) + sdk.SetAddrCacheEnabled(c) }) + // set custom Bech32 settings sdk.GetConfig().SetBech32PrefixForAccount("purple", "purple") + // disable address cache + // AccAddress -> String conversion is then slower, but does not lead to errors like this: + // runtime error: invalid memory address or nil pointer dereference + sdk.SetAddrCacheEnabled(false) +} +func TestBuildContractAddressClassic(t *testing.T) { + // set cleanup function + prepareCleanup(t) + // prepare test data + specs := []struct { + codeId uint64 + instanceId uint64 + expAddress string + }{ + { + codeId: 0, + instanceId: 0, + expAddress: "purple1w0w8sasnut0jx0vvsnvlc8nayq0q2ej8xgrpwgel05tn6wy4r57qfplul7", + }, + { + codeId: 0, + instanceId: 1, + expAddress: "purple156r47kpk4va938pmtpuee4fh77847gqcw2dmpl2nnpwztwfgz04s5cr8hj", + }, + { + codeId: 1, + instanceId: 0, + expAddress: "purple1mzdhwvvh22wrt07w59wxyd58822qavwkx5lcej7aqfkpqqlhaqfs5efvjk", + }, + { + codeId: 1, + instanceId: 1, + expAddress: "purple14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9smc2vxm", + }, + } + // run tests + for i, spec := range specs { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { + // when + gotAddr := BuildContractAddressClassic(spec.codeId, spec.instanceId) + // then + require.Equal(t, spec.expAddress, gotAddr.String()) + require.NoError(t, sdk.VerifyAddressFormat(gotAddr)) + }) + } +} + +func TestBuildContractAddressPredictable(t *testing.T) { + // set cleanup function + prepareCleanup(t) // test vectors generated via cosmjs: https://github.com/cosmos/cosmjs/pull/1253/files type Spec struct { In struct { @@ -37,7 +91,7 @@ func TestBuildContractAddress(t *testing.T) { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { // when gotAddr := BuildContractAddressPredictable(spec.In.Checksum, spec.In.Creator, spec.In.Salt.Bytes(), []byte(spec.In.Msg)) - + // then require.Equal(t, spec.Out.Address.String(), gotAddr.String()) require.NoError(t, sdk.VerifyAddressFormat(gotAddr)) }) From 8bb5b82bad97339e78aa1e349b95d68ebc758767 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Mon, 16 Oct 2023 13:28:56 +0200 Subject: [PATCH 03/11] Fix test code --- x/wasm/ibctesting/coordinator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/wasm/ibctesting/coordinator.go b/x/wasm/ibctesting/coordinator.go index b5000d733b..75f5271ac6 100644 --- a/x/wasm/ibctesting/coordinator.go +++ b/x/wasm/ibctesting/coordinator.go @@ -257,22 +257,22 @@ func (coord *Coordinator) RelayAndAckPendingPackets(path *Path) error { src := path.EndpointA require.NoError(coord.t, src.UpdateClient()) coord.t.Logf("Relay: %d Packets A->B, %d Packets B->A\n", len(src.Chain.PendingSendPackets), len(path.EndpointB.Chain.PendingSendPackets)) - for i, v := range src.Chain.PendingSendPackets { + for _, v := range src.Chain.PendingSendPackets { err := path.RelayPacket(v, nil) if err != nil { return err } - src.Chain.PendingSendPackets = append(src.Chain.PendingSendPackets[0:i], src.Chain.PendingSendPackets[i+1:]...) + src.Chain.PendingSendPackets = src.Chain.PendingSendPackets[1:] } src = path.EndpointB require.NoError(coord.t, src.UpdateClient()) - for i, v := range src.Chain.PendingSendPackets { + for _, v := range src.Chain.PendingSendPackets { err := path.RelayPacket(v, nil) if err != nil { return err } - src.Chain.PendingSendPackets = append(src.Chain.PendingSendPackets[0:i], src.Chain.PendingSendPackets[i+1:]...) + src.Chain.PendingSendPackets = src.Chain.PendingSendPackets[1:] } return nil } From ff574ee36e951bbd547c66b423304a1b4c745f28 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 14:10:43 +0100 Subject: [PATCH 04/11] Bump wasmvm 1.5.0 (backport #1686) (#1687) * Bump wasmvm 1.5.0 (#1686) (cherry picked from commit a2bbd36364a78867319ad0a28f85203c8cdfbc8d) # Conflicts: # go.mod # go.sum * Fix conflicts --------- Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com> Co-authored-by: Pino' Surace --- Dockerfile | 8 ++++---- README.md | 2 ++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 747f255992..37d87c28bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,10 +15,10 @@ RUN apk add git WORKDIR /code COPY . /code/ # See https://github.com/CosmWasm/wasmvm/releases -ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a -ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep a8259ba852f1b68f2a5f8eb666a9c7f1680196562022f71bb361be1472a83cfd -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 324c1073cb988478d644861783ed5a7de21cfd090976ccc6b1de0559098fbbad +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913 +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63 # Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a diff --git a/README.md b/README.md index 7abbad51d2..f9972b3db6 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ compatibility list: | wasmd | wasmvm | cosmwasm-vm | cosmwasm-std | |-------|--------------|-------------|--------------| +| 0.44 | v1.5.0 | | 1.0-1.5 | +| 0.43 | v1.4.1 | | 1.0-1.4 | | 0.42 | v1.4.0 | | 1.0-1.4 | | 0.41 | v1.3.0 | | 1.0-1.3 | | 0.40 | v1.2.3 | | 1.0-1.2 | diff --git a/go.mod b/go.mod index aa7a7477b8..36b6afaf74 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd go 1.20 require ( - github.com/CosmWasm/wasmvm v1.4.1 + github.com/CosmWasm/wasmvm v1.5.0 github.com/cosmos/cosmos-proto v1.0.0-beta.2 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogogateway v1.2.0 // indirect diff --git a/go.sum b/go.sum index 27da00b70e..f75ad4ac2b 100644 --- a/go.sum +++ b/go.sum @@ -211,8 +211,8 @@ 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/wasmvm v1.4.1 h1:YgodVlBrXa2HJZzOXjWDH0EIRwQzK3zuA73dDPRRLS4= -github.com/CosmWasm/wasmvm v1.4.1/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc= +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/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= From 15bc22a11439cfdb1610a31c2bc20bb3eff77a1f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:19:06 +0100 Subject: [PATCH 05/11] Update changelog for v0.44.0 release (#1689) (#1695) * Update changelog for v0.44.0 release * Add date (cherry picked from commit 62d91d972a913888eb1c6ef692e372b8ceb1f560) Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com> --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 442bca05d6..1394cf097f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,20 @@ ## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD) -[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.43.0...HEAD) +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.44.0...HEAD) + +## [v0.44.0](https://github.com/CosmWasm/wasmd/tree/v0.44.0) (2023-11-06) + +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.43.0...v0.44.0) + +- Upgrade to wasmvm v1.5.0 [\#1675](https://github.com/CosmWasm/wasmd/issues/1675) +- Prevent non printable characters in label [\#1623](https://github.com/CosmWasm/wasmd/issues/1623) + +### Notable changes: +- Upgrade to wasmvm [v1.5.0](https://github.com/CosmWasm/wasmvm/releases/tag/v1.5.0) + +### Migration notes: +- This release does not include any state migrations but breaking changes that require a coordinated chain upgrade. ## [v0.43.0](https://github.com/CosmWasm/wasmd/tree/v0.43.0) (2023-10-10) From b2aa4a43cf154b885705085f23a12618d7513445 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Wed, 8 Nov 2023 09:24:04 +0100 Subject: [PATCH 06/11] Prevent empty channel version (cherry picked from commit fc549d46c493838fae3c1c00007a8087d9ac298a) --- x/wasm/ibc.go | 3 +++ x/wasm/ibc_integration_test.go | 37 +++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/x/wasm/ibc.go b/x/wasm/ibc.go index 4cd6f8fd21..0197a03779 100644 --- a/x/wasm/ibc.go +++ b/x/wasm/ibc.go @@ -75,6 +75,9 @@ func (i IBCHandler) OnChanOpenInit( return "", err } if acceptedVersion == "" { // accept incoming version when nothing returned by contract + if version == "" { + return "", types.ErrEmpty.Wrap("version") + } acceptedVersion = version } diff --git a/x/wasm/ibc_integration_test.go b/x/wasm/ibc_integration_test.go index c5403759dd..421bdf33a5 100644 --- a/x/wasm/ibc_integration_test.go +++ b/x/wasm/ibc_integration_test.go @@ -21,21 +21,31 @@ import ( ) func TestOnChanOpenInitVersion(t *testing.T) { - const startVersion = "v1" + const v1 = "v1" specs := map[string]struct { - contractRsp *wasmvmtypes.IBC3ChannelOpenResponse - expVersion string + startVersion string + contractRsp *wasmvmtypes.IBC3ChannelOpenResponse + expVersion string + expErr bool }{ "different version": { - contractRsp: &wasmvmtypes.IBC3ChannelOpenResponse{Version: "v2"}, - expVersion: "v2", + startVersion: v1, + contractRsp: &wasmvmtypes.IBC3ChannelOpenResponse{Version: "v2"}, + expVersion: "v2", }, "no response": { - expVersion: startVersion, + startVersion: v1, + expVersion: v1, }, "empty result": { - contractRsp: &wasmvmtypes.IBC3ChannelOpenResponse{}, - expVersion: startVersion, + startVersion: v1, + contractRsp: &wasmvmtypes.IBC3ChannelOpenResponse{}, + expVersion: v1, + }, + "empty versions should fail": { + startVersion: "", + contractRsp: &wasmvmtypes.IBC3ChannelOpenResponse{}, + expErr: true, }, } for name, spec := range specs { @@ -63,10 +73,17 @@ func TestOnChanOpenInitVersion(t *testing.T) { path.EndpointA.ChannelConfig = &ibctesting.ChannelConfig{ PortID: contractInfo.IBCPortID, - Version: startVersion, + Version: spec.startVersion, Order: channeltypes.UNORDERED, } - require.NoError(t, path.EndpointA.ChanOpenInit()) + // when + gotErr := path.EndpointA.ChanOpenInit() + // then + if spec.expErr { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) assert.Equal(t, spec.expVersion, path.EndpointA.ChannelConfig.Version) }) } From 2d9c98f6f9e7455de0adba83781589b2d94c7bda Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:04:51 +0100 Subject: [PATCH 07/11] Fix gov v1beta1 support for legacy propsals (backport #1715) (#1716) * Fix gov v1beta1 support for legacy propsals (#1715) * Revert "Remove gov v1beta1 dependencies and deprecated proposals (#1646)" This reverts commit e0da4194095544042c47cf64e9cf139446ff4683. * Rename legacy propsal files * Ensure gov store support for v1beta1 types * Linter * Cleanup alias (cherry picked from commit 2a82e352430f5ce799c1926f203cd43b39221387) # Conflicts: # x/wasm/types/tx.pb.go * Rengenerate from proto; formatting * Make test compile with v0.4x branch --------- Co-authored-by: Alexander Peters --- docs/proto/proto-docs.md | 343 +- proto/cosmwasm/wasm/v1/proposal_legacy.proto | 333 + proto/cosmwasm/wasm/v1/tx.proto | 10 - x/wasm/keeper/addresses_test.go | 3 +- x/wasm/keeper/genesis_test.go | 32 +- x/wasm/keeper/proposal_handler_legacy.go | 342 + x/wasm/keeper/proposal_integration_test.go | 233 + x/wasm/keeper/querier_test.go | 16 +- x/wasm/types/codec.go | 38 +- x/wasm/types/proposal_legacy.go | 804 +++ x/wasm/types/proposal_legacy.pb.go | 5859 ++++++++++++++++++ x/wasm/types/proposal_legacy_test.go | 1317 ++++ x/wasm/types/tx.pb.go | 496 +- 13 files changed, 9417 insertions(+), 409 deletions(-) create mode 100644 proto/cosmwasm/wasm/v1/proposal_legacy.proto create mode 100644 x/wasm/keeper/proposal_handler_legacy.go create mode 100644 x/wasm/keeper/proposal_integration_test.go create mode 100644 x/wasm/types/proposal_legacy.go create mode 100644 x/wasm/types/proposal_legacy.pb.go create mode 100644 x/wasm/types/proposal_legacy_test.go diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 2ea6190ed0..c3de180ca7 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -41,6 +41,21 @@ - [MsgIBCSend](#cosmwasm.wasm.v1.MsgIBCSend) - [MsgIBCSendResponse](#cosmwasm.wasm.v1.MsgIBCSendResponse) +- [cosmwasm/wasm/v1/proposal_legacy.proto](#cosmwasm/wasm/v1/proposal_legacy.proto) + - [AccessConfigUpdate](#cosmwasm.wasm.v1.AccessConfigUpdate) + - [ClearAdminProposal](#cosmwasm.wasm.v1.ClearAdminProposal) + - [ExecuteContractProposal](#cosmwasm.wasm.v1.ExecuteContractProposal) + - [InstantiateContract2Proposal](#cosmwasm.wasm.v1.InstantiateContract2Proposal) + - [InstantiateContractProposal](#cosmwasm.wasm.v1.InstantiateContractProposal) + - [MigrateContractProposal](#cosmwasm.wasm.v1.MigrateContractProposal) + - [PinCodesProposal](#cosmwasm.wasm.v1.PinCodesProposal) + - [StoreAndInstantiateContractProposal](#cosmwasm.wasm.v1.StoreAndInstantiateContractProposal) + - [StoreCodeProposal](#cosmwasm.wasm.v1.StoreCodeProposal) + - [SudoContractProposal](#cosmwasm.wasm.v1.SudoContractProposal) + - [UnpinCodesProposal](#cosmwasm.wasm.v1.UnpinCodesProposal) + - [UpdateAdminProposal](#cosmwasm.wasm.v1.UpdateAdminProposal) + - [UpdateInstantiateConfigProposal](#cosmwasm.wasm.v1.UpdateInstantiateConfigProposal) + - [cosmwasm/wasm/v1/query.proto](#cosmwasm/wasm/v1/query.proto) - [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) - [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest) @@ -69,7 +84,6 @@ - [Query](#cosmwasm.wasm.v1.Query) - [cosmwasm/wasm/v1/tx.proto](#cosmwasm/wasm/v1/tx.proto) - - [AccessConfigUpdate](#cosmwasm.wasm.v1.AccessConfigUpdate) - [MsgAddCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses) - [MsgAddCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse) - [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin) @@ -625,6 +639,316 @@ MsgIBCSendResponse + + + + + + + + + + + +

Top

+ +## cosmwasm/wasm/v1/proposal_legacy.proto + + + + + +### AccessConfigUpdate +AccessConfigUpdate contains the code id and the access config to be +applied. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code to be updated | +| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply to the set of code ids | + + + + + + + + +### ClearAdminProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit ClearAdminProposal. To clear the admin of a contract, +a simple MsgClearAdmin can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `contract` | [string](#string) | | Contract is the address of the smart contract | + + + + + + + + +### ExecuteContractProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit ExecuteContractProposal. To call execute on a contract, +a simple MsgExecuteContract can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | +| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract as execute | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | + + + + + + + + +### InstantiateContract2Proposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit InstantiateContract2Proposal. To instantiate contract 2, +a simple MsgInstantiateContract2 can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's enviroment as sender | +| `admin` | [string](#string) | | Admin is an optional address that can execute migrations | +| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `msg` | [bytes](#bytes) | | Msg json encode message to be passed to the contract on instantiation | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | +| `salt` | [bytes](#bytes) | | Salt is an arbitrary value provided by the sender. Size can be 1 to 64. | +| `fix_msg` | [bool](#bool) | | FixMsg include the msg value into the hash for the predictable address. Default is false | + + + + + + + + +### InstantiateContractProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit InstantiateContractProposal. To instantiate a contract, +a simple MsgInstantiateContract can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | +| `admin` | [string](#string) | | Admin is an optional address that can execute migrations | +| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | + + + + + + + + +### MigrateContractProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit MigrateContractProposal. To migrate a contract, +a simple MsgMigrateContract can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text + +Note: skipping 3 as this was previously used for unneeded run_as | +| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `code_id` | [uint64](#uint64) | | CodeID references the new WASM code | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on migration | + + + + + + + + +### PinCodesProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +cache, a simple MsgPinCodes can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the new WASM codes | + + + + + + + + +### StoreAndInstantiateContractProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit StoreAndInstantiateContractProposal. To store and instantiate +the contract, a simple MsgStoreAndInstantiateContract can be invoked from +the x/gov module via a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | +| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | +| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional | +| `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional | +| `admin` | [string](#string) | | Admin is an optional address that can execute migrations | +| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation | +| `source` | [string](#string) | | Source is the URL where the code is hosted | +| `builder` | [string](#string) | | Builder is the docker image used to build the code deterministically, used for smart contract verification | +| `code_hash` | [bytes](#bytes) | | CodeHash is the SHA256 sum of the code outputted by builder, used for smart contract verification | + + + + + + + + +### StoreCodeProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit StoreCodeProposal. To submit WASM code to the system, +a simple MsgStoreCode can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender | +| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | +| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional | +| `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional | +| `source` | [string](#string) | | Source is the URL where the code is hosted | +| `builder` | [string](#string) | | Builder is the docker image used to build the code deterministically, used for smart contract verification | +| `code_hash` | [bytes](#bytes) | | CodeHash is the SHA256 sum of the code outputted by builder, used for smart contract verification | + + + + + + + + +### SudoContractProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit SudoContractProposal. To call sudo on a contract, +a simple MsgSudoContract can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract as sudo | + + + + + + + + +### UnpinCodesProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the WASM codes | + + + + + + + + +### UpdateAdminProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit UpdateAdminProposal. To set an admin for a contract, +a simple MsgUpdateAdmin can be invoked from the x/gov module via +a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `new_admin` | [string](#string) | | NewAdmin address to be set | +| `contract` | [string](#string) | | Contract is the address of the smart contract | + + + + + + + + +### UpdateInstantiateConfigProposal +Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +an explicit UpdateInstantiateConfigProposal. To update instantiate config +to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +the x/gov module via a v1 governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | Title is a short summary | +| `description` | [string](#string) | | Description is a human readable text | +| `access_config_updates` | [AccessConfigUpdate](#cosmwasm.wasm.v1.AccessConfigUpdate) | repeated | AccessConfigUpdate contains the list of code ids and the access config to be applied. | + + + + + @@ -1051,23 +1375,6 @@ Query provides defines the gRPC querier service - - -### AccessConfigUpdate -AccessConfigUpdate contains the code id and the access config to be -applied. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code to be updated | -| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply to the set of code ids | - - - - - - ### MsgAddCodeUploadParamsAddresses diff --git a/proto/cosmwasm/wasm/v1/proposal_legacy.proto b/proto/cosmwasm/wasm/v1/proposal_legacy.proto new file mode 100644 index 0000000000..8bb872e2a8 --- /dev/null +++ b/proto/cosmwasm/wasm/v1/proposal_legacy.proto @@ -0,0 +1,333 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmwasm/wasm/v1/types.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreCodeProposal. To submit WASM code to the system, +// a simple MsgStoreCode can be invoked from the x/gov module via +// a v1 governance proposal. +message StoreCodeProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreCodeProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 5, 6; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 7; + // UnpinCode code on upload, optional + bool unpin_code = 8; + // Source is the URL where the code is hosted + string source = 9; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 10; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 11; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContractProposal. To instantiate a contract, +// a simple MsgInstantiateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContract2Proposal. To instantiate contract 2, +// a simple MsgInstantiateContract2 can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContract2Proposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContract2Proposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's enviroment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encode message to be passed to the contract on instantiation + bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 9; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 10; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit MigrateContractProposal. To migrate a contract, +// a simple MsgMigrateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message MigrateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/MigrateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Note: skipping 3 as this was previously used for unneeded run_as + + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID references the new WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit SudoContractProposal. To call sudo on a contract, +// a simple MsgSudoContract can be invoked from the x/gov module via +// a v1 governance proposal. +message SudoContractProposal { + option deprecated = true; + option (amino.name) = "wasm/SudoContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as sudo + bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ExecuteContractProposal. To call execute on a contract, +// a simple MsgExecuteContract can be invoked from the x/gov module via +// a v1 governance proposal. +message ExecuteContractProposal { + option deprecated = true; + option (amino.name) = "wasm/ExecuteContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as execute + bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateAdminProposal. To set an admin for a contract, +// a simple MsgUpdateAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message UpdateAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // NewAdmin address to be set + string new_admin = 3 [ + (gogoproto.moretags) = "yaml:\"new_admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ClearAdminProposal. To clear the admin of a contract, +// a simple MsgClearAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message ClearAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/ClearAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +// cache, a simple MsgPinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message PinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/PinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the new WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message UnpinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/UnpinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// AccessConfigUpdate contains the code id and the access config to be +// applied. +message AccessConfigUpdate { + // CodeID is the reference to the stored WASM code to be updated + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // InstantiatePermission to apply to the set of code ids + AccessConfig instantiate_permission = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateInstantiateConfigProposal. To update instantiate config +// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +// the x/gov module via a v1 governance proposal. +message UpdateInstantiateConfigProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateInstantiateConfigProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // AccessConfigUpdate contains the list of code ids and the access config + // to be applied. + repeated AccessConfigUpdate access_config_updates = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreAndInstantiateContractProposal. To store and instantiate +// the contract, a simple MsgStoreAndInstantiateContract can be invoked from +// the x/gov module via a v1 governance proposal. +message StoreAndInstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreAndInstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 5; + // UnpinCode code on upload, optional + bool unpin_code = 6; + // Admin is an optional address that can execute migrations + string admin = 7; + // Label is optional metadata to be stored with a constract instance. + string label = 8; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 9 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 10 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // Source is the URL where the code is hosted + string source = 11; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 12; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 13; +} diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto index 3e0fadb58c..393c6a6822 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -252,16 +252,6 @@ message MsgClearAdmin { // MsgClearAdminResponse returns empty data message MsgClearAdminResponse {} -// AccessConfigUpdate contains the code id and the access config to be -// applied. -message AccessConfigUpdate { - // CodeID is the reference to the stored WASM code to be updated - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // InstantiatePermission to apply to the set of code ids - AccessConfig instantiate_permission = 2 - [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; -} - // MsgUpdateInstantiateConfig updates instantiate config for a smart contract message MsgUpdateInstantiateConfig { option (amino.name) = "wasm/MsgUpdateInstantiateConfig"; diff --git a/x/wasm/keeper/addresses_test.go b/x/wasm/keeper/addresses_test.go index c3b24bc41a..33195b9944 100644 --- a/x/wasm/keeper/addresses_test.go +++ b/x/wasm/keeper/addresses_test.go @@ -3,9 +3,10 @@ package keeper import ( "encoding/json" "fmt" - tmbytes "github.com/cometbft/cometbft/libs/bytes" "testing" + tmbytes "github.com/cometbft/cometbft/libs/bytes" + "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/wasm/keeper/genesis_test.go b/x/wasm/keeper/genesis_test.go index 2ad87f7e5f..e6fe6eacb1 100644 --- a/x/wasm/keeper/genesis_test.go +++ b/x/wasm/keeper/genesis_test.go @@ -32,8 +32,6 @@ import ( "github.com/CosmWasm/wasmd/x/wasm/types" ) -const firstCodeID = 1 - func TestGenesisExportImport(t *testing.T) { wasmKeeper, srcCtx := setupKeeper(t) contractKeeper := NewGovPermissionKeeper(wasmKeeper) @@ -180,7 +178,7 @@ func TestGenesisInit(t *testing.T) { "happy path: code info correct": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -195,7 +193,7 @@ func TestGenesisInit(t *testing.T) { "happy path: code ids can contain gaps": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }, { @@ -218,7 +216,7 @@ func TestGenesisInit(t *testing.T) { CodeInfo: myCodeInfo, CodeBytes: wasmCode, }, { - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -233,7 +231,7 @@ func TestGenesisInit(t *testing.T) { }, "prevent code hash mismatch": {src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: types.CodeInfoFixture(func(i *types.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }), CodeBytes: wasmCode, }}, @@ -242,12 +240,12 @@ func TestGenesisInit(t *testing.T) { "prevent duplicate codeIDs": {src: types.GenesisState{ Codes: []types.Code{ { - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }, { - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }, @@ -258,7 +256,7 @@ func TestGenesisInit(t *testing.T) { src: types.GenesisState{ Codes: []types.Code{ { - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, Pinned: true, @@ -276,7 +274,7 @@ func TestGenesisInit(t *testing.T) { "happy path: code id in info and contract do match": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -305,7 +303,7 @@ func TestGenesisInit(t *testing.T) { "happy path: code info with two contracts": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -364,7 +362,7 @@ func TestGenesisInit(t *testing.T) { "prevent duplicate contract address": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -399,7 +397,7 @@ func TestGenesisInit(t *testing.T) { "prevent duplicate contract model keys": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -455,7 +453,7 @@ func TestGenesisInit(t *testing.T) { "prevent contract id seq init value not high enough": { src: types.GenesisState{ Codes: []types.Code{{ - CodeID: firstCodeID, + CodeID: 1, CodeInfo: myCodeInfo, CodeBytes: wasmCode, }}, @@ -611,7 +609,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) { adminAddr := "cosmos1h5t8zxmjr30e9dqghtlpl40f2zz5cgey6esxtn" expContractInfo := types.ContractInfo{ - CodeID: firstCodeID, + CodeID: 1, Creator: contractCreatorAddr, Admin: adminAddr, Label: "ȀĴnZV芢毤", @@ -622,7 +620,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) { expHistory := []types.ContractCodeHistoryEntry{ { Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{ BlockHeight: 100, TxIndex: 10, @@ -631,7 +629,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) { }, { Operation: types.ContractCodeHistoryOperationTypeMigrate, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{ BlockHeight: 200, TxIndex: 10, diff --git a/x/wasm/keeper/proposal_handler_legacy.go b/x/wasm/keeper/proposal_handler_legacy.go new file mode 100644 index 0000000000..d066e4b6e0 --- /dev/null +++ b/x/wasm/keeper/proposal_handler_legacy.go @@ -0,0 +1,342 @@ +package keeper + +import ( + "bytes" + "encoding/hex" + "fmt" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + "github.com/CosmWasm/wasmd/x/wasm/types" +) + +// NewLegacyWasmProposalHandler creates a new governance Handler for wasm proposals +// +// Deprecated: Do not use v1beta1 handlers anymore. Gov v1 is the way to go +func NewLegacyWasmProposalHandler(k decoratedKeeper, enabledProposalTypes []types.ProposalType) v1beta1.Handler { + return NewLegacyWasmProposalHandlerX(NewGovPermissionKeeper(k), enabledProposalTypes) +} + +// NewLegacyWasmProposalHandlerX creates a new governance Handler for wasm proposals +// +// Deprecated: Do not use v1beta1 handlers anymore. Gov v1 is the way to go +func NewLegacyWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []types.ProposalType) v1beta1.Handler { + enabledTypes := make(map[string]struct{}, len(enabledProposalTypes)) + for i := range enabledProposalTypes { + enabledTypes[string(enabledProposalTypes[i])] = struct{}{} + } + return func(ctx sdk.Context, content v1beta1.Content) error { + if content == nil { + return errorsmod.Wrap(sdkerrors.ErrUnknownRequest, "content must not be empty") + } + if _, ok := enabledTypes[content.ProposalType()]; !ok { + return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unsupported wasm proposal content type: %q", content.ProposalType()) + } + switch c := content.(type) { + case *types.StoreCodeProposal: + return handleStoreCodeProposal(ctx, k, *c) + case *types.InstantiateContractProposal: + return handleInstantiateProposal(ctx, k, *c) + case *types.InstantiateContract2Proposal: + return handleInstantiate2Proposal(ctx, k, *c) + case *types.MigrateContractProposal: + return handleMigrateProposal(ctx, k, *c) + case *types.SudoContractProposal: + return handleSudoProposal(ctx, k, *c) + case *types.ExecuteContractProposal: + return handleExecuteProposal(ctx, k, *c) + case *types.UpdateAdminProposal: + return handleUpdateAdminProposal(ctx, k, *c) + case *types.ClearAdminProposal: + return handleClearAdminProposal(ctx, k, *c) + case *types.PinCodesProposal: + return handlePinCodesProposal(ctx, k, *c) + case *types.UnpinCodesProposal: + return handleUnpinCodesProposal(ctx, k, *c) + case *types.UpdateInstantiateConfigProposal: + return handleUpdateInstantiateConfigProposal(ctx, k, *c) + case *types.StoreAndInstantiateContractProposal: + return handleStoreAndInstantiateContractProposal(ctx, k, *c) + default: + return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized wasm proposal content type: %T", c) + } + } +} + +//nolint:staticcheck +func handleStoreCodeProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.StoreCodeProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + runAsAddr, err := sdk.AccAddressFromBech32(p.RunAs) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + codeID, checksum, err := k.Create(ctx, runAsAddr, p.WASMByteCode, p.InstantiatePermission) + if err != nil { + return err + } + + if len(p.CodeHash) != 0 && !bytes.Equal(checksum, p.CodeHash) { + return fmt.Errorf("code-hash mismatch: %X, checksum: %X", p.CodeHash, checksum) + } + + // if code should not be pinned return earlier + if p.UnpinCode { + return nil + } + return k.PinCode(ctx, codeID) +} + +//nolint:staticcheck +func handleInstantiateProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.InstantiateContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + runAsAddr, err := sdk.AccAddressFromBech32(p.RunAs) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + var adminAddr sdk.AccAddress + if p.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(p.Admin); err != nil { + return errorsmod.Wrap(err, "admin") + } + } + + _, data, err := k.Instantiate(ctx, p.CodeID, runAsAddr, adminAddr, p.Msg, p.Label, p.Funds) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleInstantiate2Proposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.InstantiateContract2Proposal) error { + // Validatebasic with proposal + if err := p.ValidateBasic(); err != nil { + return err + } + + // Get runAsAddr as AccAddress + runAsAddr, err := sdk.AccAddressFromBech32(p.RunAs) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + + // Get admin address + var adminAddr sdk.AccAddress + if p.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(p.Admin); err != nil { + return errorsmod.Wrap(err, "admin") + } + } + + _, data, err := k.Instantiate2(ctx, p.CodeID, runAsAddr, adminAddr, p.Msg, p.Label, p.Funds, p.Salt, p.FixMsg) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleStoreAndInstantiateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.StoreAndInstantiateContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + runAsAddr, err := sdk.AccAddressFromBech32(p.RunAs) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + var adminAddr sdk.AccAddress + if p.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(p.Admin); err != nil { + return errorsmod.Wrap(err, "admin") + } + } + + codeID, checksum, err := k.Create(ctx, runAsAddr, p.WASMByteCode, p.InstantiatePermission) + if err != nil { + return err + } + + if p.CodeHash != nil && !bytes.Equal(checksum, p.CodeHash) { + return errorsmod.Wrap(fmt.Errorf("code-hash mismatch: %X, checksum: %X", p.CodeHash, checksum), "code-hash mismatch") + } + + if !p.UnpinCode { + if err := k.PinCode(ctx, codeID); err != nil { + return err + } + } + + _, data, err := k.Instantiate(ctx, codeID, runAsAddr, adminAddr, p.Msg, p.Label, p.Funds) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleMigrateProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.MigrateContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + contractAddr, err := sdk.AccAddressFromBech32(p.Contract) + if err != nil { + return errorsmod.Wrap(err, "contract") + } + + // runAs is not used if this is permissioned, so just put any valid address there (second contractAddr) + data, err := k.Migrate(ctx, contractAddr, contractAddr, p.CodeID, p.Msg) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleSudoProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.SudoContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + contractAddr, err := sdk.AccAddressFromBech32(p.Contract) + if err != nil { + return errorsmod.Wrap(err, "contract") + } + data, err := k.Sudo(ctx, contractAddr, p.Msg) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleExecuteProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.ExecuteContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + contractAddr, err := sdk.AccAddressFromBech32(p.Contract) + if err != nil { + return errorsmod.Wrap(err, "contract") + } + runAsAddr, err := sdk.AccAddressFromBech32(p.RunAs) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + data, err := k.Execute(ctx, contractAddr, runAsAddr, p.Msg, p.Funds) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeGovContractResult, + sdk.NewAttribute(types.AttributeKeyResultDataHex, hex.EncodeToString(data)), + )) + return nil +} + +//nolint:staticcheck +func handleUpdateAdminProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.UpdateAdminProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + contractAddr, err := sdk.AccAddressFromBech32(p.Contract) + if err != nil { + return errorsmod.Wrap(err, "contract") + } + newAdminAddr, err := sdk.AccAddressFromBech32(p.NewAdmin) + if err != nil { + return errorsmod.Wrap(err, "run as address") + } + + return k.UpdateContractAdmin(ctx, contractAddr, nil, newAdminAddr) +} + +//nolint:staticcheck +func handleClearAdminProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.ClearAdminProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + contractAddr, err := sdk.AccAddressFromBech32(p.Contract) + if err != nil { + return errorsmod.Wrap(err, "contract") + } + err = k.ClearContractAdmin(ctx, contractAddr, nil) + return err +} + +//nolint:staticcheck +func handlePinCodesProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.PinCodesProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + for _, v := range p.CodeIDs { + if err := k.PinCode(ctx, v); err != nil { + return errorsmod.Wrapf(err, "code id: %d", v) + } + } + return nil +} + +//nolint:staticcheck +func handleUnpinCodesProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.UnpinCodesProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + for _, v := range p.CodeIDs { + if err := k.UnpinCode(ctx, v); err != nil { + return errorsmod.Wrapf(err, "code id: %d", v) + } + } + return nil +} + +//nolint:staticcheck +func handleUpdateInstantiateConfigProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.UpdateInstantiateConfigProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + var emptyCaller sdk.AccAddress + for _, accessConfigUpdate := range p.AccessConfigUpdates { + if err := k.SetAccessConfig(ctx, accessConfigUpdate.CodeID, emptyCaller, accessConfigUpdate.InstantiatePermission); err != nil { + return errorsmod.Wrapf(err, "code id: %d", accessConfigUpdate.CodeID) + } + } + return nil +} diff --git a/x/wasm/keeper/proposal_integration_test.go b/x/wasm/keeper/proposal_integration_test.go new file mode 100644 index 0000000000..2d2d0faf14 --- /dev/null +++ b/x/wasm/keeper/proposal_integration_test.go @@ -0,0 +1,233 @@ +package keeper + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "testing" + + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + "github.com/CosmWasm/wasmd/x/wasm/keeper/testdata" + "github.com/CosmWasm/wasmd/x/wasm/types" +) + +func TestLoadStoredGovV1Beta1LegacyTypes(t *testing.T) { + pCtx, keepers := CreateTestInput(t, false, ReflectFeatures+",iterator") + k := keepers.WasmKeeper + keepers.GovKeeper.SetLegacyRouter(v1beta1.NewRouter(). + AddRoute(types.ModuleName, NewLegacyWasmProposalHandler(k, types.EnableAllProposals)), + ) + myAddress := RandomAccountAddress(t) + keepers.Faucet.Fund(pCtx, myAddress, sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewIntFromUint64(100_000_000))) + keepers.Faucet.Fund(pCtx, myAddress, sdk.NewCoin("denom", sdkmath.NewIntFromUint64(100_000_000))) + + reflectExample := InstantiateReflectExampleContract(t, pCtx, keepers) + burnerCodeID, _, err := k.create(pCtx, myAddress, testdata.BurnerContractWasm(), nil, DefaultAuthorizationPolicy{}) + require.NoError(t, err) + hackatomExample := InstantiateHackatomExampleContract(t, pCtx, keepers) + + type StealMsg struct { + Recipient string `json:"recipient"` + Amount []sdk.Coin `json:"amount"` + } + stealMsg := struct { + Steal StealMsg `json:"steal_funds"` + }{Steal: StealMsg{ + Recipient: myAddress.String(), + Amount: []sdk.Coin{sdk.NewInt64Coin("denom", 75)}, + }} + stealMsgBz := must(json.Marshal(stealMsg)) + + specs := map[string]struct { + legacyContent v1beta1.Content + }{ + "store code": { + legacyContent: &types.StoreCodeProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Source: "https://example.com/", + Builder: "cosmwasm/workspace-optimizer:v0.12.8", + RunAs: myAddress.String(), + WASMByteCode: testdata.HackatomContractWasm(), + CodeHash: must(hex.DecodeString(testdata.ChecksumHackatom)), + }, + }, + "instantiate": { + legacyContent: &types.InstantiateContractProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + RunAs: myAddress.String(), + Admin: myAddress.String(), + CodeID: reflectExample.CodeID, + Label: "testing", + Msg: []byte("{}"), + }, + }, + "instantiate2": { + legacyContent: &types.InstantiateContract2Proposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + RunAs: myAddress.String(), + Admin: myAddress.String(), + CodeID: reflectExample.CodeID, + Label: "testing", + Msg: []byte("{}"), + Salt: []byte("mySalt"), + }, + }, + "store and instantiate": { + legacyContent: &types.StoreAndInstantiateContractProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + RunAs: myAddress.String(), + WASMByteCode: testdata.ReflectContractWasm(), + Admin: myAddress.String(), + Label: "testing", + Msg: []byte("{}"), + Source: "https://example.com/", + Builder: "cosmwasm/workspace-optimizer:v0.12.8", + CodeHash: reflectExample.Checksum, + }, + }, + "migrate": { + legacyContent: &types.MigrateContractProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Contract: reflectExample.Contract.String(), + CodeID: burnerCodeID, + Msg: []byte(fmt.Sprintf(`{"payout": "%s"}`, myAddress)), + }, + }, + "execute": { + legacyContent: &types.ExecuteContractProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Contract: reflectExample.Contract.String(), + RunAs: reflectExample.CreatorAddr.String(), + Msg: must(json.Marshal(testdata.ReflectHandleMsg{ + Reflect: &testdata.ReflectPayload{ + Msgs: []wasmvmtypes.CosmosMsg{{ + Bank: &wasmvmtypes.BankMsg{ + Send: &wasmvmtypes.SendMsg{ + ToAddress: myAddress.String(), + Amount: []wasmvmtypes.Coin{{Denom: "denom", Amount: "100"}}, + }, + }, + }}, + }, + })), + }, + }, + "sudo": { + &types.SudoContractProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Contract: hackatomExample.Contract.String(), + Msg: stealMsgBz, + }, + }, + "update admin": { + legacyContent: &types.UpdateAdminProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Contract: reflectExample.Contract.String(), + NewAdmin: myAddress.String(), + }, + }, + "clear admin": { + legacyContent: &types.ClearAdminProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + Contract: reflectExample.Contract.String(), + }, + }, + "pin codes": { + legacyContent: &types.PinCodesProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + CodeIDs: []uint64{reflectExample.CodeID}, + }, + }, + "unpin codes": { + legacyContent: &types.UnpinCodesProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + CodeIDs: []uint64{reflectExample.CodeID}, + }, + }, + "update instantiate config": { + legacyContent: &types.UpdateInstantiateConfigProposal{ //nolint:staticcheck + Title: "Foo", + Description: "Bar", + AccessConfigUpdates: []types.AccessConfigUpdate{ + {CodeID: reflectExample.CodeID, InstantiatePermission: types.AllowNobody}, + }, + }, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, _ := pCtx.CacheContext() + propID := mustSubmitAndExecuteLegacyProposal(t, ctx, spec.legacyContent, myAddress.String(), keepers) + // when + proposal, exists := keepers.GovKeeper.GetProposal(ctx, propID) + // then + require.True(t, exists) + require.Len(t, proposal.Messages, 1) + assert.NotNil(t, proposal.Messages[0].GetCachedValue()) + }) + } +} + +func mustSubmitAndExecuteLegacyProposal(t *testing.T, ctx sdk.Context, content v1beta1.Content, myActorAddress string, keepers TestKeepers) uint64 { + t.Helper() + govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() + msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) + // ignore all submit events + contentMsg, rsp, err := submitLegacyProposal(t, ctx.WithEventManager(sdk.NewEventManager()), content, myActorAddress, govAuthority, msgServer) + require.NoError(t, err) + + _, err = msgServer.ExecLegacyContent(ctx, v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) + require.NoError(t, err) + return rsp.ProposalId +} + +// does not fail on submit proposal +func submitLegacyProposal(t *testing.T, ctx sdk.Context, content v1beta1.Content, myActorAddress, govAuthority string, msgServer v1.MsgServer) (*v1.MsgExecLegacyContent, *v1.MsgSubmitProposalResponse, error) { + t.Helper() + contentMsg, err := v1.NewLegacyContent(content, govAuthority) + require.NoError(t, err) + + proposal, err := v1.NewMsgSubmitProposal( + []sdk.Msg{contentMsg}, + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewIntFromUint64(1_000_000))), + myActorAddress, + "", + content.GetTitle(), + content.GetDescription(), + ) + require.NoError(t, err) + + // when stored + rsp, err := msgServer.SubmitProposal(ctx, proposal) + return contentMsg, rsp, err +} + +// for test code only +func must[t any](s t, err error) t { + if err != nil { + panic(err) + } + return s +} diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 8de6b6aabf..18b38fa5d0 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -411,14 +411,14 @@ func TestQueryContractHistory(t *testing.T) { "response with internal fields cleared": { srcHistory: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeGenesis, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, Msg: []byte(`"init message"`), }}, req: types.QueryContractHistoryRequest{Address: myContractBech32Addr}, expContent: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeGenesis, - CodeID: firstCodeID, + CodeID: 1, Msg: []byte(`"init message"`), Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, }}, @@ -426,7 +426,7 @@ func TestQueryContractHistory(t *testing.T) { "response with multiple entries": { srcHistory: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, Msg: []byte(`"init message"`), }, { @@ -443,7 +443,7 @@ func TestQueryContractHistory(t *testing.T) { req: types.QueryContractHistoryRequest{Address: myContractBech32Addr}, expContent: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Msg: []byte(`"init message"`), Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, }, { @@ -461,7 +461,7 @@ func TestQueryContractHistory(t *testing.T) { "with pagination offset": { srcHistory: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, Msg: []byte(`"init message"`), }, { @@ -481,7 +481,7 @@ func TestQueryContractHistory(t *testing.T) { "with pagination limit": { srcHistory: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, Msg: []byte(`"init message"`), }, { @@ -498,7 +498,7 @@ func TestQueryContractHistory(t *testing.T) { }, expContent: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, + CodeID: 1, Msg: []byte(`"init message"`), Updated: &types.AbsoluteTxPosition{BlockHeight: 1, TxIndex: 2}, }}, @@ -507,7 +507,7 @@ func TestQueryContractHistory(t *testing.T) { req: types.QueryContractHistoryRequest{Address: otherBech32Addr}, srcHistory: []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeGenesis, - CodeID: firstCodeID, + CodeID: 1, Updated: types.NewAbsoluteTxPosition(ctx), Msg: []byte(`"init message"`), }}, diff --git a/x/wasm/types/codec.go b/x/wasm/types/codec.go index c1fcfb9972..45f6677b10 100644 --- a/x/wasm/types/codec.go +++ b/x/wasm/types/codec.go @@ -13,7 +13,7 @@ import ( groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec" ) -// RegisterLegacyAminoCodec registers the account types and interface +// RegisterLegacyAminoCodec registers the concrete types and interface func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgStoreCode{}, "wasm/MsgStoreCode", nil) cdc.RegisterConcrete(&MsgInstantiateContract{}, "wasm/MsgInstantiateContract", nil) @@ -48,8 +48,23 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&StoreCodeAuthorization{}, "wasm/StoreCodeAuthorization", nil) cdc.RegisterConcrete(&ContractExecutionAuthorization{}, "wasm/ContractExecutionAuthorization", nil) cdc.RegisterConcrete(&ContractMigrationAuthorization{}, "wasm/ContractMigrationAuthorization", nil) + + // legacy gov v1beta1 types that may be used for unmarshalling stored gov data + cdc.RegisterConcrete(&PinCodesProposal{}, "wasm/PinCodesProposal", nil) + cdc.RegisterConcrete(&UnpinCodesProposal{}, "wasm/UnpinCodesProposal", nil) + cdc.RegisterConcrete(&StoreCodeProposal{}, "wasm/StoreCodeProposal", nil) + cdc.RegisterConcrete(&InstantiateContractProposal{}, "wasm/InstantiateContractProposal", nil) + cdc.RegisterConcrete(&InstantiateContract2Proposal{}, "wasm/InstantiateContract2Proposal", nil) + cdc.RegisterConcrete(&MigrateContractProposal{}, "wasm/MigrateContractProposal", nil) + cdc.RegisterConcrete(&SudoContractProposal{}, "wasm/SudoContractProposal", nil) + cdc.RegisterConcrete(&ExecuteContractProposal{}, "wasm/ExecuteContractProposal", nil) + cdc.RegisterConcrete(&UpdateAdminProposal{}, "wasm/UpdateAdminProposal", nil) + cdc.RegisterConcrete(&ClearAdminProposal{}, "wasm/ClearAdminProposal", nil) + cdc.RegisterConcrete(&UpdateInstantiateConfigProposal{}, "wasm/UpdateInstantiateConfigProposal", nil) + cdc.RegisterConcrete(&StoreAndInstantiateContractProposal{}, "wasm/StoreAndInstantiateContractProposal", nil) } +// RegisterInterfaces registers the concrete proto types and interfaces with the SDK interface registry func RegisterInterfaces(registry types.InterfaceRegistry) { registry.RegisterImplementations( (*sdk.Msg)(nil), @@ -73,10 +88,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgStoreAndMigrateContract{}, &MsgUpdateContractLabel{}, ) - registry.RegisterImplementations( - (*v1beta1.Content)(nil), - ) - registry.RegisterInterface("cosmwasm.wasm.v1.ContractInfoExtension", (*ContractInfoExtension)(nil)) registry.RegisterInterface("cosmwasm.wasm.v1.ContractAuthzFilterX", (*ContractAuthzFilterX)(nil)) @@ -103,6 +114,23 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + + // legacy gov v1beta1 types that may be used for unmarshalling stored gov data + registry.RegisterImplementations( + (*v1beta1.Content)(nil), + &StoreCodeProposal{}, + &InstantiateContractProposal{}, + &InstantiateContract2Proposal{}, + &MigrateContractProposal{}, + &SudoContractProposal{}, + &ExecuteContractProposal{}, + &UpdateAdminProposal{}, + &ClearAdminProposal{}, + &PinCodesProposal{}, + &UnpinCodesProposal{}, + &UpdateInstantiateConfigProposal{}, + &StoreAndInstantiateContractProposal{}, + ) } var ( diff --git a/x/wasm/types/proposal_legacy.go b/x/wasm/types/proposal_legacy.go new file mode 100644 index 0000000000..9745e4772e --- /dev/null +++ b/x/wasm/types/proposal_legacy.go @@ -0,0 +1,804 @@ +package types + +import ( + "encoding/base64" + "encoding/hex" + "fmt" + "strings" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +type ProposalType string + +const ( + ProposalTypeStoreCode ProposalType = "StoreCode" + ProposalTypeInstantiateContract ProposalType = "InstantiateContract" + ProposalTypeInstantiateContract2 ProposalType = "InstantiateContract2" + ProposalTypeMigrateContract ProposalType = "MigrateContract" + ProposalTypeSudoContract ProposalType = "SudoContract" + ProposalTypeExecuteContract ProposalType = "ExecuteContract" + ProposalTypeUpdateAdmin ProposalType = "UpdateAdmin" + ProposalTypeClearAdmin ProposalType = "ClearAdmin" + ProposalTypePinCodes ProposalType = "PinCodes" + ProposalTypeUnpinCodes ProposalType = "UnpinCodes" + ProposalTypeUpdateInstantiateConfig ProposalType = "UpdateInstantiateConfig" + ProposalTypeStoreAndInstantiateContractProposal ProposalType = "StoreAndInstantiateContract" +) + +// DisableAllProposals contains no wasm gov types. +// Deprecated: all gov v1beta1 types will be removed +var DisableAllProposals []ProposalType + +// EnableAllProposals contains all wasm gov types as keys. +// Deprecated: all gov v1beta1 types will be removed +var EnableAllProposals = []ProposalType{ + ProposalTypeStoreCode, + ProposalTypeInstantiateContract, + ProposalTypeInstantiateContract2, + ProposalTypeMigrateContract, + ProposalTypeSudoContract, + ProposalTypeExecuteContract, + ProposalTypeUpdateAdmin, + ProposalTypeClearAdmin, + ProposalTypePinCodes, + ProposalTypeUnpinCodes, + ProposalTypeUpdateInstantiateConfig, + ProposalTypeStoreAndInstantiateContractProposal, +} + +// Deprecated: all gov v1beta1 types will be removed +func init() { // register new content types with the sdk + v1beta1.RegisterProposalType(string(ProposalTypeStoreCode)) + v1beta1.RegisterProposalType(string(ProposalTypeInstantiateContract)) + v1beta1.RegisterProposalType(string(ProposalTypeInstantiateContract2)) + v1beta1.RegisterProposalType(string(ProposalTypeMigrateContract)) + v1beta1.RegisterProposalType(string(ProposalTypeSudoContract)) + v1beta1.RegisterProposalType(string(ProposalTypeExecuteContract)) + v1beta1.RegisterProposalType(string(ProposalTypeUpdateAdmin)) + v1beta1.RegisterProposalType(string(ProposalTypeClearAdmin)) + v1beta1.RegisterProposalType(string(ProposalTypePinCodes)) + v1beta1.RegisterProposalType(string(ProposalTypeUnpinCodes)) + v1beta1.RegisterProposalType(string(ProposalTypeUpdateInstantiateConfig)) + v1beta1.RegisterProposalType(string(ProposalTypeStoreAndInstantiateContractProposal)) +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p StoreCodeProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *StoreCodeProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p StoreCodeProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p StoreCodeProposal) ProposalType() string { return string(ProposalTypeStoreCode) } + +// ValidateBasic validates the proposal +func (p StoreCodeProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { + return errorsmod.Wrap(err, "run as") + } + + if err := validateWasmCode(p.WASMByteCode, MaxProposalWasmSize); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "code bytes %s", err.Error()) + } + + if p.InstantiatePermission != nil { + if err := p.InstantiatePermission.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "instantiate permission") + } + } + + if err := ValidateVerificationInfo(p.Source, p.Builder, p.CodeHash); err != nil { + return errorsmod.Wrapf(err, "code verification info") + } + return nil +} + +// String implements the Stringer interface. +func (p StoreCodeProposal) String() string { + return fmt.Sprintf(`Store Code Proposal: + Title: %s + Description: %s + Run as: %s + WasmCode: %X + Source: %s + Builder: %s + Code Hash: %X +`, p.Title, p.Description, p.RunAs, p.WASMByteCode, p.Source, p.Builder, p.CodeHash) +} + +// MarshalYAML pretty prints the wasm byte code +func (p StoreCodeProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + RunAs string `yaml:"run_as"` + WASMByteCode string `yaml:"wasm_byte_code"` + InstantiatePermission *AccessConfig `yaml:"instantiate_permission"` + Source string `yaml:"source"` + Builder string `yaml:"builder"` + CodeHash string `yaml:"code_hash"` + }{ + Title: p.Title, + Description: p.Description, + RunAs: p.RunAs, + WASMByteCode: base64.StdEncoding.EncodeToString(p.WASMByteCode), + InstantiatePermission: p.InstantiatePermission, + Source: p.Source, + Builder: p.Builder, + CodeHash: hex.EncodeToString(p.CodeHash), + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p InstantiateContractProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *InstantiateContractProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p InstantiateContractProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p InstantiateContractProposal) ProposalType() string { + return string(ProposalTypeInstantiateContract) +} + +// ValidateBasic validates the proposal +func (p InstantiateContractProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "run as") + } + + if p.CodeID == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") + } + + if err := ValidateLabel(p.Label); err != nil { + return err + } + + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + + if len(p.Admin) != 0 { + if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { + return err + } + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p InstantiateContractProposal) String() string { + return fmt.Sprintf(`Instantiate Code Proposal: + Title: %s + Description: %s + Run as: %s + Admin: %s + Code id: %d + Label: %s + Msg: %q + Funds: %s +`, p.Title, p.Description, p.RunAs, p.Admin, p.CodeID, p.Label, p.Msg, p.Funds) +} + +// MarshalYAML pretty prints the init message +func (p InstantiateContractProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + RunAs string `yaml:"run_as"` + Admin string `yaml:"admin"` + CodeID uint64 `yaml:"code_id"` + Label string `yaml:"label"` + Msg string `yaml:"msg"` + Funds sdk.Coins `yaml:"funds"` + }{ + Title: p.Title, + Description: p.Description, + RunAs: p.RunAs, + Admin: p.Admin, + CodeID: p.CodeID, + Label: p.Label, + Msg: string(p.Msg), + Funds: p.Funds, + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p InstantiateContract2Proposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *InstantiateContract2Proposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p InstantiateContract2Proposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p InstantiateContract2Proposal) ProposalType() string { + return string(ProposalTypeInstantiateContract2) +} + +// ValidateBasic validates the proposal +func (p InstantiateContract2Proposal) ValidateBasic() error { + // Validate title and description + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + // Validate run as + if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "run as") + } + // Validate admin + if len(p.Admin) != 0 { + if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { + return err + } + } + // Validate codeid + if p.CodeID == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") + } + // Validate label + if err := ValidateLabel(p.Label); err != nil { + return err + } + // Validate msg + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + // Validate funds + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + // Validate salt + if len(p.Salt) == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "salt is required") + } + return nil +} + +// String implements the Stringer interface. +func (p InstantiateContract2Proposal) String() string { + return fmt.Sprintf(`Instantiate Code Proposal: + Title: %s + Description: %s + Run as: %s + Admin: %s + Code id: %d + Label: %s + Msg: %q + Funds: %s + Salt: %X +`, p.Title, p.Description, p.RunAs, p.Admin, p.CodeID, p.Label, p.Msg, p.Funds, p.Salt) +} + +// MarshalYAML pretty prints the init message +func (p InstantiateContract2Proposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + RunAs string `yaml:"run_as"` + Admin string `yaml:"admin"` + CodeID uint64 `yaml:"code_id"` + Label string `yaml:"label"` + Msg string `yaml:"msg"` + Funds sdk.Coins `yaml:"funds"` + Salt string `yaml:"salt"` + }{ + Title: p.Title, + Description: p.Description, + RunAs: p.RunAs, + Admin: p.Admin, + CodeID: p.CodeID, + Label: p.Label, + Msg: string(p.Msg), + Funds: p.Funds, + Salt: base64.StdEncoding.EncodeToString(p.Salt), + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p StoreAndInstantiateContractProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *StoreAndInstantiateContractProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p StoreAndInstantiateContractProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p StoreAndInstantiateContractProposal) ProposalType() string { + return string(ProposalTypeStoreAndInstantiateContractProposal) +} + +// ValidateBasic validates the proposal +func (p StoreAndInstantiateContractProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { + return errorsmod.Wrap(err, "run as") + } + + if err := validateWasmCode(p.WASMByteCode, MaxProposalWasmSize); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "code bytes %s", err.Error()) + } + + if err := ValidateVerificationInfo(p.Source, p.Builder, p.CodeHash); err != nil { + return errorsmod.Wrap(err, "code info") + } + + if p.InstantiatePermission != nil { + if err := p.InstantiatePermission.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "instantiate permission") + } + } + + if err := ValidateLabel(p.Label); err != nil { + return err + } + + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + + if len(p.Admin) != 0 { + if _, err := sdk.AccAddressFromBech32(p.Admin); err != nil { + return err + } + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p StoreAndInstantiateContractProposal) String() string { + return fmt.Sprintf(`Store And Instantiate Coontract Proposal: + Title: %s + Description: %s + Run as: %s + WasmCode: %X + Source: %s + Builder: %s + Code Hash: %X + Instantiate permission: %s + Unpin code: %t + Admin: %s + Label: %s + Msg: %q + Funds: %s +`, p.Title, p.Description, p.RunAs, p.WASMByteCode, p.Source, p.Builder, p.CodeHash, p.InstantiatePermission, p.UnpinCode, p.Admin, p.Label, p.Msg, p.Funds) +} + +// MarshalYAML pretty prints the wasm byte code and the init message +func (p StoreAndInstantiateContractProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + RunAs string `yaml:"run_as"` + WASMByteCode string `yaml:"wasm_byte_code"` + Source string `yaml:"source"` + Builder string `yaml:"builder"` + CodeHash string `yaml:"code_hash"` + InstantiatePermission *AccessConfig `yaml:"instantiate_permission"` + UnpinCode bool `yaml:"unpin_code"` + Admin string `yaml:"admin"` + Label string `yaml:"label"` + Msg string `yaml:"msg"` + Funds sdk.Coins `yaml:"funds"` + }{ + Title: p.Title, + Description: p.Description, + RunAs: p.RunAs, + WASMByteCode: base64.StdEncoding.EncodeToString(p.WASMByteCode), + InstantiatePermission: p.InstantiatePermission, + UnpinCode: p.UnpinCode, + Admin: p.Admin, + Label: p.Label, + Source: p.Source, + Builder: p.Builder, + CodeHash: hex.EncodeToString(p.CodeHash), + Msg: string(p.Msg), + Funds: p.Funds, + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p MigrateContractProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *MigrateContractProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p MigrateContractProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p MigrateContractProposal) ProposalType() string { return string(ProposalTypeMigrateContract) } + +// ValidateBasic validates the proposal +func (p MigrateContractProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if p.CodeID == 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "code_id is required") + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p MigrateContractProposal) String() string { + return fmt.Sprintf(`Migrate Contract Proposal: + Title: %s + Description: %s + Contract: %s + Code id: %d + Msg: %q +`, p.Title, p.Description, p.Contract, p.CodeID, p.Msg) +} + +// MarshalYAML pretty prints the migrate message +func (p MigrateContractProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + Contract string `yaml:"contract"` + CodeID uint64 `yaml:"code_id"` + Msg string `yaml:"msg"` + }{ + Title: p.Title, + Description: p.Description, + Contract: p.Contract, + CodeID: p.CodeID, + Msg: string(p.Msg), + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p SudoContractProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *SudoContractProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p SudoContractProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p SudoContractProposal) ProposalType() string { return string(ProposalTypeSudoContract) } + +// ValidateBasic validates the proposal +func (p SudoContractProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p SudoContractProposal) String() string { + return fmt.Sprintf(`Migrate Contract Proposal: + Title: %s + Description: %s + Contract: %s + Msg: %q +`, p.Title, p.Description, p.Contract, p.Msg) +} + +// MarshalYAML pretty prints the migrate message +func (p SudoContractProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + Contract string `yaml:"contract"` + Msg string `yaml:"msg"` + }{ + Title: p.Title, + Description: p.Description, + Contract: p.Contract, + Msg: string(p.Msg), + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p ExecuteContractProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *ExecuteContractProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p ExecuteContractProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p ExecuteContractProposal) ProposalType() string { return string(ProposalTypeExecuteContract) } + +// ValidateBasic validates the proposal +func (p ExecuteContractProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if _, err := sdk.AccAddressFromBech32(p.RunAs); err != nil { + return errorsmod.Wrap(err, "run as") + } + if !p.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + if err := p.Msg.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "payload msg") + } + return nil +} + +// String implements the Stringer interface. +func (p ExecuteContractProposal) String() string { + return fmt.Sprintf(`Migrate Contract Proposal: + Title: %s + Description: %s + Contract: %s + Run as: %s + Msg: %q + Funds: %s +`, p.Title, p.Description, p.Contract, p.RunAs, p.Msg, p.Funds) +} + +// MarshalYAML pretty prints the migrate message +func (p ExecuteContractProposal) MarshalYAML() (interface{}, error) { + return struct { + Title string `yaml:"title"` + Description string `yaml:"description"` + Contract string `yaml:"contract"` + Msg string `yaml:"msg"` + RunAs string `yaml:"run_as"` + Funds sdk.Coins `yaml:"funds"` + }{ + Title: p.Title, + Description: p.Description, + Contract: p.Contract, + Msg: string(p.Msg), + RunAs: p.RunAs, + Funds: p.Funds, + }, nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p UpdateAdminProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *UpdateAdminProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p UpdateAdminProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p UpdateAdminProposal) ProposalType() string { return string(ProposalTypeUpdateAdmin) } + +// ValidateBasic validates the proposal +func (p UpdateAdminProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + if _, err := sdk.AccAddressFromBech32(p.NewAdmin); err != nil { + return errorsmod.Wrap(err, "new admin") + } + return nil +} + +// String implements the Stringer interface. +func (p UpdateAdminProposal) String() string { + return fmt.Sprintf(`Update Contract Admin Proposal: + Title: %s + Description: %s + Contract: %s + New Admin: %s +`, p.Title, p.Description, p.Contract, p.NewAdmin) +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p ClearAdminProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *ClearAdminProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p ClearAdminProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p ClearAdminProposal) ProposalType() string { return string(ProposalTypeClearAdmin) } + +// ValidateBasic validates the proposal +func (p ClearAdminProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + return nil +} + +// String implements the Stringer interface. +func (p ClearAdminProposal) String() string { + return fmt.Sprintf(`Clear Contract Admin Proposal: + Title: %s + Description: %s + Contract: %s +`, p.Title, p.Description, p.Contract) +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p PinCodesProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *PinCodesProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p PinCodesProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p PinCodesProposal) ProposalType() string { return string(ProposalTypePinCodes) } + +// ValidateBasic validates the proposal +func (p PinCodesProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if len(p.CodeIDs) == 0 { + return errorsmod.Wrap(ErrEmpty, "code ids") + } + return nil +} + +// String implements the Stringer interface. +func (p PinCodesProposal) String() string { + return fmt.Sprintf(`Pin Wasm Codes Proposal: + Title: %s + Description: %s + Codes: %v +`, p.Title, p.Description, p.CodeIDs) +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p UnpinCodesProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *UnpinCodesProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p UnpinCodesProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p UnpinCodesProposal) ProposalType() string { return string(ProposalTypeUnpinCodes) } + +// ValidateBasic validates the proposal +func (p UnpinCodesProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if len(p.CodeIDs) == 0 { + return errorsmod.Wrap(ErrEmpty, "code ids") + } + return nil +} + +// String implements the Stringer interface. +func (p UnpinCodesProposal) String() string { + return fmt.Sprintf(`Unpin Wasm Codes Proposal: + Title: %s + Description: %s + Codes: %v +`, p.Title, p.Description, p.CodeIDs) +} + +func validateProposalCommons(title, description string) error { + if strings.TrimSpace(title) != title { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal title must not start/end with white spaces") + } + if len(title) == 0 { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal title cannot be blank") + } + if len(title) > v1beta1.MaxTitleLength { + return errorsmod.Wrapf(govtypes.ErrInvalidProposalContent, "proposal title is longer than max length of %d", v1beta1.MaxTitleLength) + } + if strings.TrimSpace(description) != description { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal description must not start/end with white spaces") + } + if len(description) == 0 { + return errorsmod.Wrap(govtypes.ErrInvalidProposalContent, "proposal description cannot be blank") + } + if len(description) > v1beta1.MaxDescriptionLength { + return errorsmod.Wrapf(govtypes.ErrInvalidProposalContent, "proposal description is longer than max length of %d", v1beta1.MaxDescriptionLength) + } + return nil +} + +// ProposalRoute returns the routing key of a parameter change proposal. +func (p UpdateInstantiateConfigProposal) ProposalRoute() string { return RouterKey } + +// GetTitle returns the title of the proposal +func (p *UpdateInstantiateConfigProposal) GetTitle() string { return p.Title } + +// GetDescription returns the human readable description of the proposal +func (p UpdateInstantiateConfigProposal) GetDescription() string { return p.Description } + +// ProposalType returns the type +func (p UpdateInstantiateConfigProposal) ProposalType() string { + return string(ProposalTypeUpdateInstantiateConfig) +} + +// ValidateBasic validates the proposal +func (p UpdateInstantiateConfigProposal) ValidateBasic() error { + if err := validateProposalCommons(p.Title, p.Description); err != nil { + return err + } + if len(p.AccessConfigUpdates) == 0 { + return errorsmod.Wrap(ErrEmpty, "code updates") + } + dedup := make(map[uint64]bool) + for _, codeUpdate := range p.AccessConfigUpdates { + _, found := dedup[codeUpdate.CodeID] + if found { + return errorsmod.Wrapf(ErrDuplicate, "duplicate code: %d", codeUpdate.CodeID) + } + if err := codeUpdate.InstantiatePermission.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "instantiate permission") + } + dedup[codeUpdate.CodeID] = true + } + return nil +} + +// String implements the Stringer interface. +func (p UpdateInstantiateConfigProposal) String() string { + return fmt.Sprintf(`Update Instantiate Config Proposal: + Title: %s + Description: %s + AccessConfigUpdates: %v +`, p.Title, p.Description, p.AccessConfigUpdates) +} + +// String implements the Stringer interface. +func (c AccessConfigUpdate) String() string { + return fmt.Sprintf(`AccessConfigUpdate: + CodeID: %d + AccessConfig: %v +`, c.CodeID, c.InstantiatePermission) +} diff --git a/x/wasm/types/proposal_legacy.pb.go b/x/wasm/types/proposal_legacy.pb.go new file mode 100644 index 0000000000..f91fa0ba3f --- /dev/null +++ b/x/wasm/types/proposal_legacy.pb.go @@ -0,0 +1,5859 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmwasm/wasm/v1/proposal_legacy.proto + +package types + +import ( + bytes "bytes" + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreCodeProposal. To submit WASM code to the system, +// a simple MsgStoreCode can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type StoreCodeProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // RunAs is the address that is passed to the contract's environment as sender + RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` + // WASMByteCode can be raw or gzip compressed + WASMByteCode []byte `protobuf:"bytes,4,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` + // InstantiatePermission to apply on contract creation, optional + InstantiatePermission *AccessConfig `protobuf:"bytes,7,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"` + // UnpinCode code on upload, optional + UnpinCode bool `protobuf:"varint,8,opt,name=unpin_code,json=unpinCode,proto3" json:"unpin_code,omitempty"` + // Source is the URL where the code is hosted + Source string `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + Builder string `protobuf:"bytes,10,opt,name=builder,proto3" json:"builder,omitempty"` + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + CodeHash []byte `protobuf:"bytes,11,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` +} + +func (m *StoreCodeProposal) Reset() { *m = StoreCodeProposal{} } +func (*StoreCodeProposal) ProtoMessage() {} +func (*StoreCodeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{0} +} + +func (m *StoreCodeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *StoreCodeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoreCodeProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *StoreCodeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoreCodeProposal.Merge(m, src) +} + +func (m *StoreCodeProposal) XXX_Size() int { + return m.Size() +} + +func (m *StoreCodeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_StoreCodeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_StoreCodeProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContractProposal. To instantiate a contract, +// a simple MsgInstantiateContract can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type InstantiateContractProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // RunAs is the address that is passed to the contract's environment as sender + RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` + // Admin is an optional address that can execute migrations + Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"` + // CodeID is the reference to the stored WASM code + CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // Label is optional metadata to be stored with a constract instance. + Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` + // Msg json encoded message to be passed to the contract on instantiation + Msg RawContractMessage `protobuf:"bytes,7,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` + // Funds coins that are transferred to the contract on instantiation + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` +} + +func (m *InstantiateContractProposal) Reset() { *m = InstantiateContractProposal{} } +func (*InstantiateContractProposal) ProtoMessage() {} +func (*InstantiateContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{1} +} + +func (m *InstantiateContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *InstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InstantiateContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *InstantiateContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_InstantiateContractProposal.Merge(m, src) +} + +func (m *InstantiateContractProposal) XXX_Size() int { + return m.Size() +} + +func (m *InstantiateContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_InstantiateContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_InstantiateContractProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContract2Proposal. To instantiate contract 2, +// a simple MsgInstantiateContract2 can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type InstantiateContract2Proposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // RunAs is the address that is passed to the contract's environment as sender + RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` + // Admin is an optional address that can execute migrations + Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"` + // CodeID is the reference to the stored WASM code + CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // Label is optional metadata to be stored with a constract instance. + Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"` + // Msg json encode message to be passed to the contract on instantiation + Msg RawContractMessage `protobuf:"bytes,7,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` + // Funds coins that are transferred to the contract on instantiation + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + Salt []byte `protobuf:"bytes,9,opt,name=salt,proto3" json:"salt,omitempty"` + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + FixMsg bool `protobuf:"varint,10,opt,name=fix_msg,json=fixMsg,proto3" json:"fix_msg,omitempty"` +} + +func (m *InstantiateContract2Proposal) Reset() { *m = InstantiateContract2Proposal{} } +func (*InstantiateContract2Proposal) ProtoMessage() {} +func (*InstantiateContract2Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{2} +} + +func (m *InstantiateContract2Proposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *InstantiateContract2Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InstantiateContract2Proposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *InstantiateContract2Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_InstantiateContract2Proposal.Merge(m, src) +} + +func (m *InstantiateContract2Proposal) XXX_Size() int { + return m.Size() +} + +func (m *InstantiateContract2Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_InstantiateContract2Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_InstantiateContract2Proposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit MigrateContractProposal. To migrate a contract, +// a simple MsgMigrateContract can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type MigrateContractProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` + // CodeID references the new WASM code + CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // Msg json encoded message to be passed to the contract on migration + Msg RawContractMessage `protobuf:"bytes,6,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` +} + +func (m *MigrateContractProposal) Reset() { *m = MigrateContractProposal{} } +func (*MigrateContractProposal) ProtoMessage() {} +func (*MigrateContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{3} +} + +func (m *MigrateContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *MigrateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MigrateContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *MigrateContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MigrateContractProposal.Merge(m, src) +} + +func (m *MigrateContractProposal) XXX_Size() int { + return m.Size() +} + +func (m *MigrateContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MigrateContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MigrateContractProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit SudoContractProposal. To call sudo on a contract, +// a simple MsgSudoContract can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type SudoContractProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` + // Msg json encoded message to be passed to the contract as sudo + Msg RawContractMessage `protobuf:"bytes,4,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` +} + +func (m *SudoContractProposal) Reset() { *m = SudoContractProposal{} } +func (*SudoContractProposal) ProtoMessage() {} +func (*SudoContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{4} +} + +func (m *SudoContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *SudoContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SudoContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *SudoContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SudoContractProposal.Merge(m, src) +} + +func (m *SudoContractProposal) XXX_Size() int { + return m.Size() +} + +func (m *SudoContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SudoContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SudoContractProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ExecuteContractProposal. To call execute on a contract, +// a simple MsgExecuteContract can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type ExecuteContractProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // RunAs is the address that is passed to the contract's environment as sender + RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` + // Msg json encoded message to be passed to the contract as execute + Msg RawContractMessage `protobuf:"bytes,5,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` + // Funds coins that are transferred to the contract on instantiation + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` +} + +func (m *ExecuteContractProposal) Reset() { *m = ExecuteContractProposal{} } +func (*ExecuteContractProposal) ProtoMessage() {} +func (*ExecuteContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{5} +} + +func (m *ExecuteContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *ExecuteContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExecuteContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *ExecuteContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExecuteContractProposal.Merge(m, src) +} + +func (m *ExecuteContractProposal) XXX_Size() int { + return m.Size() +} + +func (m *ExecuteContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ExecuteContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ExecuteContractProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateAdminProposal. To set an admin for a contract, +// a simple MsgUpdateAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type UpdateAdminProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // NewAdmin address to be set + NewAdmin string `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3" json:"new_admin,omitempty" yaml:"new_admin"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,4,opt,name=contract,proto3" json:"contract,omitempty"` +} + +func (m *UpdateAdminProposal) Reset() { *m = UpdateAdminProposal{} } +func (*UpdateAdminProposal) ProtoMessage() {} +func (*UpdateAdminProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{6} +} + +func (m *UpdateAdminProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *UpdateAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateAdminProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *UpdateAdminProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateAdminProposal.Merge(m, src) +} + +func (m *UpdateAdminProposal) XXX_Size() int { + return m.Size() +} + +func (m *UpdateAdminProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateAdminProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateAdminProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ClearAdminProposal. To clear the admin of a contract, +// a simple MsgClearAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type ClearAdminProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` +} + +func (m *ClearAdminProposal) Reset() { *m = ClearAdminProposal{} } +func (*ClearAdminProposal) ProtoMessage() {} +func (*ClearAdminProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{7} +} + +func (m *ClearAdminProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *ClearAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClearAdminProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *ClearAdminProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearAdminProposal.Merge(m, src) +} + +func (m *ClearAdminProposal) XXX_Size() int { + return m.Size() +} + +func (m *ClearAdminProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ClearAdminProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearAdminProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +// cache, a simple MsgPinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type PinCodesProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // CodeIDs references the new WASM codes + CodeIDs []uint64 `protobuf:"varint,3,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty" yaml:"code_ids"` +} + +func (m *PinCodesProposal) Reset() { *m = PinCodesProposal{} } +func (*PinCodesProposal) ProtoMessage() {} +func (*PinCodesProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{8} +} + +func (m *PinCodesProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *PinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PinCodesProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *PinCodesProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_PinCodesProposal.Merge(m, src) +} + +func (m *PinCodesProposal) XXX_Size() int { + return m.Size() +} + +func (m *PinCodesProposal) XXX_DiscardUnknown() { + xxx_messageInfo_PinCodesProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_PinCodesProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +// +// Deprecated: Do not use. +type UnpinCodesProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // CodeIDs references the WASM codes + CodeIDs []uint64 `protobuf:"varint,3,rep,packed,name=code_ids,json=codeIds,proto3" json:"code_ids,omitempty" yaml:"code_ids"` +} + +func (m *UnpinCodesProposal) Reset() { *m = UnpinCodesProposal{} } +func (*UnpinCodesProposal) ProtoMessage() {} +func (*UnpinCodesProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{9} +} + +func (m *UnpinCodesProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *UnpinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UnpinCodesProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *UnpinCodesProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnpinCodesProposal.Merge(m, src) +} + +func (m *UnpinCodesProposal) XXX_Size() int { + return m.Size() +} + +func (m *UnpinCodesProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UnpinCodesProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UnpinCodesProposal proto.InternalMessageInfo + +// AccessConfigUpdate contains the code id and the access config to be +// applied. +type AccessConfigUpdate struct { + // CodeID is the reference to the stored WASM code to be updated + CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // InstantiatePermission to apply to the set of code ids + InstantiatePermission AccessConfig `protobuf:"bytes,2,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission"` +} + +func (m *AccessConfigUpdate) Reset() { *m = AccessConfigUpdate{} } +func (*AccessConfigUpdate) ProtoMessage() {} +func (*AccessConfigUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{10} +} + +func (m *AccessConfigUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *AccessConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccessConfigUpdate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *AccessConfigUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccessConfigUpdate.Merge(m, src) +} + +func (m *AccessConfigUpdate) XXX_Size() int { + return m.Size() +} + +func (m *AccessConfigUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_AccessConfigUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_AccessConfigUpdate proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateInstantiateConfigProposal. To update instantiate config +// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +// the x/gov module via a v1 governance proposal. +// +// Deprecated: Do not use. +type UpdateInstantiateConfigProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty" yaml:"title"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + // AccessConfigUpdate contains the list of code ids and the access config + // to be applied. + AccessConfigUpdates []AccessConfigUpdate `protobuf:"bytes,3,rep,name=access_config_updates,json=accessConfigUpdates,proto3" json:"access_config_updates"` +} + +func (m *UpdateInstantiateConfigProposal) Reset() { *m = UpdateInstantiateConfigProposal{} } +func (*UpdateInstantiateConfigProposal) ProtoMessage() {} +func (*UpdateInstantiateConfigProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{11} +} + +func (m *UpdateInstantiateConfigProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *UpdateInstantiateConfigProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpdateInstantiateConfigProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *UpdateInstantiateConfigProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateInstantiateConfigProposal.Merge(m, src) +} + +func (m *UpdateInstantiateConfigProposal) XXX_Size() int { + return m.Size() +} + +func (m *UpdateInstantiateConfigProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateInstantiateConfigProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateInstantiateConfigProposal proto.InternalMessageInfo + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreAndInstantiateContractProposal. To store and instantiate +// the contract, a simple MsgStoreAndInstantiateContract can be invoked from +// the x/gov module via a v1 governance proposal. +// +// Deprecated: Do not use. +type StoreAndInstantiateContractProposal struct { + // Title is a short summary + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // Description is a human readable text + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // RunAs is the address that is passed to the contract's environment as sender + RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"` + // WASMByteCode can be raw or gzip compressed + WASMByteCode []byte `protobuf:"bytes,4,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` + // InstantiatePermission to apply on contract creation, optional + InstantiatePermission *AccessConfig `protobuf:"bytes,5,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"` + // UnpinCode code on upload, optional + UnpinCode bool `protobuf:"varint,6,opt,name=unpin_code,json=unpinCode,proto3" json:"unpin_code,omitempty"` + // Admin is an optional address that can execute migrations + Admin string `protobuf:"bytes,7,opt,name=admin,proto3" json:"admin,omitempty"` + // Label is optional metadata to be stored with a constract instance. + Label string `protobuf:"bytes,8,opt,name=label,proto3" json:"label,omitempty"` + // Msg json encoded message to be passed to the contract on instantiation + Msg RawContractMessage `protobuf:"bytes,9,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` + // Funds coins that are transferred to the contract on instantiation + Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,10,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` + // Source is the URL where the code is hosted + Source string `protobuf:"bytes,11,opt,name=source,proto3" json:"source,omitempty"` + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + Builder string `protobuf:"bytes,12,opt,name=builder,proto3" json:"builder,omitempty"` + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + CodeHash []byte `protobuf:"bytes,13,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` +} + +func (m *StoreAndInstantiateContractProposal) Reset() { *m = StoreAndInstantiateContractProposal{} } +func (*StoreAndInstantiateContractProposal) ProtoMessage() {} +func (*StoreAndInstantiateContractProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_68e9c908a42bedfa, []int{12} +} + +func (m *StoreAndInstantiateContractProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *StoreAndInstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoreAndInstantiateContractProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} + +func (m *StoreAndInstantiateContractProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoreAndInstantiateContractProposal.Merge(m, src) +} + +func (m *StoreAndInstantiateContractProposal) XXX_Size() int { + return m.Size() +} + +func (m *StoreAndInstantiateContractProposal) XXX_DiscardUnknown() { + xxx_messageInfo_StoreAndInstantiateContractProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_StoreAndInstantiateContractProposal proto.InternalMessageInfo + +func init() { + proto.RegisterType((*StoreCodeProposal)(nil), "cosmwasm.wasm.v1.StoreCodeProposal") + proto.RegisterType((*InstantiateContractProposal)(nil), "cosmwasm.wasm.v1.InstantiateContractProposal") + proto.RegisterType((*InstantiateContract2Proposal)(nil), "cosmwasm.wasm.v1.InstantiateContract2Proposal") + proto.RegisterType((*MigrateContractProposal)(nil), "cosmwasm.wasm.v1.MigrateContractProposal") + proto.RegisterType((*SudoContractProposal)(nil), "cosmwasm.wasm.v1.SudoContractProposal") + proto.RegisterType((*ExecuteContractProposal)(nil), "cosmwasm.wasm.v1.ExecuteContractProposal") + proto.RegisterType((*UpdateAdminProposal)(nil), "cosmwasm.wasm.v1.UpdateAdminProposal") + proto.RegisterType((*ClearAdminProposal)(nil), "cosmwasm.wasm.v1.ClearAdminProposal") + proto.RegisterType((*PinCodesProposal)(nil), "cosmwasm.wasm.v1.PinCodesProposal") + proto.RegisterType((*UnpinCodesProposal)(nil), "cosmwasm.wasm.v1.UnpinCodesProposal") + proto.RegisterType((*AccessConfigUpdate)(nil), "cosmwasm.wasm.v1.AccessConfigUpdate") + proto.RegisterType((*UpdateInstantiateConfigProposal)(nil), "cosmwasm.wasm.v1.UpdateInstantiateConfigProposal") + proto.RegisterType((*StoreAndInstantiateContractProposal)(nil), "cosmwasm.wasm.v1.StoreAndInstantiateContractProposal") +} + +func init() { + proto.RegisterFile("cosmwasm/wasm/v1/proposal_legacy.proto", fileDescriptor_68e9c908a42bedfa) +} + +var fileDescriptor_68e9c908a42bedfa = []byte{ + // 1194 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcb, 0x6f, 0x1b, 0x45, + 0x18, 0xf7, 0xc4, 0xf6, 0xda, 0x1e, 0x1b, 0x70, 0xb7, 0x69, 0x32, 0x6d, 0xc3, 0xae, 0xd9, 0x56,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, 0x27, 0x4a, 0xe2, 0xf1, 0x13, 0x25, 0x71, 0xaf, 0xaf, 0x80, 0x9d, 0xbe, + 0x02, 0x1e, 0xf5, 0x15, 0xf0, 0x67, 0x5f, 0x01, 0xdf, 0xee, 0x2a, 0x89, 0x47, 0xbb, 0x4a, 0xe2, + 0xf1, 0xae, 0x92, 0xf8, 0x62, 0x76, 0x88, 0xf9, 0xa2, 0x4f, 0xdb, 0x77, 0x07, 0x9f, 0x56, 0xec, + 0xea, 0x96, 0xf8, 0xc4, 0xc2, 0xd9, 0x37, 0x24, 0xfe, 0x35, 0xe5, 0xad, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xe5, 0x17, 0x08, 0x1e, 0x0b, 0x12, 0x00, 0x00, +} + +func (this *StoreCodeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*StoreCodeProposal) + if !ok { + that2, ok := that.(StoreCodeProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.RunAs != that1.RunAs { + return false + } + if !bytes.Equal(this.WASMByteCode, that1.WASMByteCode) { + return false + } + if !this.InstantiatePermission.Equal(that1.InstantiatePermission) { + return false + } + if this.UnpinCode != that1.UnpinCode { + return false + } + if this.Source != that1.Source { + return false + } + if this.Builder != that1.Builder { + return false + } + if !bytes.Equal(this.CodeHash, that1.CodeHash) { + return false + } + return true +} + +func (this *InstantiateContractProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*InstantiateContractProposal) + if !ok { + that2, ok := that.(InstantiateContractProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.RunAs != that1.RunAs { + return false + } + if this.Admin != that1.Admin { + return false + } + if this.CodeID != that1.CodeID { + return false + } + if this.Label != that1.Label { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + if len(this.Funds) != len(that1.Funds) { + return false + } + for i := range this.Funds { + if !this.Funds[i].Equal(&that1.Funds[i]) { + return false + } + } + return true +} + +func (this *InstantiateContract2Proposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*InstantiateContract2Proposal) + if !ok { + that2, ok := that.(InstantiateContract2Proposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.RunAs != that1.RunAs { + return false + } + if this.Admin != that1.Admin { + return false + } + if this.CodeID != that1.CodeID { + return false + } + if this.Label != that1.Label { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + if len(this.Funds) != len(that1.Funds) { + return false + } + for i := range this.Funds { + if !this.Funds[i].Equal(&that1.Funds[i]) { + return false + } + } + if !bytes.Equal(this.Salt, that1.Salt) { + return false + } + if this.FixMsg != that1.FixMsg { + return false + } + return true +} + +func (this *MigrateContractProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MigrateContractProposal) + if !ok { + that2, ok := that.(MigrateContractProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.Contract != that1.Contract { + return false + } + if this.CodeID != that1.CodeID { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + return true +} + +func (this *SudoContractProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SudoContractProposal) + if !ok { + that2, ok := that.(SudoContractProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.Contract != that1.Contract { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + return true +} + +func (this *ExecuteContractProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ExecuteContractProposal) + if !ok { + that2, ok := that.(ExecuteContractProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.RunAs != that1.RunAs { + return false + } + if this.Contract != that1.Contract { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + if len(this.Funds) != len(that1.Funds) { + return false + } + for i := range this.Funds { + if !this.Funds[i].Equal(&that1.Funds[i]) { + return false + } + } + return true +} + +func (this *UpdateAdminProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UpdateAdminProposal) + if !ok { + that2, ok := that.(UpdateAdminProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.NewAdmin != that1.NewAdmin { + return false + } + if this.Contract != that1.Contract { + return false + } + return true +} + +func (this *ClearAdminProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ClearAdminProposal) + if !ok { + that2, ok := that.(ClearAdminProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.Contract != that1.Contract { + return false + } + return true +} + +func (this *PinCodesProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*PinCodesProposal) + if !ok { + that2, ok := that.(PinCodesProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if len(this.CodeIDs) != len(that1.CodeIDs) { + return false + } + for i := range this.CodeIDs { + if this.CodeIDs[i] != that1.CodeIDs[i] { + return false + } + } + return true +} + +func (this *UnpinCodesProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UnpinCodesProposal) + if !ok { + that2, ok := that.(UnpinCodesProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if len(this.CodeIDs) != len(that1.CodeIDs) { + return false + } + for i := range this.CodeIDs { + if this.CodeIDs[i] != that1.CodeIDs[i] { + return false + } + } + return true +} + +func (this *AccessConfigUpdate) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*AccessConfigUpdate) + if !ok { + that2, ok := that.(AccessConfigUpdate) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.CodeID != that1.CodeID { + return false + } + if !this.InstantiatePermission.Equal(&that1.InstantiatePermission) { + return false + } + return true +} + +func (this *UpdateInstantiateConfigProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UpdateInstantiateConfigProposal) + if !ok { + that2, ok := that.(UpdateInstantiateConfigProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if len(this.AccessConfigUpdates) != len(that1.AccessConfigUpdates) { + return false + } + for i := range this.AccessConfigUpdates { + if !this.AccessConfigUpdates[i].Equal(&that1.AccessConfigUpdates[i]) { + return false + } + } + return true +} + +func (this *StoreAndInstantiateContractProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*StoreAndInstantiateContractProposal) + if !ok { + that2, ok := that.(StoreAndInstantiateContractProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if this.RunAs != that1.RunAs { + return false + } + if !bytes.Equal(this.WASMByteCode, that1.WASMByteCode) { + return false + } + if !this.InstantiatePermission.Equal(that1.InstantiatePermission) { + return false + } + if this.UnpinCode != that1.UnpinCode { + return false + } + if this.Admin != that1.Admin { + return false + } + if this.Label != that1.Label { + return false + } + if !bytes.Equal(this.Msg, that1.Msg) { + return false + } + if len(this.Funds) != len(that1.Funds) { + return false + } + for i := range this.Funds { + if !this.Funds[i].Equal(&that1.Funds[i]) { + return false + } + } + if this.Source != that1.Source { + return false + } + if this.Builder != that1.Builder { + return false + } + if !bytes.Equal(this.CodeHash, that1.CodeHash) { + return false + } + return true +} + +func (m *StoreCodeProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreCodeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreCodeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CodeHash) > 0 { + i -= len(m.CodeHash) + copy(dAtA[i:], m.CodeHash) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.CodeHash))) + i-- + dAtA[i] = 0x5a + } + if len(m.Builder) > 0 { + i -= len(m.Builder) + copy(dAtA[i:], m.Builder) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Builder))) + i-- + dAtA[i] = 0x52 + } + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x4a + } + if m.UnpinCode { + i-- + if m.UnpinCode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if m.InstantiatePermission != nil { + { + size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if len(m.WASMByteCode) > 0 { + i -= len(m.WASMByteCode) + copy(dAtA[i:], m.WASMByteCode) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.WASMByteCode))) + i-- + dAtA[i] = 0x22 + } + if len(m.RunAs) > 0 { + i -= len(m.RunAs) + copy(dAtA[i:], m.RunAs) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.RunAs))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InstantiateContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InstantiateContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InstantiateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x3a + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x32 + } + if m.CodeID != 0 { + i = encodeVarintProposalLegacy(dAtA, i, uint64(m.CodeID)) + i-- + dAtA[i] = 0x28 + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x22 + } + if len(m.RunAs) > 0 { + i -= len(m.RunAs) + copy(dAtA[i:], m.RunAs) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.RunAs))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InstantiateContract2Proposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InstantiateContract2Proposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InstantiateContract2Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FixMsg { + i-- + if m.FixMsg { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.Salt) > 0 { + i -= len(m.Salt) + copy(dAtA[i:], m.Salt) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Salt))) + i-- + dAtA[i] = 0x4a + } + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x3a + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x32 + } + if m.CodeID != 0 { + i = encodeVarintProposalLegacy(dAtA, i, uint64(m.CodeID)) + i-- + dAtA[i] = 0x28 + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x22 + } + if len(m.RunAs) > 0 { + i -= len(m.RunAs) + copy(dAtA[i:], m.RunAs) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.RunAs))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MigrateContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MigrateContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MigrateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x32 + } + if m.CodeID != 0 { + i = encodeVarintProposalLegacy(dAtA, i, uint64(m.CodeID)) + i-- + dAtA[i] = 0x28 + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x22 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SudoContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SudoContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SudoContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x22 + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ExecuteContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExecuteContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecuteContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x2a + } + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x22 + } + if len(m.RunAs) > 0 { + i -= len(m.RunAs) + copy(dAtA[i:], m.RunAs) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.RunAs))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateAdminProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateAdminProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateAdminProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x22 + } + if len(m.NewAdmin) > 0 { + i -= len(m.NewAdmin) + copy(dAtA[i:], m.NewAdmin) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.NewAdmin))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClearAdminProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClearAdminProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClearAdminProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Contract) > 0 { + i -= len(m.Contract) + copy(dAtA[i:], m.Contract) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PinCodesProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PinCodesProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PinCodesProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CodeIDs) > 0 { + dAtA3 := make([]byte, len(m.CodeIDs)*10) + var j2 int + for _, num := range m.CodeIDs { + for num >= 1<<7 { + dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA3[j2] = uint8(num) + j2++ + } + i -= j2 + copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintProposalLegacy(dAtA, i, uint64(j2)) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UnpinCodesProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UnpinCodesProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnpinCodesProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CodeIDs) > 0 { + dAtA5 := make([]byte, len(m.CodeIDs)*10) + var j4 int + for _, num := range m.CodeIDs { + for num >= 1<<7 { + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j4++ + } + dAtA5[j4] = uint8(num) + j4++ + } + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintProposalLegacy(dAtA, i, uint64(j4)) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AccessConfigUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AccessConfigUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccessConfigUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.CodeID != 0 { + i = encodeVarintProposalLegacy(dAtA, i, uint64(m.CodeID)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UpdateInstantiateConfigProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateInstantiateConfigProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateInstantiateConfigProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AccessConfigUpdates) > 0 { + for iNdEx := len(m.AccessConfigUpdates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AccessConfigUpdates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StoreAndInstantiateContractProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StoreAndInstantiateContractProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreAndInstantiateContractProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CodeHash) > 0 { + i -= len(m.CodeHash) + copy(dAtA[i:], m.CodeHash) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.CodeHash))) + i-- + dAtA[i] = 0x6a + } + if len(m.Builder) > 0 { + i -= len(m.Builder) + copy(dAtA[i:], m.Builder) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Builder))) + i-- + dAtA[i] = 0x62 + } + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x5a + } + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x4a + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x42 + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x3a + } + if m.UnpinCode { + i-- + if m.UnpinCode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.InstantiatePermission != nil { + { + size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProposalLegacy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.WASMByteCode) > 0 { + i -= len(m.WASMByteCode) + copy(dAtA[i:], m.WASMByteCode) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.WASMByteCode))) + i-- + dAtA[i] = 0x22 + } + if len(m.RunAs) > 0 { + i -= len(m.RunAs) + copy(dAtA[i:], m.RunAs) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.RunAs))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProposalLegacy(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintProposalLegacy(dAtA []byte, offset int, v uint64) int { + offset -= sovProposalLegacy(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} + +func (m *StoreCodeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.RunAs) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.WASMByteCode) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.InstantiatePermission != nil { + l = m.InstantiatePermission.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.UnpinCode { + n += 2 + } + l = len(m.Source) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Builder) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.CodeHash) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func (m *InstantiateContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.RunAs) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.CodeID != 0 { + n += 1 + sovProposalLegacy(uint64(m.CodeID)) + } + l = len(m.Label) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + } + return n +} + +func (m *InstantiateContract2Proposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.RunAs) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.CodeID != 0 { + n += 1 + sovProposalLegacy(uint64(m.CodeID)) + } + l = len(m.Label) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + } + l = len(m.Salt) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.FixMsg { + n += 2 + } + return n +} + +func (m *MigrateContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.CodeID != 0 { + n += 1 + sovProposalLegacy(uint64(m.CodeID)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func (m *SudoContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func (m *ExecuteContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.RunAs) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + } + return n +} + +func (m *UpdateAdminProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.NewAdmin) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func (m *ClearAdminProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func (m *PinCodesProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.CodeIDs) > 0 { + l = 0 + for _, e := range m.CodeIDs { + l += sovProposalLegacy(uint64(e)) + } + n += 1 + sovProposalLegacy(uint64(l)) + l + } + return n +} + +func (m *UnpinCodesProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.CodeIDs) > 0 { + l = 0 + for _, e := range m.CodeIDs { + l += sovProposalLegacy(uint64(e)) + } + n += 1 + sovProposalLegacy(uint64(l)) + l + } + return n +} + +func (m *AccessConfigUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CodeID != 0 { + n += 1 + sovProposalLegacy(uint64(m.CodeID)) + } + l = m.InstantiatePermission.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + return n +} + +func (m *UpdateInstantiateConfigProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.AccessConfigUpdates) > 0 { + for _, e := range m.AccessConfigUpdates { + l = e.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + } + return n +} + +func (m *StoreAndInstantiateContractProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.RunAs) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.WASMByteCode) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.InstantiatePermission != nil { + l = m.InstantiatePermission.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if m.UnpinCode { + n += 2 + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Label) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovProposalLegacy(uint64(l)) + } + } + l = len(m.Source) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.Builder) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + l = len(m.CodeHash) + if l > 0 { + n += 1 + l + sovProposalLegacy(uint64(l)) + } + return n +} + +func sovProposalLegacy(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} + +func sozProposalLegacy(x uint64) (n int) { + return sovProposalLegacy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} + +func (m *StoreCodeProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoreCodeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreCodeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) + if m.WASMByteCode == nil { + m.WASMByteCode = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InstantiatePermission == nil { + m.InstantiatePermission = &AccessConfig{} + } + if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnpinCode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UnpinCode = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Builder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Builder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CodeHash = append(m.CodeHash[:0], dAtA[iNdEx:postIndex]...) + if m.CodeHash == nil { + m.CodeHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InstantiateContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InstantiateContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *InstantiateContract2Proposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InstantiateContract2Proposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InstantiateContract2Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Salt = append(m.Salt[:0], dAtA[iNdEx:postIndex]...) + if m.Salt == nil { + m.Salt = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FixMsg", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FixMsg = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *MigrateContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MigrateContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MigrateContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *SudoContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SudoContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SudoContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *ExecuteContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExecuteContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExecuteContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *UpdateAdminProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateAdminProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateAdminProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewAdmin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *ClearAdminProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClearAdminProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClearAdminProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contract", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *PinCodesProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PinCodesProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PinCodesProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CodeIDs = append(m.CodeIDs, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.CodeIDs) == 0 { + m.CodeIDs = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CodeIDs = append(m.CodeIDs, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CodeIDs", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *UnpinCodesProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UnpinCodesProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UnpinCodesProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CodeIDs = append(m.CodeIDs, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.CodeIDs) == 0 { + m.CodeIDs = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CodeIDs = append(m.CodeIDs, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field CodeIDs", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *AccessConfigUpdate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AccessConfigUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccessConfigUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *UpdateInstantiateConfigProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateInstantiateConfigProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateInstantiateConfigProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccessConfigUpdates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AccessConfigUpdates = append(m.AccessConfigUpdates, AccessConfigUpdate{}) + if err := m.AccessConfigUpdates[len(m.AccessConfigUpdates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func (m *StoreAndInstantiateContractProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StoreAndInstantiateContractProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreAndInstantiateContractProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WASMByteCode", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WASMByteCode = append(m.WASMByteCode[:0], dAtA[iNdEx:postIndex]...) + if m.WASMByteCode == nil { + m.WASMByteCode = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InstantiatePermission == nil { + m.InstantiatePermission = &AccessConfig{} + } + if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnpinCode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UnpinCode = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Builder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Builder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthProposalLegacy + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthProposalLegacy + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CodeHash = append(m.CodeHash[:0], dAtA[iNdEx:postIndex]...) + if m.CodeHash == nil { + m.CodeHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProposalLegacy(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProposalLegacy + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skipProposalLegacy(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProposalLegacy + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthProposalLegacy + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupProposalLegacy + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthProposalLegacy + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthProposalLegacy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProposalLegacy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupProposalLegacy = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/wasm/types/proposal_legacy_test.go b/x/wasm/types/proposal_legacy_test.go new file mode 100644 index 0000000000..71318be453 --- /dev/null +++ b/x/wasm/types/proposal_legacy_test.go @@ -0,0 +1,1317 @@ +package types + +import ( + "bytes" + "encoding/hex" + "encoding/json" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" +) + +func TestValidateProposalCommons(t *testing.T) { + type commonProposal struct { + Title, Description string + } + + specs := map[string]struct { + src commonProposal + expErr bool + }{ + "all good": {src: commonProposal{ + Title: "Foo", + Description: "Bar", + }}, + "prevent empty title": { + src: commonProposal{ + Description: "Bar", + }, + expErr: true, + }, + "prevent white space only title": { + src: commonProposal{ + Title: " ", + Description: "Bar", + }, + expErr: true, + }, + "prevent leading white spaces in title": { + src: commonProposal{ + Title: " Foo", + Description: "Bar", + }, + expErr: true, + }, + "prevent title exceeds max length ": { + src: commonProposal{ + Title: strings.Repeat("a", v1beta1.MaxTitleLength+1), + Description: "Bar", + }, + expErr: true, + }, + "prevent empty description": { + src: commonProposal{ + Title: "Foo", + }, + expErr: true, + }, + "prevent leading white spaces in description": { + src: commonProposal{ + Title: "Foo", + Description: " Bar", + }, + expErr: true, + }, + "prevent white space only description": { + src: commonProposal{ + Title: "Foo", + Description: " ", + }, + expErr: true, + }, + "prevent descr exceeds max length ": { + src: commonProposal{ + Title: "Foo", + Description: strings.Repeat("a", v1beta1.MaxDescriptionLength+1), + }, + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := validateProposalCommons(spec.src.Title, spec.src.Description) + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateStoreCodeProposal(t *testing.T) { + var anyAddress sdk.AccAddress = bytes.Repeat([]byte{0x0}, ContractAddrLen) + + specs := map[string]struct { + src *StoreCodeProposal + expErr bool + }{ + "all good": { + src: StoreCodeProposalFixture(), + }, + "all good no code verification info": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.Source = "" + p.Builder = "" + p.CodeHash = nil + }), + }, + "source missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.Source = "" + }), + expErr: true, + }, + "builder missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.Builder = "" + }), + expErr: true, + }, + "code hash missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.CodeHash = nil + }), + expErr: true, + }, + "with instantiate permission": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + accessConfig := AccessTypeAnyOfAddresses.With(anyAddress) + p.InstantiatePermission = &accessConfig + }), + }, + "base data missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.Title = "" + }), + expErr: true, + }, + "run_as missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.RunAs = "" + }), + expErr: true, + }, + "run_as invalid": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.RunAs = invalidAddress + }), + expErr: true, + }, + "wasm code missing": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.WASMByteCode = nil + }), + expErr: true, + }, + "wasm code invalid": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.WASMByteCode = bytes.Repeat([]byte{0x0}, MaxProposalWasmSize+1) + }), + expErr: true, + }, + "with invalid instantiate permission": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.InstantiatePermission = &AccessConfig{} + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateInstantiateContractProposal(t *testing.T) { + specs := map[string]struct { + src *InstantiateContractProposal + expErr bool + }{ + "all good": { + src: InstantiateContractProposalFixture(), + }, + "without admin": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Admin = "" + }), + }, + "without init msg": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Msg = nil + }), + expErr: true, + }, + "with invalid init msg": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Msg = []byte("not a json string") + }), + expErr: true, + }, + "without init funds": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Funds = nil + }), + }, + "base data missing": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Title = "" + }), + expErr: true, + }, + "run_as missing": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.RunAs = "" + }), + expErr: true, + }, + "run_as invalid": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.RunAs = invalidAddress + }), + expErr: true, + }, + "admin invalid": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Admin = invalidAddress + }), + expErr: true, + }, + "code id empty": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.CodeID = 0 + }), + expErr: true, + }, + "label empty": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Label = "" + }), + expErr: true, + }, + "init funds negative": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(-1)}} + }), + expErr: true, + }, + "init funds with duplicates": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(1)}, {Denom: "foo", Amount: sdkmath.NewInt(2)}} + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateInstantiateContract2Proposal(t *testing.T) { + specs := map[string]struct { + src *InstantiateContract2Proposal + expErr bool + }{ + "all good": { + src: InstantiateContract2ProposalFixture(), + }, + "without admin": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Admin = "" + }), + }, + "without init msg": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Msg = nil + }), + expErr: true, + }, + "with invalid init msg": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Msg = []byte("not a json string") + }), + expErr: true, + }, + "without init funds": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Funds = nil + }), + }, + "base data missing": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Title = "" + }), + expErr: true, + }, + "run_as missing": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.RunAs = "" + }), + expErr: true, + }, + "run_as invalid": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.RunAs = invalidAddress + }), + expErr: true, + }, + "admin invalid": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Admin = invalidAddress + }), + expErr: true, + }, + "code id empty": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.CodeID = 0 + }), + expErr: true, + }, + "label empty": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Label = "" + }), + expErr: true, + }, + "untrimmed label ": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Label = " label " + }), + expErr: true, + }, + "init funds negative": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(-1)}} + }), + expErr: true, + }, + "init funds with duplicates": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(1)}, {Denom: "foo", Amount: sdkmath.NewInt(2)}} + }), + expErr: true, + }, + "init with empty salt": { + src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { + p.Salt = nil + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateStoreAndInstantiateContractProposal(t *testing.T) { + var anyAddress sdk.AccAddress = bytes.Repeat([]byte{0x0}, ContractAddrLen) + + specs := map[string]struct { + src *StoreAndInstantiateContractProposal + expErr bool + }{ + "all good": { + src: StoreAndInstantiateContractProposalFixture(), + }, + "all good no code verification info": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Source = "" + p.Builder = "" + p.CodeHash = nil + }), + }, + "source missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Source = "" + }), + expErr: true, + }, + "builder missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Builder = "" + }), + expErr: true, + }, + "code hash missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.CodeHash = nil + }), + expErr: true, + }, + "with instantiate permission": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + accessConfig := AccessTypeAnyOfAddresses.With(anyAddress) + p.InstantiatePermission = &accessConfig + }), + }, + "base data missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Title = "" + }), + expErr: true, + }, + "run_as missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.RunAs = "" + }), + expErr: true, + }, + "run_as invalid": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.RunAs = invalidAddress + }), + expErr: true, + }, + "wasm code missing": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.WASMByteCode = nil + }), + expErr: true, + }, + "wasm code invalid": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.WASMByteCode = bytes.Repeat([]byte{0x0}, MaxProposalWasmSize+1) + }), + expErr: true, + }, + "with invalid instantiate permission": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.InstantiatePermission = &AccessConfig{} + }), + expErr: true, + }, + "without admin": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Admin = "" + }), + }, + "without init msg": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Msg = nil + }), + expErr: true, + }, + "with invalid init msg": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Msg = []byte("not a json string") + }), + expErr: true, + }, + "without init funds": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Funds = nil + }), + }, + "admin invalid": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Admin = invalidAddress + }), + expErr: true, + }, + "label empty": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Label = "" + }), + expErr: true, + }, + "init funds negative": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(-1)}} + }), + expErr: true, + }, + "init funds with duplicates": { + src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(1)}, {Denom: "foo", Amount: sdkmath.NewInt(2)}} + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateMigrateContractProposal(t *testing.T) { + invalidAddress := "invalid address2" + + specs := map[string]struct { + src *MigrateContractProposal + expErr bool + }{ + "all good": { + src: MigrateContractProposalFixture(), + }, + "without migrate msg": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.Msg = nil + }), + expErr: true, + }, + "migrate msg with invalid json": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.Msg = []byte("not a json message") + }), + expErr: true, + }, + "base data missing": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.Title = "" + }), + expErr: true, + }, + "contract missing": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.Contract = "" + }), + expErr: true, + }, + "contract invalid": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.Contract = invalidAddress + }), + expErr: true, + }, + "code id empty": { + src: MigrateContractProposalFixture(func(p *MigrateContractProposal) { + p.CodeID = 0 + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateSudoContractProposal(t *testing.T) { + specs := map[string]struct { + src *SudoContractProposal + expErr bool + }{ + "all good": { + src: SudoContractProposalFixture(), + }, + "msg is nil": { + src: SudoContractProposalFixture(func(p *SudoContractProposal) { + p.Msg = nil + }), + expErr: true, + }, + "msg with invalid json": { + src: SudoContractProposalFixture(func(p *SudoContractProposal) { + p.Msg = []byte("not a json message") + }), + expErr: true, + }, + "base data missing": { + src: SudoContractProposalFixture(func(p *SudoContractProposal) { + p.Title = "" + }), + expErr: true, + }, + "contract missing": { + src: SudoContractProposalFixture(func(p *SudoContractProposal) { + p.Contract = "" + }), + expErr: true, + }, + "contract invalid": { + src: SudoContractProposalFixture(func(p *SudoContractProposal) { + p.Contract = invalidAddress + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateExecuteContractProposal(t *testing.T) { + specs := map[string]struct { + src *ExecuteContractProposal + expErr bool + }{ + "all good": { + src: ExecuteContractProposalFixture(), + }, + "msg is nil": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.Msg = nil + }), + expErr: true, + }, + "msg with invalid json": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.Msg = []byte("not a valid json message") + }), + expErr: true, + }, + "base data missing": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.Title = "" + }), + expErr: true, + }, + "contract missing": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.Contract = "" + }), + expErr: true, + }, + "contract invalid": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.Contract = invalidAddress + }), + expErr: true, + }, + "run as is invalid": { + src: ExecuteContractProposalFixture(func(p *ExecuteContractProposal) { + p.RunAs = invalidAddress + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateUpdateAdminProposal(t *testing.T) { + specs := map[string]struct { + src *UpdateAdminProposal + expErr bool + }{ + "all good": { + src: UpdateAdminProposalFixture(), + }, + "base data missing": { + src: UpdateAdminProposalFixture(func(p *UpdateAdminProposal) { + p.Title = "" + }), + expErr: true, + }, + "contract missing": { + src: UpdateAdminProposalFixture(func(p *UpdateAdminProposal) { + p.Contract = "" + }), + expErr: true, + }, + "contract invalid": { + src: UpdateAdminProposalFixture(func(p *UpdateAdminProposal) { + p.Contract = invalidAddress + }), + expErr: true, + }, + "admin missing": { + src: UpdateAdminProposalFixture(func(p *UpdateAdminProposal) { + p.NewAdmin = "" + }), + expErr: true, + }, + "admin invalid": { + src: UpdateAdminProposalFixture(func(p *UpdateAdminProposal) { + p.NewAdmin = invalidAddress + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateClearAdminProposal(t *testing.T) { + specs := map[string]struct { + src *ClearAdminProposal + expErr bool + }{ + "all good": { + src: ClearAdminProposalFixture(), + }, + "base data missing": { + src: ClearAdminProposalFixture(func(p *ClearAdminProposal) { + p.Title = "" + }), + expErr: true, + }, + "contract missing": { + src: ClearAdminProposalFixture(func(p *ClearAdminProposal) { + p.Contract = "" + }), + expErr: true, + }, + "contract invalid": { + src: ClearAdminProposalFixture(func(p *ClearAdminProposal) { + p.Contract = invalidAddress + }), + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestProposalStrings(t *testing.T) { + specs := map[string]struct { + src v1beta1.Content + exp string + }{ + "store code": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.WASMByteCode = []byte{0o1, 0o2, 0o3, 0o4, 0o5, 0o6, 0o7, 0x08, 0x09, 0x0a} + }), + exp: `Store Code Proposal: + Title: Foo + Description: Bar + Run as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + WasmCode: 0102030405060708090A + Source: https://example.com/ + Builder: cosmwasm/workspace-optimizer:v0.12.8 + Code Hash: 6E340B9CFFB37A989CA544E6BB780A2C78901D3FB33738768511A30617AFA01D +`, + }, + "instantiate contract": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(1)}, {Denom: "bar", Amount: sdkmath.NewInt(2)}} + }), + exp: `Instantiate Code Proposal: + Title: Foo + Description: Bar + Run as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + Admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + Code id: 1 + Label: testing + Msg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\"}" + Funds: 1foo,2bar +`, + }, + "instantiate contract without funds": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Funds = nil }), + exp: `Instantiate Code Proposal: + Title: Foo + Description: Bar + Run as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + Admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + Code id: 1 + Label: testing + Msg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\"}" + Funds: +`, + }, + "instantiate contract without admin": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Admin = "" }), + exp: `Instantiate Code Proposal: + Title: Foo + Description: Bar + Run as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 + Admin: + Code id: 1 + Label: testing + Msg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\",\"beneficiary\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\"}" + Funds: +`, + }, + "migrate contract": { + src: MigrateContractProposalFixture(), + exp: `Migrate Contract Proposal: + Title: Foo + Description: Bar + Contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr + Code id: 1 + Msg: "{\"verifier\":\"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4\"}" +`, + }, + "update admin": { + src: UpdateAdminProposalFixture(), + exp: `Update Contract Admin Proposal: + Title: Foo + Description: Bar + Contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr + New Admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +`, + }, + "clear admin": { + src: ClearAdminProposalFixture(), + exp: `Clear Contract Admin Proposal: + Title: Foo + Description: Bar + Contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr +`, + }, + "pin codes": { + src: &PinCodesProposal{ + Title: "Foo", + Description: "Bar", + CodeIDs: []uint64{1, 2, 3}, + }, + exp: `Pin Wasm Codes Proposal: + Title: Foo + Description: Bar + Codes: [1 2 3] +`, + }, + "unpin codes": { + src: &UnpinCodesProposal{ + Title: "Foo", + Description: "Bar", + CodeIDs: []uint64{3, 2, 1}, + }, + exp: `Unpin Wasm Codes Proposal: + Title: Foo + Description: Bar + Codes: [3 2 1] +`, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + assert.Equal(t, spec.exp, spec.src.String()) + }) + } +} + +func TestProposalYaml(t *testing.T) { + specs := map[string]struct { + src v1beta1.Content + exp string + }{ + "store code": { + src: StoreCodeProposalFixture(func(p *StoreCodeProposal) { + p.WASMByteCode = []byte{0o1, 0o2, 0o3, 0o4, 0o5, 0o6, 0o7, 0x08, 0x09, 0x0a} + }), + exp: `title: Foo +description: Bar +run_as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +wasm_byte_code: AQIDBAUGBwgJCg== +instantiate_permission: null +source: https://example.com/ +builder: cosmwasm/workspace-optimizer:v0.12.8 +code_hash: 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d +`, + }, + "instantiate contract": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { + p.Funds = sdk.Coins{{Denom: "foo", Amount: sdkmath.NewInt(1)}, {Denom: "bar", Amount: sdkmath.NewInt(2)}} + }), + exp: `title: Foo +description: Bar +run_as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +code_id: 1 +label: testing +msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4"}' +funds: +- denom: foo + amount: "1" +- denom: bar + amount: "2" +`, + }, + "instantiate contract without funds": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Funds = nil }), + exp: `title: Foo +description: Bar +run_as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +code_id: 1 +label: testing +msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4"}' +funds: [] +`, + }, + "instantiate contract without admin": { + src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { p.Admin = "" }), + exp: `title: Foo +description: Bar +run_as: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +admin: "" +code_id: 1 +label: testing +msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4","beneficiary":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4"}' +funds: [] +`, + }, + "migrate contract": { + src: MigrateContractProposalFixture(), + exp: `title: Foo +description: Bar +contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr +code_id: 1 +msg: '{"verifier":"cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4"}' +`, + }, + "update admin": { + src: UpdateAdminProposalFixture(), + exp: `title: Foo +description: Bar +new_admin: cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4 +contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr +`, + }, + "clear admin": { + src: ClearAdminProposalFixture(), + exp: `title: Foo +description: Bar +contract: cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr +`, + }, + "pin codes": { + src: &PinCodesProposal{ + Title: "Foo", + Description: "Bar", + CodeIDs: []uint64{1, 2, 3}, + }, + exp: `title: Foo +description: Bar +code_ids: +- 1 +- 2 +- 3 +`, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + v, err := yaml.Marshal(&spec.src) //nolint:gosec + require.NoError(t, err) + assert.Equal(t, spec.exp, string(v)) + }) + } +} + +func TestUnmarshalContentFromJson(t *testing.T) { + specs := map[string]struct { + src string + got v1beta1.Content + exp v1beta1.Content + }{ + "instantiate ": { + src: ` +{ + "title": "foo", + "description": "bar", + "admin": "myAdminAddress", + "code_id": 1, + "funds": [{"denom": "ALX", "amount": "2"},{"denom": "BLX","amount": "3"}], + "msg": {}, + "label": "testing", + "run_as": "myRunAsAddress" +}`, + got: &InstantiateContractProposal{}, + exp: &InstantiateContractProposal{ + Title: "foo", + Description: "bar", + RunAs: "myRunAsAddress", + Admin: "myAdminAddress", + CodeID: 1, + Label: "testing", + Msg: []byte("{}"), + Funds: sdk.NewCoins(sdk.NewCoin("ALX", sdkmath.NewInt(2)), sdk.NewCoin("BLX", sdkmath.NewInt(3))), + }, + }, + "migrate ": { + src: ` +{ + "title": "foo", + "description": "bar", + "code_id": 1, + "contract": "myContractAddr", + "msg": {}, + "run_as": "myRunAsAddress" +}`, + got: &MigrateContractProposal{}, + exp: &MigrateContractProposal{ + Title: "foo", + Description: "bar", + Contract: "myContractAddr", + CodeID: 1, + Msg: []byte("{}"), + }, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + require.NoError(t, json.Unmarshal([]byte(spec.src), spec.got)) + assert.Equal(t, spec.exp, spec.got) + }) + } +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func StoreCodeProposalFixture(mutators ...func(*StoreCodeProposal)) *StoreCodeProposal { + const anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + wasm := []byte{0x0} + // got the value from shell sha256sum + codeHash, err := hex.DecodeString("6E340B9CFFB37A989CA544E6BB780A2C78901D3FB33738768511A30617AFA01D") + if err != nil { + panic(err) + } + + p := &StoreCodeProposal{ + Title: "Foo", + Description: "Bar", + RunAs: anyAddress, + WASMByteCode: wasm, + Source: "https://example.com/", + Builder: "cosmwasm/workspace-optimizer:v0.12.8", + CodeHash: codeHash, + } + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func InstantiateContractProposalFixture(mutators ...func(p *InstantiateContractProposal)) *InstantiateContractProposal { + var ( + anyValidAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, ContractAddrLen) + + initMsg = struct { + Verifier sdk.AccAddress `json:"verifier"` + Beneficiary sdk.AccAddress `json:"beneficiary"` + }{ + Verifier: anyValidAddress, + Beneficiary: anyValidAddress, + } + ) + const anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + + initMsgBz, err := json.Marshal(initMsg) + if err != nil { + panic(err) + } + p := &InstantiateContractProposal{ + Title: "Foo", + Description: "Bar", + RunAs: anyAddress, + Admin: anyAddress, + CodeID: 1, + Label: "testing", + Msg: initMsgBz, + Funds: nil, + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func InstantiateContract2ProposalFixture(mutators ...func(p *InstantiateContract2Proposal)) *InstantiateContract2Proposal { + var ( + anyValidAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, ContractAddrLen) + + initMsg = struct { + Verifier sdk.AccAddress `json:"verifier"` + Beneficiary sdk.AccAddress `json:"beneficiary"` + }{ + Verifier: anyValidAddress, + Beneficiary: anyValidAddress, + } + ) + const ( + anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + mySalt = "myDefaultSalt" + ) + + initMsgBz, err := json.Marshal(initMsg) + if err != nil { + panic(err) + } + p := &InstantiateContract2Proposal{ + Title: "Foo", + Description: "Bar", + RunAs: anyAddress, + Admin: anyAddress, + CodeID: 1, + Label: "testing", + Msg: initMsgBz, + Funds: nil, + Salt: []byte(mySalt), + FixMsg: false, + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func StoreAndInstantiateContractProposalFixture(mutators ...func(p *StoreAndInstantiateContractProposal)) *StoreAndInstantiateContractProposal { + var ( + anyValidAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, ContractAddrLen) + + initMsg = struct { + Verifier sdk.AccAddress `json:"verifier"` + Beneficiary sdk.AccAddress `json:"beneficiary"` + }{ + Verifier: anyValidAddress, + Beneficiary: anyValidAddress, + } + ) + const anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + wasm := []byte{0x0} + // got the value from shell sha256sum + codeHash, err := hex.DecodeString("6E340B9CFFB37A989CA544E6BB780A2C78901D3FB33738768511A30617AFA01D") + if err != nil { + panic(err) + } + + initMsgBz, err := json.Marshal(initMsg) + if err != nil { + panic(err) + } + p := &StoreAndInstantiateContractProposal{ + Title: "Foo", + Description: "Bar", + RunAs: anyAddress, + WASMByteCode: wasm, + Source: "https://example.com/", + Builder: "cosmwasm/workspace-optimizer:v0.12.9", + CodeHash: codeHash, + Admin: anyAddress, + Label: "testing", + Msg: initMsgBz, + Funds: nil, + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func MigrateContractProposalFixture(mutators ...func(p *MigrateContractProposal)) *MigrateContractProposal { + var ( + anyValidAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, ContractAddrLen) + + migMsg = struct { + Verifier sdk.AccAddress `json:"verifier"` + }{Verifier: anyValidAddress} + ) + + migMsgBz, err := json.Marshal(migMsg) + if err != nil { + panic(err) + } + const ( + contractAddr = "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + ) + p := &MigrateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: contractAddr, + CodeID: 1, + Msg: migMsgBz, + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func SudoContractProposalFixture(mutators ...func(p *SudoContractProposal)) *SudoContractProposal { + const ( + contractAddr = "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + ) + + p := &SudoContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: contractAddr, + Msg: []byte(`{"do":"something"}`), + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func ExecuteContractProposalFixture(mutators ...func(p *ExecuteContractProposal)) *ExecuteContractProposal { + const ( + contractAddr = "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + ) + + p := &ExecuteContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: contractAddr, + RunAs: anyAddress, + Msg: []byte(`{"do":"something"}`), + Funds: sdk.Coins{{ + Denom: "stake", + Amount: sdkmath.NewInt(1), + }}, + } + + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func UpdateAdminProposalFixture(mutators ...func(p *UpdateAdminProposal)) *UpdateAdminProposal { + const ( + contractAddr = "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + anyAddress = "cosmos1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs2m6sx4" + ) + + p := &UpdateAdminProposal{ + Title: "Foo", + Description: "Bar", + NewAdmin: anyAddress, + Contract: contractAddr, + } + for _, m := range mutators { + m(p) + } + return p +} + +// Deprecated: all gov v1beta1 types are supported for gov store only +func ClearAdminProposalFixture(mutators ...func(p *ClearAdminProposal)) *ClearAdminProposal { + const contractAddr = "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + p := &ClearAdminProposal{ + Title: "Foo", + Description: "Bar", + Contract: contractAddr, + } + for _, m := range mutators { + m(p) + } + return p +} diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index 40ae2a613c..aee5c4869d 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -703,53 +703,6 @@ func (m *MsgClearAdminResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgClearAdminResponse proto.InternalMessageInfo -// AccessConfigUpdate contains the code id and the access config to be -// applied. -type AccessConfigUpdate struct { - // CodeID is the reference to the stored WASM code to be updated - CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` - // InstantiatePermission to apply to the set of code ids - InstantiatePermission AccessConfig `protobuf:"bytes,2,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission"` -} - -func (m *AccessConfigUpdate) Reset() { *m = AccessConfigUpdate{} } -func (m *AccessConfigUpdate) String() string { return proto.CompactTextString(m) } -func (*AccessConfigUpdate) ProtoMessage() {} -func (*AccessConfigUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{14} -} - -func (m *AccessConfigUpdate) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *AccessConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AccessConfigUpdate.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *AccessConfigUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccessConfigUpdate.Merge(m, src) -} - -func (m *AccessConfigUpdate) XXX_Size() int { - return m.Size() -} - -func (m *AccessConfigUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_AccessConfigUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_AccessConfigUpdate proto.InternalMessageInfo - // MsgUpdateInstantiateConfig updates instantiate config for a smart contract type MsgUpdateInstantiateConfig struct { // Sender is the that actor that signed the messages @@ -764,7 +717,7 @@ func (m *MsgUpdateInstantiateConfig) Reset() { *m = MsgUpdateInstantiate func (m *MsgUpdateInstantiateConfig) String() string { return proto.CompactTextString(m) } func (*MsgUpdateInstantiateConfig) ProtoMessage() {} func (*MsgUpdateInstantiateConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{15} + return fileDescriptor_4f74d82755520264, []int{14} } func (m *MsgUpdateInstantiateConfig) XXX_Unmarshal(b []byte) error { @@ -805,7 +758,7 @@ func (m *MsgUpdateInstantiateConfigResponse) Reset() { *m = MsgUpdateIns func (m *MsgUpdateInstantiateConfigResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateInstantiateConfigResponse) ProtoMessage() {} func (*MsgUpdateInstantiateConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{16} + return fileDescriptor_4f74d82755520264, []int{15} } func (m *MsgUpdateInstantiateConfigResponse) XXX_Unmarshal(b []byte) error { @@ -855,7 +808,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{17} + return fileDescriptor_4f74d82755520264, []int{16} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { @@ -899,7 +852,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{18} + return fileDescriptor_4f74d82755520264, []int{17} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { @@ -949,7 +902,7 @@ func (m *MsgSudoContract) Reset() { *m = MsgSudoContract{} } func (m *MsgSudoContract) String() string { return proto.CompactTextString(m) } func (*MsgSudoContract) ProtoMessage() {} func (*MsgSudoContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{19} + return fileDescriptor_4f74d82755520264, []int{18} } func (m *MsgSudoContract) XXX_Unmarshal(b []byte) error { @@ -996,7 +949,7 @@ func (m *MsgSudoContractResponse) Reset() { *m = MsgSudoContractResponse func (m *MsgSudoContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgSudoContractResponse) ProtoMessage() {} func (*MsgSudoContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{20} + return fileDescriptor_4f74d82755520264, []int{19} } func (m *MsgSudoContractResponse) XXX_Unmarshal(b []byte) error { @@ -1044,7 +997,7 @@ func (m *MsgPinCodes) Reset() { *m = MsgPinCodes{} } func (m *MsgPinCodes) String() string { return proto.CompactTextString(m) } func (*MsgPinCodes) ProtoMessage() {} func (*MsgPinCodes) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{21} + return fileDescriptor_4f74d82755520264, []int{20} } func (m *MsgPinCodes) XXX_Unmarshal(b []byte) error { @@ -1088,7 +1041,7 @@ func (m *MsgPinCodesResponse) Reset() { *m = MsgPinCodesResponse{} } func (m *MsgPinCodesResponse) String() string { return proto.CompactTextString(m) } func (*MsgPinCodesResponse) ProtoMessage() {} func (*MsgPinCodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{22} + return fileDescriptor_4f74d82755520264, []int{21} } func (m *MsgPinCodesResponse) XXX_Unmarshal(b []byte) error { @@ -1136,7 +1089,7 @@ func (m *MsgUnpinCodes) Reset() { *m = MsgUnpinCodes{} } func (m *MsgUnpinCodes) String() string { return proto.CompactTextString(m) } func (*MsgUnpinCodes) ProtoMessage() {} func (*MsgUnpinCodes) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{23} + return fileDescriptor_4f74d82755520264, []int{22} } func (m *MsgUnpinCodes) XXX_Unmarshal(b []byte) error { @@ -1180,7 +1133,7 @@ func (m *MsgUnpinCodesResponse) Reset() { *m = MsgUnpinCodesResponse{} } func (m *MsgUnpinCodesResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnpinCodesResponse) ProtoMessage() {} func (*MsgUnpinCodesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{24} + return fileDescriptor_4f74d82755520264, []int{23} } func (m *MsgUnpinCodesResponse) XXX_Unmarshal(b []byte) error { @@ -1251,7 +1204,7 @@ func (m *MsgStoreAndInstantiateContract) Reset() { *m = MsgStoreAndInsta func (m *MsgStoreAndInstantiateContract) String() string { return proto.CompactTextString(m) } func (*MsgStoreAndInstantiateContract) ProtoMessage() {} func (*MsgStoreAndInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{25} + return fileDescriptor_4f74d82755520264, []int{24} } func (m *MsgStoreAndInstantiateContract) XXX_Unmarshal(b []byte) error { @@ -1302,7 +1255,7 @@ func (m *MsgStoreAndInstantiateContractResponse) Reset() { func (m *MsgStoreAndInstantiateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgStoreAndInstantiateContractResponse) ProtoMessage() {} func (*MsgStoreAndInstantiateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{26} + return fileDescriptor_4f74d82755520264, []int{25} } func (m *MsgStoreAndInstantiateContractResponse) XXX_Unmarshal(b []byte) error { @@ -1348,7 +1301,7 @@ func (m *MsgAddCodeUploadParamsAddresses) Reset() { *m = MsgAddCodeUploa func (m *MsgAddCodeUploadParamsAddresses) String() string { return proto.CompactTextString(m) } func (*MsgAddCodeUploadParamsAddresses) ProtoMessage() {} func (*MsgAddCodeUploadParamsAddresses) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{27} + return fileDescriptor_4f74d82755520264, []int{26} } func (m *MsgAddCodeUploadParamsAddresses) XXX_Unmarshal(b []byte) error { @@ -1392,7 +1345,7 @@ func (m *MsgAddCodeUploadParamsAddressesResponse) Reset() { func (m *MsgAddCodeUploadParamsAddressesResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddCodeUploadParamsAddressesResponse) ProtoMessage() {} func (*MsgAddCodeUploadParamsAddressesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{28} + return fileDescriptor_4f74d82755520264, []int{27} } func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Unmarshal(b []byte) error { @@ -1438,7 +1391,7 @@ func (m *MsgRemoveCodeUploadParamsAddresses) Reset() { *m = MsgRemoveCod func (m *MsgRemoveCodeUploadParamsAddresses) String() string { return proto.CompactTextString(m) } func (*MsgRemoveCodeUploadParamsAddresses) ProtoMessage() {} func (*MsgRemoveCodeUploadParamsAddresses) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{29} + return fileDescriptor_4f74d82755520264, []int{28} } func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Unmarshal(b []byte) error { @@ -1485,7 +1438,7 @@ func (m *MsgRemoveCodeUploadParamsAddressesResponse) String() string { } func (*MsgRemoveCodeUploadParamsAddressesResponse) ProtoMessage() {} func (*MsgRemoveCodeUploadParamsAddressesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{30} + return fileDescriptor_4f74d82755520264, []int{29} } func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Unmarshal(b []byte) error { @@ -1540,7 +1493,7 @@ func (m *MsgStoreAndMigrateContract) Reset() { *m = MsgStoreAndMigrateCo func (m *MsgStoreAndMigrateContract) String() string { return proto.CompactTextString(m) } func (*MsgStoreAndMigrateContract) ProtoMessage() {} func (*MsgStoreAndMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{31} + return fileDescriptor_4f74d82755520264, []int{30} } func (m *MsgStoreAndMigrateContract) XXX_Unmarshal(b []byte) error { @@ -1591,7 +1544,7 @@ func (m *MsgStoreAndMigrateContractResponse) Reset() { *m = MsgStoreAndM func (m *MsgStoreAndMigrateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgStoreAndMigrateContractResponse) ProtoMessage() {} func (*MsgStoreAndMigrateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{32} + return fileDescriptor_4f74d82755520264, []int{31} } func (m *MsgStoreAndMigrateContractResponse) XXX_Unmarshal(b []byte) error { @@ -1639,7 +1592,7 @@ func (m *MsgUpdateContractLabel) Reset() { *m = MsgUpdateContractLabel{} func (m *MsgUpdateContractLabel) String() string { return proto.CompactTextString(m) } func (*MsgUpdateContractLabel) ProtoMessage() {} func (*MsgUpdateContractLabel) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{33} + return fileDescriptor_4f74d82755520264, []int{32} } func (m *MsgUpdateContractLabel) XXX_Unmarshal(b []byte) error { @@ -1680,7 +1633,7 @@ func (m *MsgUpdateContractLabelResponse) Reset() { *m = MsgUpdateContrac func (m *MsgUpdateContractLabelResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateContractLabelResponse) ProtoMessage() {} func (*MsgUpdateContractLabelResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{34} + return fileDescriptor_4f74d82755520264, []int{33} } func (m *MsgUpdateContractLabelResponse) XXX_Unmarshal(b []byte) error { @@ -1729,7 +1682,6 @@ func init() { proto.RegisterType((*MsgUpdateAdminResponse)(nil), "cosmwasm.wasm.v1.MsgUpdateAdminResponse") proto.RegisterType((*MsgClearAdmin)(nil), "cosmwasm.wasm.v1.MsgClearAdmin") proto.RegisterType((*MsgClearAdminResponse)(nil), "cosmwasm.wasm.v1.MsgClearAdminResponse") - proto.RegisterType((*AccessConfigUpdate)(nil), "cosmwasm.wasm.v1.AccessConfigUpdate") proto.RegisterType((*MsgUpdateInstantiateConfig)(nil), "cosmwasm.wasm.v1.MsgUpdateInstantiateConfig") proto.RegisterType((*MsgUpdateInstantiateConfigResponse)(nil), "cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse") proto.RegisterType((*MsgUpdateParams)(nil), "cosmwasm.wasm.v1.MsgUpdateParams") @@ -1755,115 +1707,114 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/tx.proto", fileDescriptor_4f74d82755520264) } var fileDescriptor_4f74d82755520264 = []byte{ - // 1724 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x19, 0x4d, 0x6c, 0x1b, 0xc5, - 0x3a, 0x1b, 0x3b, 0x8e, 0x3d, 0xc9, 0x6b, 0xd3, 0xad, 0x9b, 0x38, 0xdb, 0xd6, 0x76, 0xb7, 0x3f, - 0x71, 0xf3, 0x52, 0x3b, 0xf1, 0xeb, 0xeb, 0x7b, 0x35, 0x5c, 0xe2, 0x14, 0x89, 0x54, 0x18, 0xa2, - 0x8d, 0xd2, 0x0a, 0x54, 0xc9, 0xac, 0xbd, 0x93, 0xcd, 0xaa, 0xde, 0x5d, 0xe3, 0x59, 0xe7, 0xe7, - 0xc0, 0x05, 0x24, 0x24, 0x10, 0x07, 0x2e, 0x9c, 0x38, 0x23, 0x01, 0x17, 0x7a, 0xe0, 0xc0, 0xb1, - 0x27, 0x54, 0x01, 0x42, 0x15, 0x27, 0x2e, 0x18, 0x48, 0x91, 0xca, 0x0d, 0xa9, 0x47, 0x4e, 0x68, - 0x67, 0x76, 0xd7, 0xe3, 0xf5, 0xec, 0xda, 0x49, 0x5a, 0x81, 0xc4, 0x25, 0xd9, 0x99, 0xf9, 0xbe, - 0x6f, 0xbe, 0xff, 0x9f, 0x31, 0x98, 0xad, 0x9b, 0x48, 0xdf, 0x91, 0x91, 0x5e, 0xc0, 0x7f, 0xb6, - 0x97, 0x0a, 0xd6, 0x6e, 0xbe, 0xd9, 0x32, 0x2d, 0x93, 0x9f, 0x72, 0x8f, 0xf2, 0xf8, 0xcf, 0xf6, - 0x92, 0x90, 0xb6, 0x77, 0x4c, 0x54, 0xa8, 0xc9, 0x08, 0x16, 0xb6, 0x97, 0x6a, 0xd0, 0x92, 0x97, - 0x0a, 0x75, 0x53, 0x33, 0x08, 0x86, 0x30, 0xe3, 0x9c, 0xeb, 0x48, 0xb5, 0x29, 0xe9, 0x48, 0x75, - 0x0e, 0x92, 0xaa, 0xa9, 0x9a, 0xf8, 0xb3, 0x60, 0x7f, 0x39, 0xbb, 0x67, 0xfa, 0xef, 0xde, 0x6b, - 0x42, 0xe4, 0x9c, 0xce, 0x12, 0x62, 0x55, 0x82, 0x46, 0x16, 0xce, 0xd1, 0x09, 0x59, 0xd7, 0x0c, - 0xb3, 0x80, 0xff, 0x92, 0x2d, 0xf1, 0x57, 0x0e, 0x4c, 0x56, 0x90, 0xba, 0x6e, 0x99, 0x2d, 0xb8, - 0x62, 0x2a, 0x90, 0x9f, 0x06, 0x31, 0x04, 0x0d, 0x05, 0xb6, 0x52, 0x5c, 0x96, 0xcb, 0x25, 0x24, - 0x67, 0xc5, 0x5f, 0x03, 0xc7, 0xec, 0xdb, 0xaa, 0xb5, 0x3d, 0x0b, 0x56, 0xeb, 0xa6, 0x02, 0x53, - 0xa3, 0x59, 0x2e, 0x37, 0x59, 0x9e, 0xda, 0xef, 0x64, 0x26, 0x6f, 0x2f, 0xaf, 0x57, 0xca, 0x7b, - 0x16, 0xa6, 0x20, 0x4d, 0xda, 0x70, 0xee, 0x8a, 0xdf, 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10, 0x60, 0x57, 0x73, 0xf1, 0x37, 0x0e, - 0x5b, 0x9d, 0x30, 0xd5, 0x9b, 0x47, 0x36, 0x35, 0x35, 0x50, 0x5b, 0x14, 0xf7, 0xa3, 0x81, 0xdc, - 0xdf, 0x01, 0x82, 0x6d, 0xf3, 0x00, 0x09, 0x22, 0x43, 0x35, 0x21, 0x29, 0x03, 0xee, 0xac, 0x32, - 0xfb, 0x90, 0x82, 0xcf, 0x28, 0x99, 0x5e, 0xc7, 0xe8, 0x93, 0x45, 0xbc, 0x00, 0xc4, 0xe0, 0x53, - 0xcf, 0x5c, 0x9f, 0x73, 0xe0, 0xb8, 0x07, 0xb6, 0x26, 0xb7, 0x64, 0x1d, 0xf1, 0xd7, 0x40, 0x42, - 0x6e, 0x5b, 0x5b, 0x66, 0x4b, 0xb3, 0xf6, 0x88, 0x22, 0xca, 0xa9, 0xef, 0xbf, 0xb8, 0x92, 0x74, - 0xd2, 0xd4, 0x32, 0xc9, 0xa7, 0xeb, 0x56, 0x4b, 0x33, 0x54, 0xa9, 0x0b, 0xca, 0x3f, 0x07, 0x62, - 0x4d, 0x4c, 0xc1, 0x31, 0x57, 0xaa, 0x5f, 0x58, 0x72, 0x03, 0x6d, 0x28, 0x07, 0x85, 0xc4, 0x6d, - 0x97, 0x98, 0x2d, 0x62, 0xb2, 0x57, 0x44, 0x82, 0x2b, 0xce, 0xe2, 0xa2, 0x4b, 0x6f, 0x79, 0xc2, - 0x7c, 0x49, 0x84, 0x59, 0x6f, 0x2b, 0xa6, 0x97, 0x92, 0x0e, 0x2b, 0xcc, 0x53, 0x49, 0xf5, 0xa1, - 0x52, 0xd1, 0x6c, 0x8a, 0x57, 0xb0, 0x54, 0xf4, 0x56, 0x68, 0x2a, 0xfa, 0x98, 0x03, 0x13, 0x15, - 0xa4, 0xae, 0x69, 0x86, 0xed, 0x84, 0x87, 0x37, 0xd9, 0x75, 0x5b, 0x4a, 0xec, 0xd8, 0xb6, 0xd1, - 0x22, 0xb9, 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 0x0e, 0x0e, 0x81, 0xaf, - 0x31, 0x0c, 0x8e, 0xc5, 0x2c, 0xae, 0x9e, 0x8c, 0x13, 0x57, 0x87, 0xc5, 0xef, 0x8e, 0x81, 0x48, - 0x05, 0xa9, 0xfc, 0x3a, 0x48, 0x74, 0x9f, 0x0d, 0x19, 0xfe, 0x42, 0x3f, 0xb8, 0x09, 0x97, 0xc2, - 0xcf, 0x3d, 0x03, 0xbd, 0x01, 0x4e, 0xb2, 0x2a, 0x76, 0x8e, 0x89, 0xce, 0x80, 0x14, 0x16, 0x87, - 0x85, 0xf4, 0xae, 0xb4, 0x40, 0x92, 0xf9, 0x56, 0x74, 0x79, 0x58, 0x4a, 0x45, 0x61, 0x69, 0x68, - 0x50, 0xef, 0x56, 0x08, 0x8e, 0xfb, 0x9f, 0x37, 0x2e, 0x30, 0xa9, 0xf8, 0xa0, 0x84, 0x85, 0x61, - 0xa0, 0xe8, 0x6b, 0xfc, 0xa9, 0x86, 0x7d, 0x8d, 0x0f, 0x2a, 0xe0, 0x9a, 0xa0, 0xb8, 0x7a, 0x15, - 0x4c, 0xd0, 0xf3, 0x77, 0x96, 0x89, 0x4c, 0x41, 0x08, 0xb9, 0x41, 0x10, 0x1e, 0xe9, 0x5b, 0x00, - 0x50, 0x83, 0x73, 0x86, 0x89, 0xd7, 0x05, 0x10, 0xe6, 0x06, 0x00, 0x78, 0x74, 0xdf, 0x04, 0x33, - 0x41, 0xf3, 0xe6, 0x42, 0x08, 0x73, 0x7d, 0xd0, 0xc2, 0xd5, 0x83, 0x40, 0x7b, 0xd7, 0xdf, 0x01, - 0x93, 0x3d, 0xd3, 0xdd, 0xb9, 0x10, 0x2a, 0x04, 0x44, 0xb8, 0x3c, 0x10, 0x84, 0xa6, 0xde, 0x33, - 0x6e, 0xb1, 0xa9, 0xd3, 0x20, 0x01, 0xd4, 0x99, 0xa3, 0xcf, 0x1a, 0x88, 0x7b, 0x23, 0xce, 0x59, - 0x26, 0x9a, 0x7b, 0x2c, 0x5c, 0x0c, 0x3d, 0xa6, 0x8d, 0x4c, 0x4d, 0x1d, 0x6c, 0x23, 0x77, 0x01, - 0x02, 0x8c, 0xdc, 0x3f, 0x0c, 0xf0, 0xef, 0x72, 0xe0, 0x74, 0xd8, 0x24, 0xb0, 0x18, 0x9c, 0x96, - 0xd8, 0x18, 0xc2, 0xff, 0x0f, 0x8a, 0xe1, 0xf1, 0xf2, 0x21, 0x07, 0x32, 0x83, 0x7a, 0x1f, 0xb6, - 0x2f, 0x0d, 0xc0, 0x12, 0x9e, 0x3f, 0x0c, 0x96, 0xc7, 0xd7, 0xfb, 0x1c, 0x38, 0x13, 0xda, 0x87, - 0xb2, 0xb3, 0x5b, 0x18, 0x8a, 0x70, 0xfd, 0xc0, 0x28, 0x74, 0x5c, 0x06, 0x35, 0x49, 0x0b, 0xa1, - 0xba, 0xf7, 0x67, 0xb0, 0xab, 0x07, 0x81, 0xa6, 0x0b, 0x10, 0xab, 0x90, 0x87, 0xe5, 0xab, 0x1e, - 0xc8, 0x80, 0x02, 0x14, 0x52, 0x50, 0xcb, 0x37, 0x1e, 0xfc, 0x92, 0x1e, 0x79, 0xb0, 0x9f, 0xe6, - 0x1e, 0xee, 0xa7, 0xb9, 0x9f, 0xf7, 0xd3, 0xdc, 0x07, 0x8f, 0xd2, 0x23, 0x0f, 0x1f, 0xa5, 0x47, - 0x7e, 0x78, 0x94, 0x1e, 0x79, 0xed, 0x12, 0x35, 0x3e, 0xad, 0x98, 0x48, 0xbf, 0xed, 0xfe, 0xf0, - 0xa7, 0x14, 0x76, 0xc9, 0x0f, 0x80, 0x78, 0x84, 0xaa, 0xc5, 0xf0, 0x0f, 0x7a, 0xff, 0xf9, 0x33, - 0x00, 0x00, 0xff, 0xff, 0x86, 0x50, 0x9c, 0xc9, 0x9a, 0x1c, 0x00, 0x00, + // 1701 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4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22, + 0xe7, 0x74, 0x96, 0x10, 0xab, 0x12, 0x34, 0xb2, 0x70, 0x8e, 0x4e, 0xc8, 0xba, 0x66, 0x98, 0x05, + 0xfc, 0x97, 0x6c, 0x89, 0xbf, 0x73, 0x60, 0xb2, 0x82, 0xd4, 0x75, 0xcb, 0x6c, 0xc1, 0x15, 0x53, + 0x81, 0xfc, 0x34, 0x88, 0x21, 0x68, 0x28, 0xb0, 0x95, 0xe2, 0xb2, 0x5c, 0x2e, 0x21, 0x39, 0x2b, + 0xfe, 0x1a, 0x38, 0x66, 0xdf, 0x56, 0xad, 0xed, 0x59, 0xb0, 0x5a, 0x37, 0x15, 0x98, 0x1a, 0xcd, + 0x72, 0xb9, 0xc9, 0xf2, 0xd4, 0x7e, 0x27, 0x33, 0x79, 0x7b, 0x79, 0xbd, 0x52, 0xde, 0xb3, 0x30, + 0x05, 0x69, 0xd2, 0x86, 0x73, 0x57, 0xfc, 0x06, 0x98, 0xd6, 0x0c, 0x64, 0xc9, 0x86, 0xa5, 0xc9, + 0x16, 0xac, 0x36, 0x61, 0x4b, 0xd7, 0x10, 0xd2, 0x4c, 0x23, 0x35, 0x96, 0xe5, 0x72, 0x13, 0xc5, + 0x74, 0xde, 0xaf, 0xae, 0xfc, 0x72, 0xbd, 0x0e, 0x11, 0x5a, 0x31, 0x8d, 0x4d, 0x4d, 0x95, 0x4e, + 0x51, 0xd8, 0x6b, 0x1e, 0x72, 0xe9, 0xdc, 0xbb, 0x8f, 0xef, 0xcd, 0x3b, 0xbc, 0x7d, 0xf8, 0xf8, + 0xde, 0xfc, 0x09, 0xac, 0x0a, 0x5a, 0x92, 0x9b, 0xd1, 0x78, 0x64, 0x2a, 0x7a, 0x33, 0x1a, 0x8f, + 0x4e, 0x8d, 0x89, 0xb7, 0x41, 0x92, 0x3e, 0x93, 0x20, 0x6a, 0x9a, 0x06, 0x82, 0xfc, 0x79, 0x30, + 0x6e, 0xcb, 0x52, 0xd5, 0x14, 0x2c, 0x6e, 0xb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, 0x53, 0xa5, 0x43, 0x3d, 0x6e, 0xc0, 0x1d, 0x82, 0x44, 0x6b, 0x23, 0xd2, + 0xab, 0x8d, 0xd2, 0x79, 0x1f, 0xfb, 0x27, 0x5d, 0xf6, 0xa9, 0x5b, 0xc5, 0x14, 0x2e, 0x05, 0xd4, + 0x8e, 0xcb, 0xb6, 0xa8, 0x82, 0xff, 0x55, 0x90, 0xba, 0xd2, 0x80, 0x72, 0x2b, 0x9c, 0xc1, 0x30, + 0x1e, 0x44, 0x1f, 0x0f, 0xbc, 0xcb, 0x43, 0x97, 0xae, 0x38, 0x03, 0x4e, 0xf5, 0x6c, 0x78, 0x1c, + 0xfc, 0xc1, 0x61, 0xbd, 0x12, 0xe6, 0x7a, 0x23, 0x75, 0x53, 0x53, 0x03, 0xf9, 0xa1, 0xbc, 0x60, + 0x34, 0xd0, 0x0b, 0xee, 0x00, 0xc1, 0xd6, 0x6a, 0x40, 0x99, 0x8f, 0x0c, 0x55, 0xe6, 0x53, 0x06, + 0xdc, 0x59, 0x65, 0x56, 0xfa, 0x82, 0x4f, 0xec, 0x4c, 0xaf, 0xea, 0xfb, 0x64, 0x11, 0x2f, 0x00, + 0x31, 0xf8, 0xd4, 0x53, 0xc8, 0x97, 0x1c, 0x38, 0xee, 0x81, 0xad, 0xc9, 0x2d, 0x59, 0x47, 0xfc, + 0x35, 0x90, 0x90, 0xdb, 0xd6, 0x96, 0xd9, 0xd2, 0xac, 0x3d, 0xa2, 0x88, 0x72, 0xea, 0xc7, 0xaf, + 0xae, 0x24, 0x9d, 0x44, 0xb0, 0x4c, 0x32, 0xd6, 0xba, 0xd5, 0xd2, 0x0c, 0x55, 0xea, 0x82, 0xf2, + 0x2f, 0x81, 0x58, 0x13, 0x53, 0xc0, 0x4a, 0x9a, 0x28, 0xa6, 0xfa, 0x85, 0x25, 0x37, 0x94, 0x13, + 0x76, 0xe6, 0x20, 0xd9, 0xc0, 0x41, 0x21, 0x91, 0xd1, 0x25, 0x66, 0x8b,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 0xf9, 0xe9, 0x51, 0x7a, 0xe4, 0xad, 0x4b, 0xd4, + 0xf8, 0xb4, 0x62, 0x22, 0xfd, 0xb6, 0xfb, 0xd3, 0x9a, 0x52, 0xd8, 0x25, 0x3f, 0xb1, 0xe1, 0x11, + 0xaa, 0x16, 0xc3, 0x3f, 0x99, 0x3d, 0xf7, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x6a, 0x38, + 0xdb, 0xfc, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3234,44 +3185,6 @@ func (m *MsgClearAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AccessConfigUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AccessConfigUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AccessConfigUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.CodeID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *MsgUpdateInstantiateConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3500,20 +3413,20 @@ func (m *MsgPinCodes) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.CodeIDs) > 0 { - dAtA6 := make([]byte, len(m.CodeIDs)*10) - var j5 int + dAtA5 := make([]byte, len(m.CodeIDs)*10) + var j4 int for _, num := range m.CodeIDs { for num >= 1<<7 { - dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) + dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j5++ + j4++ } - dAtA6[j5] = uint8(num) - j5++ + dAtA5[j4] = uint8(num) + j4++ } - i -= j5 - copy(dAtA[i:], dAtA6[:j5]) - i = encodeVarintTx(dAtA, i, uint64(j5)) + i -= j4 + copy(dAtA[i:], dAtA5[:j4]) + i = encodeVarintTx(dAtA, i, uint64(j4)) i-- dAtA[i] = 0x12 } @@ -3571,20 +3484,20 @@ func (m *MsgUnpinCodes) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.CodeIDs) > 0 { - dAtA8 := make([]byte, len(m.CodeIDs)*10) - var j7 int + dAtA7 := make([]byte, len(m.CodeIDs)*10) + var j6 int for _, num := range m.CodeIDs { for num >= 1<<7 { - dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j7++ + j6++ } - dAtA8[j7] = uint8(num) - j7++ + dAtA7[j6] = uint8(num) + j6++ } - i -= j7 - copy(dAtA[i:], dAtA8[:j7]) - i = encodeVarintTx(dAtA, i, uint64(j7)) + i -= j6 + copy(dAtA[i:], dAtA7[:j6]) + i = encodeVarintTx(dAtA, i, uint64(j6)) i-- dAtA[i] = 0x12 } @@ -4360,20 +4273,6 @@ func (m *MsgClearAdminResponse) Size() (n int) { return n } -func (m *AccessConfigUpdate) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } - l = m.InstantiatePermission.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - func (m *MsgUpdateInstantiateConfig) Size() (n int) { if m == nil { return 0 @@ -6631,109 +6530,6 @@ func (m *MsgClearAdminResponse) Unmarshal(dAtA []byte) error { return nil } -func (m *AccessConfigUpdate) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AccessConfigUpdate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccessConfigUpdate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) - } - m.CodeID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CodeID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstantiatePermission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - func (m *MsgUpdateInstantiateConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 9ced765fccc9a7bb1f667b477b8b6387ce5a6e9a Mon Sep 17 00:00:00 2001 From: FengFeng <1290017556@qq.com> Date: Wed, 15 Nov 2023 17:15:58 +0800 Subject: [PATCH 08/11] Allow empty attribute values (#1618) * remove event value judgment * remove event value judgment * fix cosmwasm events test (cherry picked from commit 4e7316e97bcc32473ebeabeebe7084dd0ce6ddf3) --- x/wasm/keeper/events.go | 4 ---- x/wasm/keeper/events_test.go | 41 +++++++++++++++--------------------- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/x/wasm/keeper/events.go b/x/wasm/keeper/events.go index ef738b10d6..b50719d461 100644 --- a/x/wasm/keeper/events.go +++ b/x/wasm/keeper/events.go @@ -55,10 +55,6 @@ func contractSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, c return nil, errorsmod.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Empty attribute key. Value: %s", l.Value)) } value := strings.TrimSpace(l.Value) - // TODO: check if this is legal in the SDK - if it is, we can remove this check - if len(value) == 0 { - return nil, errorsmod.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Empty attribute value. Key: %s", key)) - } // and reserve all _* keys for our use (not contract) if strings.HasPrefix(key, types.AttributeReservedPrefix) { return nil, errorsmod.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Attribute key starts with reserved prefix %s: '%s'", types.AttributeReservedPrefix, key)) diff --git a/x/wasm/keeper/events_test.go b/x/wasm/keeper/events_test.go index b091eb452d..3c55a60878 100644 --- a/x/wasm/keeper/events_test.go +++ b/x/wasm/keeper/events_test.go @@ -106,6 +106,23 @@ func TestNewCustomEvents(t *testing.T) { exp: sdk.Events{sdk.NewEvent("wasm-foo", sdk.NewAttribute("_contract_address", myContract.String()))}, }, + "empty value can be solved": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: ""}}, + }}, + exp: sdk.Events{sdk.NewEvent("wasm-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("myKey", ""))}, + }, + "good on whitespace value": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "\n\n\n"}}, + }}, exp: sdk.Events{sdk.NewEvent("wasm-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("myKey", ""))}, + }, "error on short event type": { src: wasmvmtypes.Events{{ Type: "f", @@ -129,16 +146,6 @@ func TestNewCustomEvents(t *testing.T) { }}, isError: true, }, - "error on empty value": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "key", Value: ""}, - }, - }}, - isError: true, - }, "error on empty key": { src: wasmvmtypes.Events{{ Type: "boom", @@ -168,16 +175,6 @@ func TestNewCustomEvents(t *testing.T) { }}, isError: true, }, - "error on only whitespace value": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "myKey", Value: " \t\r\n"}, - }, - }}, - isError: true, - }, "strip out whitespace": { src: wasmvmtypes.Events{{ Type: " food\n", @@ -243,10 +240,6 @@ func TestNewWasmModuleEvent(t *testing.T) { src: []wasmvmtypes.EventAttribute{{Key: " ", Value: "value"}}, isError: true, }, - "error on whitespace value": { - src: []wasmvmtypes.EventAttribute{{Key: "key", Value: "\n\n\n"}}, - isError: true, - }, "strip whitespace": { src: []wasmvmtypes.EventAttribute{{Key: " my-real-key ", Value: "\n\n\nsome-val\t\t\t"}}, exp: sdk.Events{sdk.NewEvent("wasm", From 9493f3a21e954645658f67e7a480d930b9a6d1ac Mon Sep 17 00:00:00 2001 From: Pino' Surace Date: Wed, 15 Nov 2023 14:22:07 +0100 Subject: [PATCH 09/11] Retract wasmd v0.43.0 and v0.44.0 (cherry picked from commit 12589b2067fb29911d581add94f1a2b3fd2cf723) --- go.mod | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 36b6afaf74..594ef0d522 100644 --- a/go.mod +++ b/go.mod @@ -194,5 +194,11 @@ replace ( github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) -// see https://github.com/CosmWasm/wasmd/issues/1651 -retract v0.42.0 +retract ( + // see https://github.com/CosmWasm/wasmd/issues/1713 + v0.44.0 + // see https://github.com/CosmWasm/wasmd/issues/1713 + v0.43.0 + // see https://github.com/CosmWasm/wasmd/issues/1651 + v0.42.0 +) From 159da1add45f2ad3053bb5219d4a540123260c90 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:21:33 +0100 Subject: [PATCH 10/11] Pass empty attribute value through stack (#1723) (cherry picked from commit f31351fea0557f11d7d8e374cabefbcb22e1e43e) Co-authored-by: Alex Peters --- x/wasm/keeper/events_test.go | 6 +++--- x/wasm/relay_pingpong_test.go | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/x/wasm/keeper/events_test.go b/x/wasm/keeper/events_test.go index 3c55a60878..f3e5cc73f2 100644 --- a/x/wasm/keeper/events_test.go +++ b/x/wasm/keeper/events_test.go @@ -119,9 +119,9 @@ func TestNewCustomEvents(t *testing.T) { src: wasmvmtypes.Events{{ Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "\n\n\n"}}, - }}, exp: sdk.Events{sdk.NewEvent("wasm-foo", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("myKey", ""))}, + }}, exp: sdk.Events{sdk.NewEvent("wasm-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("myKey", ""))}, }, "error on short event type": { src: wasmvmtypes.Events{{ diff --git a/x/wasm/relay_pingpong_test.go b/x/wasm/relay_pingpong_test.go index a9eadc7f90..40af77b551 100644 --- a/x/wasm/relay_pingpong_test.go +++ b/x/wasm/relay_pingpong_test.go @@ -262,6 +262,9 @@ func (p player) IBCPacketReceive(_ wasmvm.Checksum, _ wasmvmtypes.Env, msg wasmv return &wasmvmtypes.IBCReceiveResult{ Ok: &wasmvmtypes.IBCReceiveResponse{ + Attributes: wasmvmtypes.EventAttributes{ + {Key: "empty-value-test"}, + }, Acknowledgement: receivedBall.BuildAck().GetBytes(), Messages: []wasmvmtypes.SubMsg{{Msg: wasmvmtypes.CosmosMsg{IBC: respHit}, ReplyOn: wasmvmtypes.ReplyNever}}, }, From 7165e41cbf14d60a9fef4fb1e04c2c2e5e4e0cf4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:25:17 +0100 Subject: [PATCH 11/11] Add changelog for 0.45 release (#1721) (#1724) (cherry picked from commit 8eaa55b94db111dcf30694dc41d7a17ea30f1d8f) Co-authored-by: pinosu <95283998+pinosu@users.noreply.github.com> --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1394cf097f..bf559cdf55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,22 @@ ## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD) -[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.44.0...HEAD) +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.45.0...HEAD) + +## [v0.45.0](https://github.com/CosmWasm/wasmd/tree/v0.45.0) (2023-11-15) + +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.44.0...v0.45.0) + +- Retract wasmd v0.43.0 and v0.44.0 [\#1720](https://github.com/CosmWasm/wasmd/pull/1720) +- Allow empty attribute values [\#1618](https://github.com/CosmWasm/wasmd/pull/1618) +- Fix gov v1beta1 support for legacy proposals [\#1715](https://github.com/CosmWasm/wasmd/pull/1715) +- Prevent empty channel version [\#1697](https://github.com/CosmWasm/wasmd/pull/1697) + +### Notable changes: +- Wasmd v0.43.0 and 0.44.0 releases were retracted because of a bug related to legacy proposals. See https://github.com/CosmWasm/wasmd/issues/1713 for more details. + +### Migration notes: +- This release does not include any state migrations but breaking changes that require a coordinated chain upgrade. ## [v0.44.0](https://github.com/CosmWasm/wasmd/tree/v0.44.0) (2023-11-06)