diff --git a/CHANGELOG.md b/CHANGELOG.md index a0395077ea..4daa475379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,25 @@ It solves some incompatibility problems by improving cache invalidation. See [\# ### Migration notes: - This release does not include any state migrations or breaking changes, therefore a coordinated chain upgrade is not required. -[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.42.0...HEAD) +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.43.0...HEAD) + +## [v0.43.0](https://github.com/CosmWasm/wasmd/tree/v0.43.0) (2023-10-10) + +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.42.0...v0.43.0) + +- Make contract label updatable [\#1601](https://github.com/CosmWasm/wasmd/issues/1601) +- Remove gov v1beta1 dependencies and deprecated proposals [\#1608](https://github.com/CosmWasm/wasmd/issues/1608) +- Retract v0.42.0 release [\#1651](https://github.com/CosmWasm/wasmd/issues/1651) +- Bump wasmvm to v1.4.1 [\#1657](https://github.com/CosmWasm/wasmd/issues/1657) + +### Notable changes: +- Wasmd v0.42.0 was retracted because an issue was found in CosmWasm 1.4.0. See https://twitter.com/CosmWasm/status/1709507168448229497 +- This release bundles CosmWasm v1.4.1 patch release. If you are using wasmd v0.42.0 please upgrade to wasmd 0.43.0 as soon as possible. +- Deprecated wasm gov proposals have been removed completely from the codebase together with all the govv1beta1 dependencies. +- MsgUpdateContractLabel was introduced to allow contract label updates. + +### Migration notes: +- This release does not include any state migrations but breaking changes that require a coordinated chain upgrade. ## [v0.42.0](https://github.com/CosmWasm/wasmd/tree/v0.42.0) (2023-09-20) diff --git a/Dockerfile b/Dockerfile index e232756849..49902c3d2f 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.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a -ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2a72c7062e3c791792b3dab781c815c9a76083a7997ce6f9f2799aaf577f3c25 -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 8ea2e3b5fae83e671da2bb51115adc88591045953f509955ec38dc02ea5a7b94 +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 # 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/app/app.go b/app/app.go index 95c72844f5..093dce11ee 100644 --- a/app/app.go +++ b/app/app.go @@ -579,13 +579,6 @@ func NewWasmApp( wasmOpts..., ) - // DEPRECATED: DO NOT USE - // - // The gov proposal types can be individually enabled - // if len(enabledProposals) != 0 { - // govRouter.AddRoute(wasmtypes.RouterKey, wasmkeeper.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) - //} - // Set legacy router for backwards compatibility with gov v1beta1 app.GovKeeper.SetLegacyRouter(govRouter) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index e7d1dca0f9..2ea6190ed0 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -30,47 +30,10 @@ - [MaxFundsLimit](#cosmwasm.wasm.v1.MaxFundsLimit) - [StoreCodeAuthorization](#cosmwasm.wasm.v1.StoreCodeAuthorization) -- [cosmwasm/wasm/v1/tx.proto](#cosmwasm/wasm/v1/tx.proto) - - [MsgAddCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses) - - [MsgAddCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse) - - [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin) - - [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse) - - [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) - - [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse) - - [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) - - [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2) - - [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response) - - [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse) - - [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract) - - [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse) - - [MsgPinCodes](#cosmwasm.wasm.v1.MsgPinCodes) - - [MsgPinCodesResponse](#cosmwasm.wasm.v1.MsgPinCodesResponse) - - [MsgRemoveCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses) - - [MsgRemoveCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse) - - [MsgStoreAndInstantiateContract](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContract) - - [MsgStoreAndInstantiateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse) - - [MsgStoreAndMigrateContract](#cosmwasm.wasm.v1.MsgStoreAndMigrateContract) - - [MsgStoreAndMigrateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse) - - [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) - - [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse) - - [MsgSudoContract](#cosmwasm.wasm.v1.MsgSudoContract) - - [MsgSudoContractResponse](#cosmwasm.wasm.v1.MsgSudoContractResponse) - - [MsgUnpinCodes](#cosmwasm.wasm.v1.MsgUnpinCodes) - - [MsgUnpinCodesResponse](#cosmwasm.wasm.v1.MsgUnpinCodesResponse) - - [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin) - - [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse) - - [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig) - - [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse) - - [MsgUpdateParams](#cosmwasm.wasm.v1.MsgUpdateParams) - - [MsgUpdateParamsResponse](#cosmwasm.wasm.v1.MsgUpdateParamsResponse) - - - [Msg](#cosmwasm.wasm.v1.Msg) - - [cosmwasm/wasm/v1/genesis.proto](#cosmwasm/wasm/v1/genesis.proto) - [Code](#cosmwasm.wasm.v1.Code) - [Contract](#cosmwasm.wasm.v1.Contract) - [GenesisState](#cosmwasm.wasm.v1.GenesisState) - - [GenesisState.GenMsgs](#cosmwasm.wasm.v1.GenesisState.GenMsgs) - [Sequence](#cosmwasm.wasm.v1.Sequence) - [cosmwasm/wasm/v1/ibc.proto](#cosmwasm/wasm/v1/ibc.proto) @@ -78,21 +41,6 @@ - [MsgIBCSend](#cosmwasm.wasm.v1.MsgIBCSend) - [MsgIBCSendResponse](#cosmwasm.wasm.v1.MsgIBCSendResponse) -- [cosmwasm/wasm/v1/proposal.proto](#cosmwasm/wasm/v1/proposal.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) @@ -120,6 +68,45 @@ - [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) + - [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse) + - [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) + - [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse) + - [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) + - [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2) + - [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response) + - [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse) + - [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract) + - [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse) + - [MsgPinCodes](#cosmwasm.wasm.v1.MsgPinCodes) + - [MsgPinCodesResponse](#cosmwasm.wasm.v1.MsgPinCodesResponse) + - [MsgRemoveCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses) + - [MsgRemoveCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse) + - [MsgStoreAndInstantiateContract](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContract) + - [MsgStoreAndInstantiateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse) + - [MsgStoreAndMigrateContract](#cosmwasm.wasm.v1.MsgStoreAndMigrateContract) + - [MsgStoreAndMigrateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse) + - [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) + - [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse) + - [MsgSudoContract](#cosmwasm.wasm.v1.MsgSudoContract) + - [MsgSudoContractResponse](#cosmwasm.wasm.v1.MsgSudoContractResponse) + - [MsgUnpinCodes](#cosmwasm.wasm.v1.MsgUnpinCodes) + - [MsgUnpinCodesResponse](#cosmwasm.wasm.v1.MsgUnpinCodesResponse) + - [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin) + - [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse) + - [MsgUpdateContractLabel](#cosmwasm.wasm.v1.MsgUpdateContractLabel) + - [MsgUpdateContractLabelResponse](#cosmwasm.wasm.v1.MsgUpdateContractLabelResponse) + - [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig) + - [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse) + - [MsgUpdateParams](#cosmwasm.wasm.v1.MsgUpdateParams) + - [MsgUpdateParamsResponse](#cosmwasm.wasm.v1.MsgUpdateParamsResponse) + + - [Msg](#cosmwasm.wasm.v1.Msg) + - [Scalar Value Types](#scalar-value-types) @@ -498,539 +485,530 @@ Since: wasmd 0.42 - +
-## cosmwasm/wasm/v1/tx.proto +## cosmwasm/wasm/v1/genesis.proto - + -### MsgAddCodeUploadParamsAddresses -MsgAddCodeUploadParamsAddresses is the -MsgAddCodeUploadParamsAddresses request type. +### Code +Code struct encompasses CodeInfo and CodeBytes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `addresses` | [string](#string) | repeated | | +| `code_id` | [uint64](#uint64) | | | +| `code_info` | [CodeInfo](#cosmwasm.wasm.v1.CodeInfo) | | | +| `code_bytes` | [bytes](#bytes) | | | +| `pinned` | [bool](#bool) | | Pinned to wasmvm cache | - + -### MsgAddCodeUploadParamsAddressesResponse -MsgAddCodeUploadParamsAddressesResponse defines the response -structure for executing a MsgAddCodeUploadParamsAddresses message. +### Contract +Contract struct encompasses ContractAddress, ContractInfo, and ContractState + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `contract_address` | [string](#string) | | | +| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | | +| `contract_state` | [Model](#cosmwasm.wasm.v1.Model) | repeated | | +| `contract_code_history` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | | - + -### MsgClearAdmin -MsgClearAdmin removes any admin stored for a smart contract +### GenesisState +GenesisState - genesis state of x/wasm | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the actor that signed the messages | -| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `params` | [Params](#cosmwasm.wasm.v1.Params) | | | +| `codes` | [Code](#cosmwasm.wasm.v1.Code) | repeated | | +| `contracts` | [Contract](#cosmwasm.wasm.v1.Contract) | repeated | | +| `sequences` | [Sequence](#cosmwasm.wasm.v1.Sequence) | repeated | | - + -### MsgClearAdminResponse -MsgClearAdminResponse returns empty data +### Sequence +Sequence key and value of an id generation counter + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id_key` | [bytes](#bytes) | | | +| `value` | [uint64](#uint64) | | | + - + -### MsgExecuteContract -MsgExecuteContract submits the given message data to a smart contract + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `contract` | [string](#string) | | Contract is the address of the smart contract | -| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract | -| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on execution | + + +## cosmwasm/wasm/v1/ibc.proto - + -### MsgExecuteContractResponse -MsgExecuteContractResponse returns execution result data. +### MsgIBCCloseChannel +MsgIBCCloseChannel port and channel need to be owned by the contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | +| `channel` | [string](#string) | | | - + -### MsgInstantiateContract -MsgInstantiateContract create a new smart contract instance for the given -code id. +### MsgIBCSend +MsgIBCSend | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `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 contract 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 | +| `channel` | [string](#string) | | the channel by which the packet will be sent | +| `timeout_height` | [uint64](#uint64) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | +| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | +| `data` | [bytes](#bytes) | | Data is the payload to transfer. We must not make assumption what format or content is in here. | - + -### MsgInstantiateContract2 -MsgInstantiateContract2 create a new smart contract instance for the given -code id with a predicable address. +### MsgIBCSendResponse +MsgIBCSendResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `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 contract 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 | -| `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 | +| `sequence` | [uint64](#uint64) | | Sequence number of the IBC packet sent | + - + -### MsgInstantiateContract2Response -MsgInstantiateContract2Response return instantiation result data + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | + + +## cosmwasm/wasm/v1/query.proto - + -### MsgInstantiateContractResponse -MsgInstantiateContractResponse return instantiation result data +### CodeInfoResponse +CodeInfoResponse contains code meta data from CodeInfo | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | +| `code_id` | [uint64](#uint64) | | id for legacy support | +| `creator` | [string](#string) | | | +| `data_hash` | [bytes](#bytes) | | | +| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | | - + -### MsgMigrateContract -MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +### QueryAllContractStateRequest +QueryAllContractStateRequest is the request type for the +Query/AllContractState RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `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 | +| `address` | [string](#string) | | address is the address of the contract | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgMigrateContractResponse -MsgMigrateContractResponse returns contract migration result data. +### QueryAllContractStateResponse +QueryAllContractStateResponse is the response type for the +Query/AllContractState RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains same raw bytes returned as data from the wasm contract. (May be empty) | - +| `models` | [Model](#cosmwasm.wasm.v1.Model) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgPinCodes -MsgPinCodes is the MsgPinCodes request type. + -Since: 0.40 +### QueryCodeRequest +QueryCodeRequest is the request type for the Query/Code RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the new WASM codes | +| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID | - + -### MsgPinCodesResponse -MsgPinCodesResponse defines the response structure for executing a -MsgPinCodes message. +### QueryCodeResponse +QueryCodeResponse is the response type for the Query/Code RPC method -Since: 0.40 +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `code_info` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | | | +| `data` | [bytes](#bytes) | | | - -### MsgRemoveCodeUploadParamsAddresses -MsgRemoveCodeUploadParamsAddresses is the -MsgRemoveCodeUploadParamsAddresses request type. + + +### QueryCodesRequest +QueryCodesRequest is the request type for the Query/Codes RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `addresses` | [string](#string) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgRemoveCodeUploadParamsAddressesResponse -MsgRemoveCodeUploadParamsAddressesResponse defines the response -structure for executing a MsgRemoveCodeUploadParamsAddresses message. +### QueryCodesResponse +QueryCodesResponse is the response type for the Query/Codes RPC method +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `code_infos` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgStoreAndInstantiateContract -MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract -request type. -Since: 0.40 + + +### QueryContractHistoryRequest +QueryContractHistoryRequest is the request type for the Query/ContractHistory +RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `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. As default the uploaded contract is pinned to cache. | -| `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 from the authority account 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 | - +| `address` | [string](#string) | | address is the address of the contract to query | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - -### MsgStoreAndInstantiateContractResponse -MsgStoreAndInstantiateContractResponse defines the response structure -for executing a MsgStoreAndInstantiateContract message. + -Since: 0.40 +### QueryContractHistoryResponse +QueryContractHistoryResponse is the response type for the +Query/ContractHistory RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - +| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgStoreAndMigrateContract -MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract -request type. + -Since: 0.42 +### QueryContractInfoRequest +QueryContractInfoRequest is the request type for the Query/ContractInfo RPC +method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `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 | -| `contract` | [string](#string) | | Contract is the address of the smart contract | -| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on migration | - +| `address` | [string](#string) | | address is the address of the contract to query | - -### MsgStoreAndMigrateContractResponse -MsgStoreAndMigrateContractResponse defines the response structure -for executing a MsgStoreAndMigrateContract message. + -Since: 0.42 +### QueryContractInfoResponse +QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| `checksum` | [bytes](#bytes) | | Checksum is the sha256 hash of the stored code | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | +| `address` | [string](#string) | | address is the address of the contract | +| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | | - + -### MsgStoreCode -MsgStoreCode submit Wasm code to the system +### QueryContractsByCodeRequest +QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the actor that signed the messages | -| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | -| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional | +| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgStoreCodeResponse -MsgStoreCodeResponse returns store result data. +### QueryContractsByCodeResponse +QueryContractsByCodeResponse is the response type for the +Query/ContractsByCode RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| `checksum` | [bytes](#bytes) | | Checksum is the sha256 hash of the stored code | - +| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgSudoContract -MsgSudoContract is the MsgSudoContract request type. + -Since: 0.40 +### QueryContractsByCreatorRequest +QueryContractsByCreatorRequest is the request type for the +Query/ContractsByCreator RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `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 | - +| `creator_address` | [string](#string) | | CreatorAddress is the address of contract creator | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | Pagination defines an optional pagination for the request. | - -### MsgSudoContractResponse -MsgSudoContractResponse defines the response structure for executing a -MsgSudoContract message. + -Since: 0.40 +### QueryContractsByCreatorResponse +QueryContractsByCreatorResponse is the response type for the +Query/ContractsByCreator RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - - +| `contract_addresses` | [string](#string) | repeated | ContractAddresses result set | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | Pagination defines the pagination in the response. | - -### MsgUnpinCodes -MsgUnpinCodes is the MsgUnpinCodes request type. -Since: 0.40 + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the WASM codes | + - +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. -### MsgUnpinCodesResponse -MsgUnpinCodesResponse defines the response structure for executing a -MsgUnpinCodes message. -Since: 0.40 +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmwasm.wasm.v1.Params) | | params defines the parameters of the module. | - + -### MsgUpdateAdmin -MsgUpdateAdmin sets a new admin for a smart contract +### QueryPinnedCodesRequest +QueryPinnedCodesRequest is the request type for the Query/PinnedCodes +RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `new_admin` | [string](#string) | | NewAdmin address to be set | -| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### MsgUpdateAdminResponse -MsgUpdateAdminResponse returns empty data +### QueryPinnedCodesResponse +QueryPinnedCodesResponse is the response type for the +Query/PinnedCodes RPC method +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `code_ids` | [uint64](#uint64) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### MsgUpdateInstantiateConfig -MsgUpdateInstantiateConfig updates instantiate config for a smart contract + + + +### QueryRawContractStateRequest +QueryRawContractStateRequest is the request type for the +Query/RawContractState RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | Sender is the that actor that signed the messages | -| `code_id` | [uint64](#uint64) | | CodeID references the stored WASM code | -| `new_instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | NewInstantiatePermission is the new access control | +| `address` | [string](#string) | | address is the address of the contract | +| `query_data` | [bytes](#bytes) | | | - + -### MsgUpdateInstantiateConfigResponse -MsgUpdateInstantiateConfigResponse returns empty data +### QueryRawContractStateResponse +QueryRawContractStateResponse is the response type for the +Query/RawContractState RPC method +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | Data contains the raw store data | - -### MsgUpdateParams -MsgUpdateParams is the MsgUpdateParams request type. -Since: 0.40 + + +### QuerySmartContractStateRequest +QuerySmartContractStateRequest is the request type for the +Query/SmartContractState RPC method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authority` | [string](#string) | | Authority is the address of the governance account. | -| `params` | [Params](#cosmwasm.wasm.v1.Params) | | params defines the x/wasm parameters to update. +| `address` | [string](#string) | | address is the address of the contract | +| `query_data` | [bytes](#bytes) | | QueryData contains the query data passed to the contract | -NOTE: All parameters must be supplied. | + - +### QuerySmartContractStateResponse +QuerySmartContractStateResponse is the response type for the +Query/SmartContractState RPC method -### MsgUpdateParamsResponse -MsgUpdateParamsResponse defines the response structure for executing a -MsgUpdateParams message. -Since: 0.40 +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | Data contains the json data returned from the smart contract | @@ -1043,399 +1021,327 @@ Since: 0.40 - + -### Msg -Msg defines the wasm Msg service. +### Query +Query provides defines the gRPC querier service | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `StoreCode` | [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) | [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse) | StoreCode to submit Wasm code to the system | | -| `InstantiateContract` | [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) | [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse) | InstantiateContract creates a new smart contract instance for the given code id. | | -| `InstantiateContract2` | [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2) | [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response) | InstantiateContract2 creates a new smart contract instance for the given code id with a predictable address | | -| `ExecuteContract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse) | Execute submits the given message data to a smart contract | | -| `MigrateContract` | [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract) | [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse) | Migrate runs a code upgrade/ downgrade for a smart contract | | -| `UpdateAdmin` | [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin) | [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse) | UpdateAdmin sets a new admin for a smart contract | | -| `ClearAdmin` | [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin) | [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse) | ClearAdmin removes any admin stored for a smart contract | | -| `UpdateInstantiateConfig` | [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig) | [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse) | UpdateInstantiateConfig updates instantiate config for a smart contract | | -| `UpdateParams` | [MsgUpdateParams](#cosmwasm.wasm.v1.MsgUpdateParams) | [MsgUpdateParamsResponse](#cosmwasm.wasm.v1.MsgUpdateParamsResponse) | UpdateParams defines a governance operation for updating the x/wasm module parameters. The authority is defined in the keeper. - -Since: 0.40 | | -| `SudoContract` | [MsgSudoContract](#cosmwasm.wasm.v1.MsgSudoContract) | [MsgSudoContractResponse](#cosmwasm.wasm.v1.MsgSudoContractResponse) | SudoContract defines a governance operation for calling sudo on a contract. The authority is defined in the keeper. - -Since: 0.40 | | -| `PinCodes` | [MsgPinCodes](#cosmwasm.wasm.v1.MsgPinCodes) | [MsgPinCodesResponse](#cosmwasm.wasm.v1.MsgPinCodesResponse) | PinCodes defines a governance operation for pinning a set of code ids in the wasmvm cache. The authority is defined in the keeper. - -Since: 0.40 | | -| `UnpinCodes` | [MsgUnpinCodes](#cosmwasm.wasm.v1.MsgUnpinCodes) | [MsgUnpinCodesResponse](#cosmwasm.wasm.v1.MsgUnpinCodesResponse) | UnpinCodes defines a governance operation for unpinning a set of code ids in the wasmvm cache. The authority is defined in the keeper. - -Since: 0.40 | | -| `StoreAndInstantiateContract` | [MsgStoreAndInstantiateContract](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContract) | [MsgStoreAndInstantiateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse) | StoreAndInstantiateContract defines a governance operation for storing and instantiating the contract. The authority is defined in the keeper. - -Since: 0.40 | | -| `RemoveCodeUploadParamsAddresses` | [MsgRemoveCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses) | [MsgRemoveCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse) | RemoveCodeUploadParamsAddresses defines a governance operation for removing addresses from code upload params. The authority is defined in the keeper. | | -| `AddCodeUploadParamsAddresses` | [MsgAddCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses) | [MsgAddCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse) | AddCodeUploadParamsAddresses defines a governance operation for adding addresses to code upload params. The authority is defined in the keeper. | | -| `StoreAndMigrateContract` | [MsgStoreAndMigrateContract](#cosmwasm.wasm.v1.MsgStoreAndMigrateContract) | [MsgStoreAndMigrateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse) | StoreAndMigrateContract defines a governance operation for storing and migrating the contract. The authority is defined in the keeper. - -Since: 0.42 | | +| `ContractInfo` | [QueryContractInfoRequest](#cosmwasm.wasm.v1.QueryContractInfoRequest) | [QueryContractInfoResponse](#cosmwasm.wasm.v1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | GET|/cosmwasm/wasm/v1/contract/{address}| +| `ContractHistory` | [QueryContractHistoryRequest](#cosmwasm.wasm.v1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#cosmwasm.wasm.v1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | GET|/cosmwasm/wasm/v1/contract/{address}/history| +| `ContractsByCode` | [QueryContractsByCodeRequest](#cosmwasm.wasm.v1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#cosmwasm.wasm.v1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | GET|/cosmwasm/wasm/v1/code/{code_id}/contracts| +| `AllContractState` | [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#cosmwasm.wasm.v1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | GET|/cosmwasm/wasm/v1/contract/{address}/state| +| `RawContractState` | [QueryRawContractStateRequest](#cosmwasm.wasm.v1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#cosmwasm.wasm.v1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | GET|/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}| +| `SmartContractState` | [QuerySmartContractStateRequest](#cosmwasm.wasm.v1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#cosmwasm.wasm.v1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | GET|/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}| +| `Code` | [QueryCodeRequest](#cosmwasm.wasm.v1.QueryCodeRequest) | [QueryCodeResponse](#cosmwasm.wasm.v1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | GET|/cosmwasm/wasm/v1/code/{code_id}| +| `Codes` | [QueryCodesRequest](#cosmwasm.wasm.v1.QueryCodesRequest) | [QueryCodesResponse](#cosmwasm.wasm.v1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | GET|/cosmwasm/wasm/v1/code| +| `PinnedCodes` | [QueryPinnedCodesRequest](#cosmwasm.wasm.v1.QueryPinnedCodesRequest) | [QueryPinnedCodesResponse](#cosmwasm.wasm.v1.QueryPinnedCodesResponse) | PinnedCodes gets the pinned code ids | GET|/cosmwasm/wasm/v1/codes/pinned| +| `Params` | [QueryParamsRequest](#cosmwasm.wasm.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmwasm.wasm.v1.QueryParamsResponse) | Params gets the module params | GET|/cosmwasm/wasm/v1/codes/params| +| `ContractsByCreator` | [QueryContractsByCreatorRequest](#cosmwasm.wasm.v1.QueryContractsByCreatorRequest) | [QueryContractsByCreatorResponse](#cosmwasm.wasm.v1.QueryContractsByCreatorResponse) | ContractsByCreator gets the contracts by creator | GET|/cosmwasm/wasm/v1/contracts/creator/{creator_address}| - + -## cosmwasm/wasm/v1/genesis.proto +## cosmwasm/wasm/v1/tx.proto - + -### Code -Code struct encompasses CodeInfo and CodeBytes +### AccessConfigUpdate +AccessConfigUpdate contains the code id and the access config to be +applied. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | | -| `code_info` | [CodeInfo](#cosmwasm.wasm.v1.CodeInfo) | | | -| `code_bytes` | [bytes](#bytes) | | | -| `pinned` | [bool](#bool) | | Pinned to wasmvm cache | +| `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 | - + -### Contract -Contract struct encompasses ContractAddress, ContractInfo, and ContractState +### MsgAddCodeUploadParamsAddresses +MsgAddCodeUploadParamsAddresses is the +MsgAddCodeUploadParamsAddresses request type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contract_address` | [string](#string) | | | -| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | | -| `contract_state` | [Model](#cosmwasm.wasm.v1.Model) | repeated | | -| `contract_code_history` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | | - - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `addresses` | [string](#string) | repeated | | - -### GenesisState -GenesisState - genesis state of x/wasm + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmwasm.wasm.v1.Params) | | | -| `codes` | [Code](#cosmwasm.wasm.v1.Code) | repeated | | -| `contracts` | [Contract](#cosmwasm.wasm.v1.Contract) | repeated | | -| `sequences` | [Sequence](#cosmwasm.wasm.v1.Sequence) | repeated | | -| `gen_msgs` | [GenesisState.GenMsgs](#cosmwasm.wasm.v1.GenesisState.GenMsgs) | repeated | | +### MsgAddCodeUploadParamsAddressesResponse +MsgAddCodeUploadParamsAddressesResponse defines the response +structure for executing a MsgAddCodeUploadParamsAddresses message. - + -### GenesisState.GenMsgs -GenMsgs define the messages that can be executed during genesis phase in -order. The intention is to have more human readable data that is auditable. +### MsgClearAdmin +MsgClearAdmin removes any admin stored for a smart contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `store_code` | [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) | | | -| `instantiate_contract` | [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) | | | -| `execute_contract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | | MsgInstantiateContract2 intentionally not supported see https://github.com/CosmWasm/wasmd/issues/987 | - - +| `sender` | [string](#string) | | Sender is the actor that signed the messages | +| `contract` | [string](#string) | | Contract is the address of the smart contract | - -### Sequence -Sequence key and value of an id generation counter + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `id_key` | [bytes](#bytes) | | | -| `value` | [uint64](#uint64) | | | +### MsgClearAdminResponse +MsgClearAdminResponse returns empty data - - + - +### MsgExecuteContract +MsgExecuteContract submits the given message data to a smart contract - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `contract` | [string](#string) | | Contract is the address of the smart contract | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on execution | - - -## cosmwasm/wasm/v1/ibc.proto - + -### MsgIBCCloseChannel -MsgIBCCloseChannel port and channel need to be owned by the contract +### MsgExecuteContractResponse +MsgExecuteContractResponse returns execution result data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `channel` | [string](#string) | | | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - + -### MsgIBCSend -MsgIBCSend +### MsgInstantiateContract +MsgInstantiateContract create a new smart contract instance for the given +code id. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `channel` | [string](#string) | | the channel by which the packet will be sent | -| `timeout_height` | [uint64](#uint64) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | -| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | -| `data` | [bytes](#bytes) | | Data is the payload to transfer. We must not make assumption what format or content is in here. | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `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 contract 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 | - + -### MsgIBCSendResponse -MsgIBCSendResponse +### MsgInstantiateContract2 +MsgInstantiateContract2 create a new smart contract instance for the given +code id with a predicable address. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `sequence` | [uint64](#uint64) | | Sequence number of the IBC packet sent | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `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 contract 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 | +| `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 | - - + - +### MsgInstantiateContract2Response +MsgInstantiateContract2Response return instantiation result data - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - - -## cosmwasm/wasm/v1/proposal.proto - + -### AccessConfigUpdate -AccessConfigUpdate contains the code id and the access config to be -applied. +### MsgInstantiateContractResponse +MsgInstantiateContractResponse return instantiation result data | 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 | +| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - + -### 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. +### MsgMigrateContract +MsgMigrateContract runs a code upgrade/ downgrade for a smart contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | Title is a short summary | -| `description` | [string](#string) | | Description is a human readable text | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | | `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 | - + -### 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. +### MsgMigrateContractResponse +MsgMigrateContractResponse returns contract migration result data. | 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 | +| `data` | [bytes](#bytes) | | Data contains same raw bytes returned as data from the wasm contract. (May be empty) | + + - +### MsgPinCodes +MsgPinCodes is the MsgPinCodes request type. -### 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. +Since: 0.40 | 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 | - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the new WASM codes | - -### 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. + +### MsgPinCodesResponse +MsgPinCodesResponse defines the response structure for executing a +MsgPinCodes message. -| 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 | +Since: 0.40 - + -### 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. +### MsgRemoveCodeUploadParamsAddresses +MsgRemoveCodeUploadParamsAddresses is the +MsgRemoveCodeUploadParamsAddresses request type. | 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 | - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `addresses` | [string](#string) | repeated | | - -### 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. + +### MsgRemoveCodeUploadParamsAddressesResponse +MsgRemoveCodeUploadParamsAddressesResponse defines the response +structure for executing a MsgRemoveCodeUploadParamsAddresses message. -| 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 | + - +### MsgStoreAndInstantiateContract +MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract +request type. -### 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. +Since: 0.40 | 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 | +| `authority` | [string](#string) | | Authority is the address of the governance account. | | `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 | +| `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional. As default the uploaded contract is pinned to cache. | | `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 | +| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred from the authority account 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 | @@ -1445,527 +1351,326 @@ the x/gov module via a v1 governance proposal. - + + +### MsgStoreAndInstantiateContractResponse +MsgStoreAndInstantiateContractResponse defines the response structure +for executing a MsgStoreAndInstantiateContract message. -### 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. +Since: 0.40 | 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 | +| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | + + - +### MsgStoreAndMigrateContract +MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract +request type. -### 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. +Since: 0.42 | 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 | +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `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 | | `contract` | [string](#string) | | Contract is the address of the smart contract | +| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on migration | - - -### 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. | - - - - - - - - - - - - - - - - - - -## cosmwasm/wasm/v1/query.proto - - - - - -### CodeInfoResponse -CodeInfoResponse contains code meta data from CodeInfo - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | id for legacy support | -| `creator` | [string](#string) | | | -| `data_hash` | [bytes](#bytes) | | | -| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | | - - - - - - - - -### QueryAllContractStateRequest -QueryAllContractStateRequest is the request type for the -Query/AllContractState RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryAllContractStateResponse -QueryAllContractStateResponse is the response type for the -Query/AllContractState RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `models` | [Model](#cosmwasm.wasm.v1.Model) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryCodeRequest -QueryCodeRequest is the request type for the Query/Code RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID | - - - - - + - +### MsgStoreAndMigrateContractResponse +MsgStoreAndMigrateContractResponse defines the response structure +for executing a MsgStoreAndMigrateContract message. -### QueryCodeResponse -QueryCodeResponse is the response type for the Query/Code RPC method +Since: 0.42 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_info` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | | | -| `data` | [bytes](#bytes) | | | +| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| `checksum` | [bytes](#bytes) | | Checksum is the sha256 hash of the stored code | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | - + -### QueryCodesRequest -QueryCodesRequest is the request type for the Query/Codes RPC method +### MsgStoreCode +MsgStoreCode submit Wasm code to the system | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `sender` | [string](#string) | | Sender is the actor that signed the messages | +| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed | +| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional | - + -### QueryCodesResponse -QueryCodesResponse is the response type for the Query/Codes RPC method +### MsgStoreCodeResponse +MsgStoreCodeResponse returns store result data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_infos` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryContractHistoryRequest -QueryContractHistoryRequest is the request type for the Query/ContractHistory -RPC method - +| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | +| `checksum` | [bytes](#bytes) | | Checksum is the sha256 hash of the stored code | -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract to query | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + - +### MsgSudoContract +MsgSudoContract is the MsgSudoContract request type. -### QueryContractHistoryResponse -QueryContractHistoryResponse is the response type for the -Query/ContractHistory RPC method +Since: 0.40 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `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 | -### QueryContractInfoRequest -QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract to query | + - +### MsgSudoContractResponse +MsgSudoContractResponse defines the response structure for executing a +MsgSudoContract message. -### QueryContractInfoResponse -QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -method +Since: 0.40 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract | -| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | | - - - - - - - - -### QueryContractsByCodeRequest -QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -RPC method - +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + - +### MsgUnpinCodes +MsgUnpinCodes is the MsgUnpinCodes request type. -### QueryContractsByCodeResponse -QueryContractsByCodeResponse is the response type for the -Query/ContractsByCode RPC method +Since: 0.40 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the WASM codes | - -### QueryContractsByCreatorRequest -QueryContractsByCreatorRequest is the request type for the -Query/ContractsByCreator RPC method. + +### MsgUnpinCodesResponse +MsgUnpinCodesResponse defines the response structure for executing a +MsgUnpinCodes message. -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `creator_address` | [string](#string) | | CreatorAddress is the address of contract creator | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | Pagination defines an optional pagination for the request. | +Since: 0.40 - + -### QueryContractsByCreatorResponse -QueryContractsByCreatorResponse is the response type for the -Query/ContractsByCreator RPC method. +### MsgUpdateAdmin +MsgUpdateAdmin sets a new admin for a smart contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `contract_addresses` | [string](#string) | repeated | ContractAddresses result set | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | Pagination defines the pagination in the response. | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `new_admin` | [string](#string) | | NewAdmin address to be set | +| `contract` | [string](#string) | | Contract is the address of the smart contract | - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. +### MsgUpdateAdminResponse +MsgUpdateAdminResponse returns empty data - + -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. +### MsgUpdateContractLabel +MsgUpdateContractLabel sets a new label for a smart contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmwasm.wasm.v1.Params) | | params defines the parameters of the module. | - - +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `new_label` | [string](#string) | | NewLabel string to be set | +| `contract` | [string](#string) | | Contract is the address of the smart contract | - -### QueryPinnedCodesRequest -QueryPinnedCodesRequest is the request type for the Query/PinnedCodes -RPC method + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +### MsgUpdateContractLabelResponse +MsgUpdateContractLabelResponse returns empty data - + -### QueryPinnedCodesResponse -QueryPinnedCodesResponse is the response type for the -Query/PinnedCodes RPC method +### MsgUpdateInstantiateConfig +MsgUpdateInstantiateConfig updates instantiate config for a smart contract | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `code_ids` | [uint64](#uint64) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | +| `sender` | [string](#string) | | Sender is the that actor that signed the messages | +| `code_id` | [uint64](#uint64) | | CodeID references the stored WASM code | +| `new_instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | NewInstantiatePermission is the new access control | - + -### QueryRawContractStateRequest -QueryRawContractStateRequest is the request type for the -Query/RawContractState RPC method +### MsgUpdateInstantiateConfigResponse +MsgUpdateInstantiateConfigResponse returns empty data -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract | -| `query_data` | [bytes](#bytes) | | | - + - +### MsgUpdateParams +MsgUpdateParams is the MsgUpdateParams request type. -### QueryRawContractStateResponse -QueryRawContractStateResponse is the response type for the -Query/RawContractState RPC method +Since: 0.40 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains the raw store data | - - +| `authority` | [string](#string) | | Authority is the address of the governance account. | +| `params` | [Params](#cosmwasm.wasm.v1.Params) | | params defines the x/wasm parameters to update. +NOTE: All parameters must be supplied. | - -### QuerySmartContractStateRequest -QuerySmartContractStateRequest is the request type for the -Query/SmartContractState RPC method -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the contract | -| `query_data` | [bytes](#bytes) | | QueryData contains the query data passed to the contract | + +### MsgUpdateParamsResponse +MsgUpdateParamsResponse defines the response structure for executing a +MsgUpdateParams message. +Since: 0.40 - -### QuerySmartContractStateResponse -QuerySmartContractStateResponse is the response type for the -Query/SmartContractState RPC method + + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains the json data returned from the smart contract | + + +### Msg +Msg defines the wasm Msg service. +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `StoreCode` | [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) | [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse) | StoreCode to submit Wasm code to the system | | +| `InstantiateContract` | [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) | [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse) | InstantiateContract creates a new smart contract instance for the given code id. | | +| `InstantiateContract2` | [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2) | [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response) | InstantiateContract2 creates a new smart contract instance for the given code id with a predictable address | | +| `ExecuteContract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse) | Execute submits the given message data to a smart contract | | +| `MigrateContract` | [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract) | [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse) | Migrate runs a code upgrade/ downgrade for a smart contract | | +| `UpdateAdmin` | [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin) | [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse) | UpdateAdmin sets a new admin for a smart contract | | +| `ClearAdmin` | [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin) | [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse) | ClearAdmin removes any admin stored for a smart contract | | +| `UpdateInstantiateConfig` | [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig) | [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse) | UpdateInstantiateConfig updates instantiate config for a smart contract | | +| `UpdateParams` | [MsgUpdateParams](#cosmwasm.wasm.v1.MsgUpdateParams) | [MsgUpdateParamsResponse](#cosmwasm.wasm.v1.MsgUpdateParamsResponse) | UpdateParams defines a governance operation for updating the x/wasm module parameters. The authority is defined in the keeper. - +Since: 0.40 | | +| `SudoContract` | [MsgSudoContract](#cosmwasm.wasm.v1.MsgSudoContract) | [MsgSudoContractResponse](#cosmwasm.wasm.v1.MsgSudoContractResponse) | SudoContract defines a governance operation for calling sudo on a contract. The authority is defined in the keeper. - +Since: 0.40 | | +| `PinCodes` | [MsgPinCodes](#cosmwasm.wasm.v1.MsgPinCodes) | [MsgPinCodesResponse](#cosmwasm.wasm.v1.MsgPinCodesResponse) | PinCodes defines a governance operation for pinning a set of code ids in the wasmvm cache. The authority is defined in the keeper. - +Since: 0.40 | | +| `UnpinCodes` | [MsgUnpinCodes](#cosmwasm.wasm.v1.MsgUnpinCodes) | [MsgUnpinCodesResponse](#cosmwasm.wasm.v1.MsgUnpinCodesResponse) | UnpinCodes defines a governance operation for unpinning a set of code ids in the wasmvm cache. The authority is defined in the keeper. +Since: 0.40 | | +| `StoreAndInstantiateContract` | [MsgStoreAndInstantiateContract](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContract) | [MsgStoreAndInstantiateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse) | StoreAndInstantiateContract defines a governance operation for storing and instantiating the contract. The authority is defined in the keeper. - +Since: 0.40 | | +| `RemoveCodeUploadParamsAddresses` | [MsgRemoveCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses) | [MsgRemoveCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse) | RemoveCodeUploadParamsAddresses defines a governance operation for removing addresses from code upload params. The authority is defined in the keeper. | | +| `AddCodeUploadParamsAddresses` | [MsgAddCodeUploadParamsAddresses](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses) | [MsgAddCodeUploadParamsAddressesResponse](#cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse) | AddCodeUploadParamsAddresses defines a governance operation for adding addresses to code upload params. The authority is defined in the keeper. | | +| `StoreAndMigrateContract` | [MsgStoreAndMigrateContract](#cosmwasm.wasm.v1.MsgStoreAndMigrateContract) | [MsgStoreAndMigrateContractResponse](#cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse) | StoreAndMigrateContract defines a governance operation for storing and migrating the contract. The authority is defined in the keeper. -### Query -Query provides defines the gRPC querier service +Since: 0.42 | | +| `UpdateContractLabel` | [MsgUpdateContractLabel](#cosmwasm.wasm.v1.MsgUpdateContractLabel) | [MsgUpdateContractLabelResponse](#cosmwasm.wasm.v1.MsgUpdateContractLabelResponse) | UpdateContractLabel sets a new label for a smart contract -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `ContractInfo` | [QueryContractInfoRequest](#cosmwasm.wasm.v1.QueryContractInfoRequest) | [QueryContractInfoResponse](#cosmwasm.wasm.v1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | GET|/cosmwasm/wasm/v1/contract/{address}| -| `ContractHistory` | [QueryContractHistoryRequest](#cosmwasm.wasm.v1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#cosmwasm.wasm.v1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | GET|/cosmwasm/wasm/v1/contract/{address}/history| -| `ContractsByCode` | [QueryContractsByCodeRequest](#cosmwasm.wasm.v1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#cosmwasm.wasm.v1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | GET|/cosmwasm/wasm/v1/code/{code_id}/contracts| -| `AllContractState` | [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#cosmwasm.wasm.v1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | GET|/cosmwasm/wasm/v1/contract/{address}/state| -| `RawContractState` | [QueryRawContractStateRequest](#cosmwasm.wasm.v1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#cosmwasm.wasm.v1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | GET|/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}| -| `SmartContractState` | [QuerySmartContractStateRequest](#cosmwasm.wasm.v1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#cosmwasm.wasm.v1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | GET|/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}| -| `Code` | [QueryCodeRequest](#cosmwasm.wasm.v1.QueryCodeRequest) | [QueryCodeResponse](#cosmwasm.wasm.v1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | GET|/cosmwasm/wasm/v1/code/{code_id}| -| `Codes` | [QueryCodesRequest](#cosmwasm.wasm.v1.QueryCodesRequest) | [QueryCodesResponse](#cosmwasm.wasm.v1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | GET|/cosmwasm/wasm/v1/code| -| `PinnedCodes` | [QueryPinnedCodesRequest](#cosmwasm.wasm.v1.QueryPinnedCodesRequest) | [QueryPinnedCodesResponse](#cosmwasm.wasm.v1.QueryPinnedCodesResponse) | PinnedCodes gets the pinned code ids | GET|/cosmwasm/wasm/v1/codes/pinned| -| `Params` | [QueryParamsRequest](#cosmwasm.wasm.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmwasm.wasm.v1.QueryParamsResponse) | Params gets the module params | GET|/cosmwasm/wasm/v1/codes/params| -| `ContractsByCreator` | [QueryContractsByCreatorRequest](#cosmwasm.wasm.v1.QueryContractsByCreatorRequest) | [QueryContractsByCreatorResponse](#cosmwasm.wasm.v1.QueryContractsByCreatorResponse) | ContractsByCreator gets the contracts by creator | GET|/cosmwasm/wasm/v1/contracts/creator/{creator_address}| +Since: 0.43 | | diff --git a/go.mod b/go.mod index a2de30e866..fde7081427 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.0 + github.com/CosmWasm/wasmvm v1.4.1 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 @@ -193,3 +193,6 @@ replace ( // pin version! 126854af5e6d has issues with the store so that queries fail 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 diff --git a/go.sum b/go.sum index d068da97c7..27da00b70e 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.0 h1:84I3MlvvzcOo2z+ed0ztPi7eeDNk6/sYuK76uyXP1nI= -github.com/CosmWasm/wasmvm v1.4.0/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= +github.com/CosmWasm/wasmvm v1.4.1 h1:YgodVlBrXa2HJZzOXjWDH0EIRwQzK3zuA73dDPRRLS4= +github.com/CosmWasm/wasmvm v1.4.1/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= diff --git a/proto/cosmwasm/wasm/v1/proposal.proto b/proto/cosmwasm/wasm/v1/proposal.proto deleted file mode 100644 index af47c6afbd..0000000000 --- a/proto/cosmwasm/wasm/v1/proposal.proto +++ /dev/null @@ -1,330 +0,0 @@ -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; - // 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; - // Admin is an optional address that can execute migrations - string admin = 4; - // 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; - // Admin is an optional address that can execute migrations - string admin = 4; - // 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; - // 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; - // 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; - // Contract is the address of the smart contract - string contract = 4; - // 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\"" ]; - // Contract is the address of the smart contract - string contract = 4; -} - -// 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; -} - -// 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 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // 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 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // 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; - // 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 7203b8a817..3e0fadb58c 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -27,7 +27,7 @@ service Msg { rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); // Migrate runs a code upgrade/ downgrade for a smart contract rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); - // UpdateAdmin sets a new admin for a smart contract + // UpdateAdmin sets a new admin for a smart contract rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); // ClearAdmin removes any admin stored for a smart contract rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); @@ -76,6 +76,11 @@ service Msg { // Since: 0.42 rpc StoreAndMigrateContract(MsgStoreAndMigrateContract) returns (MsgStoreAndMigrateContractResponse); + // UpdateContractLabel sets a new label for a smart contract + // + // Since: 0.43 + rpc UpdateContractLabel(MsgUpdateContractLabel) + returns (MsgUpdateContractLabelResponse); } // MsgStoreCode submit Wasm code to the system @@ -247,6 +252,16 @@ 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"; @@ -469,4 +484,20 @@ message MsgStoreAndMigrateContractResponse { bytes checksum = 2; // Data contains bytes to returned from the contract bytes data = 3; -} \ No newline at end of file +} + +// MsgUpdateContractLabel sets a new label for a smart contract +message MsgUpdateContractLabel { + option (amino.name) = "wasm/MsgUpdateContractLabel"; + option (cosmos.msg.v1.signer) = "sender"; + + // Sender is the that actor that signed the messages + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // NewLabel string to be set + string new_label = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgUpdateContractLabelResponse returns empty data +message MsgUpdateContractLabelResponse {} \ No newline at end of file diff --git a/x/wasm/alias.go b/x/wasm/alias.go index 931cc837a6..fbe2656fa8 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -24,16 +24,6 @@ const ( WasmModuleEventType = types.WasmModuleEventType // Deprecated: Do not use. AttributeKeyContractAddr = types.AttributeKeyContractAddr - // Deprecated: Do not use. - ProposalTypeStoreCode = types.ProposalTypeStoreCode - // Deprecated: Do not use. - ProposalTypeInstantiateContract = types.ProposalTypeInstantiateContract - // Deprecated: Do not use. - ProposalTypeMigrateContract = types.ProposalTypeMigrateContract - // Deprecated: Do not use. - ProposalTypeUpdateAdmin = types.ProposalTypeUpdateAdmin - // Deprecated: Do not use. - ProposalTypeClearAdmin = types.ProposalTypeClearAdmin ) var ( @@ -45,8 +35,6 @@ var ( // Deprecated: Do not use. ValidateGenesis = types.ValidateGenesis // Deprecated: Do not use. - ConvertToProposals = types.ConvertToProposals - // Deprecated: Do not use. GetCodeKey = types.GetCodeKey // Deprecated: Do not use. GetContractAddressKey = types.GetContractAddressKey @@ -99,8 +87,6 @@ var ( // Deprecated: Do not use. TestHandler = keeper.TestHandler // Deprecated: Do not use. - NewWasmProposalHandler = keeper.NewWasmProposalHandler //nolint:staticcheck // we still require this alias despite the deprecation - // Deprecated: Do not use. NewQuerier = keeper.Querier // Deprecated: Do not use. ContractFromPortID = keeper.ContractFromPortID @@ -142,15 +128,9 @@ var ( ContractKeyPrefix = types.ContractKeyPrefix // Deprecated: Do not use. ContractStorePrefix = types.ContractStorePrefix - // Deprecated: Do not use. - EnableAllProposals = types.EnableAllProposals - // Deprecated: Do not use. - DisableAllProposals = types.DisableAllProposals ) type ( - // Deprecated: Do not use. - ProposalType = types.ProposalType // Deprecated: Do not use. GenesisState = types.GenesisState // Deprecated: Do not use. diff --git a/x/wasm/client/cli/new_tx.go b/x/wasm/client/cli/new_tx.go index 2a76fb828f..9fe212eebd 100644 --- a/x/wasm/client/cli/new_tx.go +++ b/x/wasm/client/cli/new_tx.go @@ -160,3 +160,31 @@ func UpdateInstantiateConfigCmd() *cobra.Command { flags.AddTxFlagsToCmd(cmd) return cmd } + +// UpdateContractLabelCmd sets an new label for a contract +func UpdateContractLabelCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-contract-label [contract_addr_bech32] [new_label]", + Short: "Set new label for a contract", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.MsgUpdateContractLabel{ + Sender: clientCtx.GetFromAddress().String(), + Contract: args[0], + NewLabel: args[1], + } + if err = msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + SilenceUsage: true, + } + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/wasm/client/cli/tx.go b/x/wasm/client/cli/tx.go index 863730e9f2..49a326d333 100644 --- a/x/wasm/client/cli/tx.go +++ b/x/wasm/client/cli/tx.go @@ -70,6 +70,7 @@ func GetTxCmd() *cobra.Command { GrantCmd(), UpdateInstantiateConfigCmd(), SubmitProposalCmd(), + UpdateContractLabelCmd(), ) return txCmd } diff --git a/x/wasm/keeper/handler_plugin_encoders_test.go b/x/wasm/keeper/handler_plugin_encoders_test.go index 334f78526d..6ef32a3d53 100644 --- a/x/wasm/keeper/handler_plugin_encoders_test.go +++ b/x/wasm/keeper/handler_plugin_encoders_test.go @@ -16,7 +16,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting" @@ -48,13 +47,14 @@ func TestEncoding(t *testing.T) { bankMsgBin, err := proto.Marshal(bankMsg) require.NoError(t, err) - content, err := codectypes.NewAnyWithValue(types.StoreCodeProposalFixture()) + msg, err := codectypes.NewAnyWithValue(types.MsgStoreCodeFixture()) require.NoError(t, err) - - proposalMsg := &v1beta1.MsgSubmitProposal{ + proposalMsg := &v1.MsgSubmitProposal{ Proposer: addr1.String(), + Messages: []*codectypes.Any{msg}, InitialDeposit: sdk.NewCoins(sdk.NewInt64Coin("uatom", 12345)), - Content: content, + Title: "proposal", + Summary: "proposal summary", } proposalMsgBin, err := proto.Marshal(proposalMsg) require.NoError(t, err) @@ -294,7 +294,7 @@ func TestEncoding(t *testing.T) { }, }, }, - "staking delegate to non-validator": { + "staking delegate to non-validator - invalid": { sender: addr1, srcMsg: wasmvmtypes.CosmosMsg{ Staking: &wasmvmtypes.StakingMsg{ @@ -420,7 +420,7 @@ func TestEncoding(t *testing.T) { sender: addr2, srcMsg: wasmvmtypes.CosmosMsg{ Stargate: &wasmvmtypes.StargateMsg{ - TypeURL: "/cosmos.gov.v1beta1.MsgSubmitProposal", + TypeURL: "/cosmos.gov.v1.MsgSubmitProposal", Value: proposalMsgBin, }, }, @@ -716,7 +716,7 @@ func TestEncodeGovMsg(t *testing.T) { }, }, }, - "Gov weighted vote: duplicate option": { + "Gov weighted vote: duplicate option - invalid": { sender: myAddr, srcMsg: wasmvmtypes.CosmosMsg{ Gov: &wasmvmtypes.GovMsg{ @@ -741,7 +741,7 @@ func TestEncodeGovMsg(t *testing.T) { }, expInvalid: true, }, - "Gov weighted vote: weight sum exceeds 1": { + "Gov weighted vote: weight sum exceeds 1- invalid": { sender: myAddr, srcMsg: wasmvmtypes.CosmosMsg{ Gov: &wasmvmtypes.GovMsg{ @@ -766,7 +766,7 @@ func TestEncodeGovMsg(t *testing.T) { }, expInvalid: true, }, - "Gov weighted vote: weight sum less than 1": { + "Gov weighted vote: weight sum less than 1 - invalid": { sender: myAddr, srcMsg: wasmvmtypes.CosmosMsg{ Gov: &wasmvmtypes.GovMsg{ diff --git a/x/wasm/keeper/keeper.go b/x/wasm/keeper/keeper.go index 87509e9b99..6c8d45dc91 100644 --- a/x/wasm/keeper/keeper.go +++ b/x/wasm/keeper/keeper.go @@ -641,6 +641,25 @@ func (k Keeper) setContractAdmin(ctx sdk.Context, contractAddress, caller, newAd return nil } +func (k Keeper) setContractLabel(ctx sdk.Context, contractAddress, caller sdk.AccAddress, newLabel string, authZ types.AuthorizationPolicy) error { + contractInfo := k.GetContractInfo(ctx, contractAddress) + if contractInfo == nil { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "unknown contract") + } + if !authZ.CanModifyContract(contractInfo.AdminAddr(), caller) { + return errorsmod.Wrap(sdkerrors.ErrUnauthorized, "can not modify contract") + } + contractInfo.Label = newLabel + k.storeContractInfo(ctx, contractAddress, contractInfo) + ctx.EventManager().EmitEvent(sdk.NewEvent( + types.EventTypeUpdateContractLabel, + sdk.NewAttribute(types.AttributeKeyContractAddr, contractAddress.String()), + sdk.NewAttribute(types.AttributeKeyNewLabel, newLabel), + )) + + return nil +} + func (k Keeper) appendToContractHistory(ctx sdk.Context, contractAddr sdk.AccAddress, newEntries ...types.ContractCodeHistoryEntry) { store := ctx.KVStore(k.storeKey) // find last element position diff --git a/x/wasm/keeper/keeper_test.go b/x/wasm/keeper/keeper_test.go index 855f611732..c55e738d5c 100644 --- a/x/wasm/keeper/keeper_test.go +++ b/x/wasm/keeper/keeper_test.go @@ -2488,6 +2488,69 @@ func TestGasConsumed(t *testing.T) { } } +func TestSetContractLabel(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + k := keepers.WasmKeeper + example := InstantiateReflectExampleContract(t, parentCtx, keepers) + + specs := map[string]struct { + newLabel string + caller sdk.AccAddress + policy types.AuthorizationPolicy + contract sdk.AccAddress + expErr bool + }{ + "update label - default policy": { + newLabel: "new label", + caller: example.CreatorAddr, + policy: DefaultAuthorizationPolicy{}, + contract: example.Contract, + }, + "update label - gov policy": { + newLabel: "new label", + policy: GovAuthorizationPolicy{}, + caller: RandomAccountAddress(t), + contract: example.Contract, + }, + "update label - unauthorized": { + newLabel: "new label", + caller: RandomAccountAddress(t), + policy: DefaultAuthorizationPolicy{}, + contract: example.Contract, + expErr: true, + }, + "update label - unknown contract": { + newLabel: "new label", + caller: example.CreatorAddr, + policy: DefaultAuthorizationPolicy{}, + contract: RandomAccountAddress(t), + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + em := sdk.NewEventManager() + ctx = ctx.WithEventManager(em) + gotErr := k.setContractLabel(ctx, spec.contract, spec.caller, spec.newLabel, spec.policy) + if spec.expErr { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) + assert.Equal(t, spec.newLabel, k.GetContractInfo(ctx, spec.contract).Label) + // and event emitted + require.Len(t, em.Events(), 1) + assert.Equal(t, "update_contract_label", em.Events()[0].Type) + exp := map[string]string{ + "_contract_address": spec.contract.String(), + "new_label": spec.newLabel, + } + assert.Equal(t, exp, attrsToStringMap(em.Events()[0].Attributes)) + }) + } +} + func attrsToStringMap(attrs []abci.EventAttribute) map[string]string { r := make(map[string]string, len(attrs)) for _, v := range attrs { diff --git a/x/wasm/keeper/msg_server.go b/x/wasm/keeper/msg_server.go index 8c7e3774dd..06963f9083 100644 --- a/x/wasm/keeper/msg_server.go +++ b/x/wasm/keeper/msg_server.go @@ -474,3 +474,27 @@ func (m msgServer) StoreAndMigrateContract(goCtx context.Context, req *types.Msg Data: data, }, nil } + +func (m msgServer) UpdateContractLabel(goCtx context.Context, msg *types.MsgUpdateContractLabel) (*types.MsgUpdateContractLabelResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, errorsmod.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, errorsmod.Wrap(err, "contract") + } + + policy := m.selectAuthorizationPolicy(ctx, msg.Sender) + + if err := m.keeper.setContractLabel(ctx, contractAddr, senderAddr, msg.NewLabel, policy); err != nil { + return nil, err + } + + return &types.MsgUpdateContractLabelResponse{}, nil +} diff --git a/x/wasm/keeper/msg_server_integration_test.go b/x/wasm/keeper/msg_server_integration_test.go index ef7f0a4b0d..27b73400fb 100644 --- a/x/wasm/keeper/msg_server_integration_test.go +++ b/x/wasm/keeper/msg_server_integration_test.go @@ -1144,3 +1144,86 @@ func TestStoreAndMigrateContract(t *testing.T) { }) } } + +func TestUpdateContractLabel(t *testing.T) { + wasmApp := app.Setup(t) + ctx := wasmApp.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) + + var ( + myAddress sdk.AccAddress = make([]byte, types.ContractAddrLen) + authority = wasmApp.WasmKeeper.GetAuthority() + _, _, otherAddr = testdata.KeyTestPubAddr() + ) + + specs := map[string]struct { + addr string + newLabel string + expErr bool + }{ + "authority can update contract label": { + addr: authority, + newLabel: "new label", + expErr: false, + }, + "admin can update contract label": { + addr: myAddress.String(), + newLabel: "new label", + expErr: false, + }, + "other address cannot update contract label": { + addr: otherAddr.String(), + newLabel: "new label", + expErr: true, + }, + "empty new label": { + addr: authority, + expErr: true, + }, + "invalid new label": { + addr: authority, + newLabel: " start with space ", + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + // setup + msg := &types.MsgStoreAndInstantiateContract{ + Authority: spec.addr, + WASMByteCode: wasmContract, + InstantiatePermission: &types.AllowEverybody, + Admin: myAddress.String(), + UnpinCode: false, + Label: "old label", + Msg: []byte(`{}`), + Funds: sdk.Coins{}, + } + rsp, err := wasmApp.MsgServiceRouter().Handler(msg)(ctx, msg) + require.NoError(t, err) + var storeAndInstantiateResponse types.MsgStoreAndInstantiateContractResponse + require.NoError(t, wasmApp.AppCodec().Unmarshal(rsp.Data, &storeAndInstantiateResponse)) + + contract := storeAndInstantiateResponse.Address + contractAddr, err := sdk.AccAddressFromBech32(contract) + require.NoError(t, err) + require.Equal(t, "old label", wasmApp.WasmKeeper.GetContractInfo(ctx, contractAddr).Label) + + // when + msgUpdateLabel := &types.MsgUpdateContractLabel{ + Sender: spec.addr, + NewLabel: spec.newLabel, + Contract: storeAndInstantiateResponse.Address, + } + _, err = wasmApp.MsgServiceRouter().Handler(msgUpdateLabel)(ctx, msgUpdateLabel) + + // then + if spec.expErr { + require.Error(t, err) + require.Equal(t, "old label", wasmApp.WasmKeeper.GetContractInfo(ctx, contractAddr).Label) + } else { + require.NoError(t, err) + require.Equal(t, spec.newLabel, wasmApp.WasmKeeper.GetContractInfo(ctx, contractAddr).Label) + } + }) + } +} diff --git a/x/wasm/keeper/proposal_handler.go b/x/wasm/keeper/proposal_handler.go deleted file mode 100644 index 82048ca3e8..0000000000 --- a/x/wasm/keeper/proposal_handler.go +++ /dev/null @@ -1,342 +0,0 @@ -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" -) - -// NewWasmProposalHandler creates a new governance Handler for wasm proposals -// -// Deprecated: Do not use. -func NewWasmProposalHandler(k decoratedKeeper, enabledProposalTypes []types.ProposalType) v1beta1.Handler { - return NewWasmProposalHandlerX(NewGovPermissionKeeper(k), enabledProposalTypes) -} - -// NewWasmProposalHandlerX creates a new governance Handler for wasm proposals -// -// Deprecated: Do not use. -func NewWasmProposalHandlerX(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 deleted file mode 100644 index 4ecee9c9a9..0000000000 --- a/x/wasm/keeper/proposal_integration_test.go +++ /dev/null @@ -1,940 +0,0 @@ -package keeper - -import ( - "bytes" - "encoding/hex" - "encoding/json" - "errors" - "os" - "testing" - - wasmvm "github.com/CosmWasm/wasmvm" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - 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/keeper/wasmtesting" - "github.com/CosmWasm/wasmd/x/wasm/types" -) - -const myTestLabel = "testing" - -func TestStoreCodeProposal(t *testing.T) { - t.Skip("DEPRECATED") - parentCtx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(parentCtx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - rawWasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - gzippedWasmCode, err := os.ReadFile("./testdata/hackatom.wasm.gzip") - require.NoError(t, err) - checksum, err := hex.DecodeString(testdata.ChecksumHackatom) - require.NoError(t, err) - - specs := map[string]struct { - codeID int64 - code []byte - unpinCode bool - }{ - "upload with pinning (default)": { - unpinCode: false, - code: rawWasmCode, - }, - "upload with code unpin": { - unpinCode: true, - code: rawWasmCode, - }, - "upload with raw wasm code": { - code: rawWasmCode, - }, - "upload with zipped wasm code": { - code: gzippedWasmCode, - }, - } - - for msg, spec := range specs { - t.Run(msg, func(t *testing.T) { - ctx, _ := parentCtx.CacheContext() - myActorAddress := RandomBech32AccountAddress(t) - - src := types.StoreCodeProposalFixture(func(p *types.StoreCodeProposal) { //nolint:staticcheck // testing deprecated function - p.RunAs = myActorAddress - p.WASMByteCode = spec.code - p.UnpinCode = spec.unpinCode - p.CodeHash = checksum - }) - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx, src, myActorAddress, keepers) - - // then - cInfo := wasmKeeper.GetCodeInfo(ctx, 1) - require.NotNil(t, cInfo) - assert.Equal(t, myActorAddress, cInfo.Creator) - assert.Equal(t, !spec.unpinCode, wasmKeeper.IsPinnedCode(ctx, 1)) - - storedCode, err := wasmKeeper.GetByteCode(ctx, 1) - require.NoError(t, err) - assert.Equal(t, rawWasmCode, storedCode) - }) - } -} - -func mustSubmitAndExecuteLegacyProposal(t *testing.T, ctx sdk.Context, content v1beta1.Content, myActorAddress string, keepers TestKeepers) { - t.Helper() - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - // ignore all submit events - contentMsg, err := submitLegacyProposal(t, ctx.WithEventManager(sdk.NewEventManager()), content, myActorAddress, govAuthority, msgServer) - require.NoError(t, err) - - _, err = msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) - require.NoError(t, err) -} - -// 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, error) { - t.Helper() - contentMsg, err := v1.NewLegacyContent(content, govAuthority) - require.NoError(t, err) - - proposal, err := v1.NewMsgSubmitProposal( - []sdk.Msg{contentMsg}, - sdk.Coins{}, - myActorAddress, - "", - "my title", - "my description", - ) - require.NoError(t, err) - - // when stored - _, err = msgServer.SubmitProposal(sdk.WrapSDKContext(ctx), proposal) - return contentMsg, err -} - -func TestInstantiateProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - require.NoError(t, wasmKeeper.importCode(ctx, 1, - types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)), - wasmCode), - ) - - var ( - oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen) - otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - ) - src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) { //nolint:staticcheck // testing deprecated function - p.CodeID = firstCodeID - p.RunAs = oneAddress.String() - p.Admin = otherAddress.String() - p.Label = myTestLabel - }) - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers) - - // then - contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr") - require.NoError(t, err) - - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr) - require.NotNil(t, cInfo) - assert.Equal(t, uint64(1), cInfo.CodeID) - assert.Equal(t, oneAddress.String(), cInfo.Creator) - assert.Equal(t, otherAddress.String(), cInfo.Admin) - assert.Equal(t, myTestLabel, cInfo.Label) - expHistory := []types.ContractCodeHistoryEntry{{ - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: src.CodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - Msg: src.Msg, - }} - assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr)) - // and event - require.Len(t, em.Events(), 3, "%#v", em.Events()) - require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type) - require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type) - require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type) - require.Len(t, em.Events()[2].Attributes, 1) - require.NotEmpty(t, em.Events()[2].Attributes[0]) -} - -func TestInstantiate2Proposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - codeInfo := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)) - err = wasmKeeper.importCode(ctx, 1, codeInfo, wasmCode) - require.NoError(t, err) - - var ( - oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen) - otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - label = "label" - salt = []byte("mySalt") - ) - src := types.InstantiateContract2ProposalFixture(func(p *types.InstantiateContract2Proposal) { //nolint:staticcheck // testing deprecated function - p.CodeID = firstCodeID - p.RunAs = oneAddress.String() - p.Admin = otherAddress.String() - p.Label = label - p.Salt = salt - }) - contractAddress := BuildContractAddressPredictable(codeInfo.CodeHash, oneAddress, salt, []byte{}) - - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers) - - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddress) - require.NotNil(t, cInfo) - - assert.Equal(t, uint64(1), cInfo.CodeID) - assert.Equal(t, oneAddress.String(), cInfo.Creator) - assert.Equal(t, otherAddress.String(), cInfo.Admin) - assert.Equal(t, "label", cInfo.Label) - expHistory := []types.ContractCodeHistoryEntry{{ - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: src.CodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - Msg: src.Msg, - }} - assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddress)) - // and event - require.Len(t, em.Events(), 3, prettyEvents(t, em.Events())) - require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type) - require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type) - require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type) - require.Len(t, em.Events()[2].Attributes, 1) - require.NotEmpty(t, em.Events()[2].Attributes[0]) -} - -func TestInstantiateProposal_NoAdmin(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - require.NoError(t, wasmKeeper.importCode(ctx, 1, - types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)), - wasmCode), - ) - - var oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen) - - specs := map[string]struct { - srcAdmin string - expErr bool - }{ - "empty admin": { - srcAdmin: "", - }, - "invalid admin": { - srcAdmin: "invalid", - expErr: true, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) { //nolint:staticcheck // testing deprecated function - p.CodeID = firstCodeID - p.RunAs = oneAddress.String() - p.Admin = spec.srcAdmin - p.Label = myTestLabel - }) - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - // when - contentMsg, gotErr := submitLegacyProposal(t, ctx, src, oneAddress.String(), govAuthority, msgServer) - // then - if spec.expErr { - require.Error(t, gotErr) - return - } - require.NoError(t, gotErr) - // and when - em := sdk.NewEventManager() - _, err = msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx.WithEventManager(em)), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) - // then - require.NoError(t, err) - contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr") - require.NoError(t, err) - - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr) - require.NotNil(t, cInfo) - assert.Equal(t, uint64(1), cInfo.CodeID) - assert.Equal(t, oneAddress.String(), cInfo.Creator) - assert.Equal(t, "", cInfo.Admin) - assert.Equal(t, myTestLabel, cInfo.Label) - expHistory := []types.ContractCodeHistoryEntry{{ - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: src.CodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - Msg: src.Msg, - }} - assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr)) - // and event - require.Len(t, em.Events(), 3, "%#v", em.Events()) - require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type) - require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type) - require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type) - require.Len(t, em.Events()[2].Attributes, 1) - require.NotEmpty(t, em.Events()[2].Attributes[0]) - }) - } -} - -func TestStoreAndInstantiateContractProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - checksum, err := hex.DecodeString(testdata.ChecksumHackatom) - require.NoError(t, err) - - var ( - oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen) - otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - ) - - src := types.StoreAndInstantiateContractProposalFixture(func(p *types.StoreAndInstantiateContractProposal) { //nolint:staticcheck // testing deprecated function - p.WASMByteCode = wasmCode - p.RunAs = oneAddress.String() - p.Admin = otherAddress.String() - p.Label = myTestLabel - p.CodeHash = checksum - }) - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers) - - // then - contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr") - require.NoError(t, err) - - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr) - require.NotNil(t, cInfo) - assert.Equal(t, oneAddress.String(), cInfo.Creator) - assert.Equal(t, otherAddress.String(), cInfo.Admin) - assert.Equal(t, myTestLabel, cInfo.Label) - expHistory := []types.ContractCodeHistoryEntry{{ - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: cInfo.CodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - Msg: src.Msg, - }} - assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr)) - // and event - require.Len(t, em.Events(), 5, "%#v", em.Events()) - require.Equal(t, types.EventTypeStoreCode, em.Events()[0].Type) - require.Equal(t, types.EventTypePinCode, em.Events()[1].Type) - require.Equal(t, types.EventTypeInstantiate, em.Events()[2].Type) - require.Equal(t, types.WasmModuleEventType, em.Events()[3].Type) - require.Equal(t, types.EventTypeGovContractResult, em.Events()[4].Type) - require.Len(t, em.Events()[4].Attributes, 1) - require.NotEmpty(t, em.Events()[4].Attributes[0]) -} - -func TestMigrateProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - codeInfoFixture := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)) - require.NoError(t, wasmKeeper.importCode(ctx, 1, codeInfoFixture, wasmCode)) - require.NoError(t, wasmKeeper.importCode(ctx, 2, codeInfoFixture, wasmCode)) - - var ( - anyAddress = DeterministicAccountAddress(t, 1) - otherAddress = DeterministicAccountAddress(t, 2) - contractAddr = BuildContractAddressClassic(1, 1) - ) - - contractInfo := types.ContractInfoFixture(func(c *types.ContractInfo) { - c.Label = myTestLabel - c.Admin = anyAddress.String() - c.Created = types.NewAbsoluteTxPosition(ctx) - }) - entries := []types.ContractCodeHistoryEntry{ - {Operation: types.ContractCodeHistoryOperationTypeInit, CodeID: 1, Updated: contractInfo.Created}, - } - key, err := hex.DecodeString("636F6E666967") - require.NoError(t, err) - m := types.Model{Key: key, Value: []byte(`{"verifier":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","beneficiary":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","funder":"AQEBAQEBAQEBAQEBAQEBAQEBAQE="}`)} - require.NoError(t, wasmKeeper.importContract(ctx, contractAddr, &contractInfo, []types.Model{m}, entries)) - - migMsg := struct { - Verifier sdk.AccAddress `json:"verifier"` - }{Verifier: otherAddress} - migMsgBz, err := json.Marshal(migMsg) - require.NoError(t, err) - - src := &types.MigrateContractProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - CodeID: 2, - Contract: contractAddr.String(), - Msg: migMsgBz, - } - - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, anyAddress.String(), keepers) - - // then - require.NoError(t, err) - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr) - require.NotNil(t, cInfo) - assert.Equal(t, uint64(2), cInfo.CodeID) - assert.Equal(t, anyAddress.String(), cInfo.Admin) - assert.Equal(t, myTestLabel, cInfo.Label) - expHistory := []types.ContractCodeHistoryEntry{{ - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: firstCodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - }, { - Operation: types.ContractCodeHistoryOperationTypeMigrate, - CodeID: src.CodeID, - Updated: types.NewAbsoluteTxPosition(ctx), - Msg: src.Msg, - }} - assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr)) - // and events emitted - require.Len(t, em.Events(), 2) - assert.Equal(t, types.EventTypeMigrate, em.Events()[0].Type) - require.Equal(t, types.EventTypeGovContractResult, em.Events()[1].Type) - require.Len(t, em.Events()[1].Attributes, 1) - assert.Equal(t, types.AttributeKeyResultDataHex, em.Events()[1].Attributes[0].Key) -} - -func TestExecuteProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - bankKeeper := keepers.BankKeeper - - exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) - contractAddr := exampleContract.Contract - - // check balance - bal := bankKeeper.GetBalance(ctx, contractAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(100)) - - releaseMsg := struct { - Release struct{} `json:"release"` - }{} - releaseMsgBz, err := json.Marshal(releaseMsg) - require.NoError(t, err) - - // try with runAs that doesn't have pemission - badSrc := &types.ExecuteContractProposal{ //nolint:staticcheck // testing deprecated function - Title: "First", - Description: "Beneficiary has no permission to run", - Contract: contractAddr.String(), - Msg: releaseMsgBz, - RunAs: exampleContract.BeneficiaryAddr.String(), - } - - // fails on store - this doesn't have permission - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - _, err = submitLegacyProposal(t, ctx, badSrc, exampleContract.BeneficiaryAddr.String(), govAuthority, msgServer) - require.Error(t, err) - - // balance should not change - bal = bankKeeper.GetBalance(ctx, contractAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(100)) - - // try again with the proper run-as - src := &types.ExecuteContractProposal{ //nolint:staticcheck // testing deprecated function - Title: "Second", - Description: "Verifier can execute", - Contract: contractAddr.String(), - Msg: releaseMsgBz, - RunAs: exampleContract.VerifierAddr.String(), - } - - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, exampleContract.BeneficiaryAddr.String(), keepers) - - // balance should be empty (proper release) - bal = bankKeeper.GetBalance(ctx, contractAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(0)) -} - -func TestSudoProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - bankKeeper := keepers.BankKeeper - - exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) - contractAddr := exampleContract.Contract - _, anyAddr := keyPubAddr() - - // check balance - bal := bankKeeper.GetBalance(ctx, contractAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(100)) - bal = bankKeeper.GetBalance(ctx, anyAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(0)) - - type StealMsg struct { - Recipient string `json:"recipient"` - Amount []sdk.Coin `json:"amount"` - } - stealMsg := struct { - Steal StealMsg `json:"steal_funds"` - }{Steal: StealMsg{ - Recipient: anyAddr.String(), - Amount: []sdk.Coin{sdk.NewInt64Coin("denom", 75)}, - }} - stealMsgBz, err := json.Marshal(stealMsg) - require.NoError(t, err) - - // sudo can do anything - src := &types.SudoContractProposal{ //nolint:staticcheck // testing deprecated function - Title: "Sudo", - Description: "Steal funds for the verifier", - Contract: contractAddr.String(), - Msg: stealMsgBz, - } - - em := sdk.NewEventManager() - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, exampleContract.BeneficiaryAddr.String(), keepers) - - // balance should be empty (and verifier richer) - bal = bankKeeper.GetBalance(ctx, contractAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(25)) - bal = bankKeeper.GetBalance(ctx, anyAddr, "denom") - require.Equal(t, bal.Amount, sdk.NewInt(75)) -} - -func TestAdminProposals(t *testing.T) { - t.Skip("DEPRECATED") - var ( - otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - contractAddr = BuildContractAddressClassic(1, 1) - ) - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") - require.NoError(t, err) - - specs := map[string]struct { - state types.ContractInfo - srcProposal v1beta1.Content - expAdmin sdk.AccAddress - }{ - "update with different admin": { - state: types.ContractInfoFixture(), - srcProposal: &types.UpdateAdminProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - Contract: contractAddr.String(), - NewAdmin: otherAddress.String(), - }, - expAdmin: otherAddress, - }, - "update with old admin empty": { - state: types.ContractInfoFixture(func(info *types.ContractInfo) { - info.Admin = "" - }), - srcProposal: &types.UpdateAdminProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - Contract: contractAddr.String(), - NewAdmin: otherAddress.String(), - }, - expAdmin: otherAddress, - }, - "clear admin": { - state: types.ContractInfoFixture(), - srcProposal: &types.ClearAdminProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - Contract: contractAddr.String(), - }, - expAdmin: nil, - }, - "clear with old admin empty": { - state: types.ContractInfoFixture(func(info *types.ContractInfo) { - info.Admin = "" - }), - srcProposal: &types.ClearAdminProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - Contract: contractAddr.String(), - }, - expAdmin: nil, - }, - } - for msg, spec := range specs { - t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - err := wasmKeeper.SetParams(ctx, types.Params{ - CodeUploadAccess: types.AllowNobody, - InstantiateDefaultPermission: types.AccessTypeNobody, - }) - require.NoError(t, err) - - codeInfo := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)) - require.NoError(t, wasmKeeper.importCode(ctx, 1, codeInfo, wasmCode)) - - entries := []types.ContractCodeHistoryEntry{ - { - Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: 1, - Updated: spec.state.Created, - }, - } - - require.NoError(t, wasmKeeper.importContract(ctx, contractAddr, &spec.state, []types.Model{}, entries)) //nolint:gosec - - // when - mustSubmitAndExecuteLegacyProposal(t, ctx, spec.srcProposal, otherAddress.String(), keepers) - - // then - cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr) - require.NotNil(t, cInfo) - assert.Equal(t, spec.expAdmin.String(), cInfo.Admin) - }) - } -} - -func TestPinCodesProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - - mock := wasmtesting.MockWasmEngine{ - StoreCodeFn: wasmtesting.NoOpStoreCodeFn, - AnalyzeCodeFn: wasmtesting.WithoutIBCAnalyzeFn, - } - var ( - hackatom = StoreHackatomExampleContract(t, ctx, keepers) - hackatomDuplicate = StoreHackatomExampleContract(t, ctx, keepers) - otherContract = StoreRandomContract(t, ctx, keepers, &mock) - gotPinnedChecksums []wasmvm.Checksum - ) - checksumCollector := func(checksum wasmvm.Checksum) error { - gotPinnedChecksums = append(gotPinnedChecksums, checksum) - return nil - } - specs := map[string]struct { - srcCodeIDs []uint64 - mockFn func(checksum wasmvm.Checksum) error - expPinned []wasmvm.Checksum - expErr bool - }{ - "pin one": { - srcCodeIDs: []uint64{hackatom.CodeID}, - mockFn: checksumCollector, - }, - "pin multiple": { - srcCodeIDs: []uint64{hackatom.CodeID, otherContract.CodeID}, - mockFn: checksumCollector, - }, - "pin same code id": { - srcCodeIDs: []uint64{hackatom.CodeID, hackatomDuplicate.CodeID}, - mockFn: checksumCollector, - }, - "pin non existing code id": { - srcCodeIDs: []uint64{999}, - mockFn: checksumCollector, - expErr: true, - }, - "pin empty code id list": { - srcCodeIDs: []uint64{}, - mockFn: checksumCollector, - expErr: true, - }, - "wasmvm failed with error": { - srcCodeIDs: []uint64{hackatom.CodeID}, - mockFn: func(_ wasmvm.Checksum) error { - return errors.New("test, ignore") - }, - expErr: true, - }, - } - parentCtx := ctx - for msg, spec := range specs { - t.Run(msg, func(t *testing.T) { - myActorAddress := RandomBech32AccountAddress(t) - gotPinnedChecksums = nil - ctx, _ := parentCtx.CacheContext() - mock.PinFn = spec.mockFn - proposal := &types.PinCodesProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - CodeIDs: spec.srcCodeIDs, - } - - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - - // when - contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, myActorAddress, govAuthority, msgServer) - if spec.expErr { - require.Error(t, gotErr) - return - } - require.NoError(t, gotErr) - - // and proposal execute - _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) - require.NoError(t, err) - - // then - for i := range spec.srcCodeIDs { - c := wasmKeeper.GetCodeInfo(ctx, spec.srcCodeIDs[i]) - require.Equal(t, wasmvm.Checksum(c.CodeHash), gotPinnedChecksums[i]) - } - }) - } -} - -func TestUnpinCodesProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - - mock := wasmtesting.MockWasmEngine{ - StoreCodeFn: wasmtesting.NoOpStoreCodeFn, - AnalyzeCodeFn: wasmtesting.WithoutIBCAnalyzeFn, - } - var ( - hackatom = StoreHackatomExampleContract(t, ctx, keepers) - hackatomDuplicate = StoreHackatomExampleContract(t, ctx, keepers) - otherContract = StoreRandomContract(t, ctx, keepers, &mock) - gotUnpinnedChecksums []wasmvm.Checksum - ) - checksumCollector := func(checksum wasmvm.Checksum) error { - gotUnpinnedChecksums = append(gotUnpinnedChecksums, checksum) - return nil - } - specs := map[string]struct { - srcCodeIDs []uint64 - mockFn func(checksum wasmvm.Checksum) error - expUnpinned []wasmvm.Checksum - expErr bool - }{ - "unpin one": { - srcCodeIDs: []uint64{hackatom.CodeID}, - mockFn: checksumCollector, - }, - "unpin multiple": { - srcCodeIDs: []uint64{hackatom.CodeID, otherContract.CodeID}, - mockFn: checksumCollector, - }, - "unpin same code id": { - srcCodeIDs: []uint64{hackatom.CodeID, hackatomDuplicate.CodeID}, - mockFn: checksumCollector, - }, - "unpin non existing code id": { - srcCodeIDs: []uint64{999}, - mockFn: checksumCollector, - expErr: true, - }, - "unpin empty code id list": { - srcCodeIDs: []uint64{}, - mockFn: checksumCollector, - expErr: true, - }, - "wasmvm failed with error": { - srcCodeIDs: []uint64{hackatom.CodeID}, - mockFn: func(_ wasmvm.Checksum) error { - return errors.New("test, ignore") - }, - expErr: true, - }, - } - parentCtx := ctx - for msg, spec := range specs { - t.Run(msg, func(t *testing.T) { - gotUnpinnedChecksums = nil - ctx, _ := parentCtx.CacheContext() - mock.UnpinFn = spec.mockFn - proposal := &types.UnpinCodesProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - CodeIDs: spec.srcCodeIDs, - } - - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - - // when - contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, RandomBech32AccountAddress(t), govAuthority, msgServer) - if spec.expErr { - require.Error(t, gotErr) - return - } - require.NoError(t, gotErr) - - // and proposal execute - _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) - require.NoError(t, err) - - // then - for i := range spec.srcCodeIDs { - c := wasmKeeper.GetCodeInfo(ctx, spec.srcCodeIDs[i]) - require.Equal(t, wasmvm.Checksum(c.CodeHash), gotUnpinnedChecksums[i]) - } - }) - } -} - -func TestUpdateInstantiateConfigProposal(t *testing.T) { - t.Skip("DEPRECATED") - ctx, keepers := CreateTestInput(t, false, "staking") - wasmKeeper := keepers.WasmKeeper - - mock := wasmtesting.MockWasmEngine{ - StoreCodeFn: wasmtesting.NoOpStoreCodeFn, - AnalyzeCodeFn: wasmtesting.WithoutIBCAnalyzeFn, - } - anyAddress, err := sdk.AccAddressFromBech32("cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz") - require.NoError(t, err) - - withAddressAccessConfig := types.AccessTypeAnyOfAddresses.With(anyAddress) - var ( - nobody = StoreRandomContractWithAccessConfig(t, ctx, keepers, &mock, &types.AllowNobody) - everybody = StoreRandomContractWithAccessConfig(t, ctx, keepers, &mock, &types.AllowEverybody) - withAddress = StoreRandomContractWithAccessConfig(t, ctx, keepers, &mock, &withAddressAccessConfig) - ) - - specs := map[string]struct { - accessConfigUpdates []types.AccessConfigUpdate - expErr bool - }{ - "update one": { - accessConfigUpdates: []types.AccessConfigUpdate{ - {CodeID: nobody.CodeID, InstantiatePermission: types.AllowEverybody}, - }, - }, - "update multiple": { - accessConfigUpdates: []types.AccessConfigUpdate{ - {CodeID: everybody.CodeID, InstantiatePermission: types.AllowNobody}, - {CodeID: nobody.CodeID, InstantiatePermission: withAddressAccessConfig}, - {CodeID: withAddress.CodeID, InstantiatePermission: types.AllowEverybody}, - }, - }, - "update same code id": { - accessConfigUpdates: []types.AccessConfigUpdate{ - {CodeID: everybody.CodeID, InstantiatePermission: types.AllowNobody}, - {CodeID: everybody.CodeID, InstantiatePermission: types.AllowEverybody}, - }, - expErr: true, - }, - "update non existing code id": { - accessConfigUpdates: []types.AccessConfigUpdate{ - {CodeID: 100, InstantiatePermission: types.AllowNobody}, - {CodeID: everybody.CodeID, InstantiatePermission: types.AllowEverybody}, - }, - expErr: true, - }, - "update empty list": { - accessConfigUpdates: make([]types.AccessConfigUpdate, 0), - expErr: true, - }, - } - parentCtx := ctx - for msg, spec := range specs { - t.Run(msg, func(t *testing.T) { - ctx, _ := parentCtx.CacheContext() - - updates := make([]types.AccessConfigUpdate, 0) - for _, cu := range spec.accessConfigUpdates { - updates = append(updates, types.AccessConfigUpdate{ - CodeID: cu.CodeID, - InstantiatePermission: cu.InstantiatePermission, - }) - } - - govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String() - msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper) - proposal := &types.UpdateInstantiateConfigProposal{ //nolint:staticcheck // testing deprecated function - Title: "Foo", - Description: "Bar", - AccessConfigUpdates: updates, - } - - // when - contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, RandomBech32AccountAddress(t), govAuthority, msgServer) - if spec.expErr { - require.Error(t, gotErr) - return - } - require.NoError(t, gotErr) - - // and proposal execute - _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority)) - require.NoError(t, err) - - // then - for i := range spec.accessConfigUpdates { - c := wasmKeeper.GetCodeInfo(ctx, spec.accessConfigUpdates[i].CodeID) - require.Equal(t, spec.accessConfigUpdates[i].InstantiatePermission, c.InstantiateConfig) - } - }) - } -} diff --git a/x/wasm/types/codec.go b/x/wasm/types/codec.go index 3b0a823623..c1fcfb9972 100644 --- a/x/wasm/types/codec.go +++ b/x/wasm/types/codec.go @@ -31,19 +31,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddCodeUploadParamsAddresses{}, "wasm/MsgAddCodeUploadParamsAddresses", nil) cdc.RegisterConcrete(&MsgRemoveCodeUploadParamsAddresses{}, "wasm/MsgRemoveCodeUploadParamsAddresses", nil) cdc.RegisterConcrete(&MsgStoreAndMigrateContract{}, "wasm/MsgStoreAndMigrateContract", nil) - - 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) + cdc.RegisterConcrete(&MsgUpdateContractLabel{}, "wasm/MsgUpdateContractLabel", nil) cdc.RegisterInterface((*ContractInfoExtension)(nil), nil) @@ -83,21 +71,10 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgAddCodeUploadParamsAddresses{}, &MsgRemoveCodeUploadParamsAddresses{}, &MsgStoreAndMigrateContract{}, + &MsgUpdateContractLabel{}, ) registry.RegisterImplementations( (*v1beta1.Content)(nil), - &StoreCodeProposal{}, - &InstantiateContractProposal{}, - &InstantiateContract2Proposal{}, - &MigrateContractProposal{}, - &SudoContractProposal{}, - &ExecuteContractProposal{}, - &UpdateAdminProposal{}, - &ClearAdminProposal{}, - &PinCodesProposal{}, - &UnpinCodesProposal{}, - &UpdateInstantiateConfigProposal{}, - &StoreAndInstantiateContractProposal{}, ) registry.RegisterInterface("cosmwasm.wasm.v1.ContractInfoExtension", (*ContractInfoExtension)(nil)) diff --git a/x/wasm/types/events.go b/x/wasm/types/events.go index ea6060bda9..5abe563a34 100644 --- a/x/wasm/types/events.go +++ b/x/wasm/types/events.go @@ -24,6 +24,7 @@ const ( EventTypeReply = "reply" EventTypeGovContractResult = "gov_contract_result" EventTypeUpdateContractAdmin = "update_contract_admin" + EventTypeUpdateContractLabel = "update_contract_label" EventTypeUpdateCodeAccessConfig = "update_code_access_config" EventTypePacketRecv = "ibc_packet_received" // add new types to IsAcceptedEventOnRecvPacketErrorAck @@ -61,6 +62,7 @@ const ( AttributeKeyResultDataHex = "result" AttributeKeyRequiredCapability = "required_capability" AttributeKeyNewAdmin = "new_admin_address" + AttributeKeyNewLabel = "new_label" AttributeKeyCodePermission = "code_permission" AttributeKeyAuthorizedAddresses = "authorized_addresses" AttributeKeyAckSuccess = "success" diff --git a/x/wasm/types/proposal.go b/x/wasm/types/proposal.go deleted file mode 100644 index 9c85a08dff..0000000000 --- a/x/wasm/types/proposal.go +++ /dev/null @@ -1,987 +0,0 @@ -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. -var DisableAllProposals []ProposalType - -// EnableAllProposals contains all wasm gov types as keys. -var EnableAllProposals = []ProposalType{ - ProposalTypeStoreCode, - ProposalTypeInstantiateContract, - ProposalTypeInstantiateContract2, - ProposalTypeMigrateContract, - ProposalTypeSudoContract, - ProposalTypeExecuteContract, - ProposalTypeUpdateAdmin, - ProposalTypeClearAdmin, - ProposalTypePinCodes, - ProposalTypeUnpinCodes, - ProposalTypeUpdateInstantiateConfig, - ProposalTypeStoreAndInstantiateContractProposal, -} - -// ConvertToProposals maps each key to a ProposalType and returns a typed list. -// If any string is not a valid type (in this file), then return an error -func ConvertToProposals(keys []string) ([]ProposalType, error) { - valid := make(map[string]bool, len(EnableAllProposals)) - for _, key := range EnableAllProposals { - valid[string(key)] = true - } - - proposals := make([]ProposalType, len(keys)) - for i, key := range keys { - if _, ok := valid[key]; !ok { - return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "'%s' is not a valid ProposalType", key) - } - proposals[i] = ProposalType(key) - } - return proposals, nil -} - -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)) -} - -func NewStoreCodeProposal( - title string, - description string, - runAs string, - wasmBz []byte, - permission *AccessConfig, - unpinCode bool, - source string, - builder string, - codeHash []byte, -) *StoreCodeProposal { - return &StoreCodeProposal{title, description, runAs, wasmBz, permission, unpinCode, source, builder, codeHash} -} - -// 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 -} - -func NewInstantiateContractProposal( - title string, - description string, - runAs string, - admin string, - codeID uint64, - label string, - msg RawContractMessage, - funds sdk.Coins, -) *InstantiateContractProposal { - return &InstantiateContractProposal{title, description, runAs, admin, codeID, label, msg, funds} -} - -// 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 -} - -func NewInstantiateContract2Proposal( - title string, - description string, - runAs string, - admin string, - codeID uint64, - label string, - msg RawContractMessage, - funds sdk.Coins, - salt []byte, - fixMsg bool, -) *InstantiateContract2Proposal { - return &InstantiateContract2Proposal{title, description, runAs, admin, codeID, label, msg, funds, salt, fixMsg} -} - -// 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 -} - -func NewStoreAndInstantiateContractProposal( - title string, - description string, - runAs string, - wasmBz []byte, - source string, - builder string, - codeHash []byte, - permission *AccessConfig, - unpinCode bool, - admin string, - label string, - msg RawContractMessage, - funds sdk.Coins, -) *StoreAndInstantiateContractProposal { - return &StoreAndInstantiateContractProposal{ - Title: title, - Description: description, - RunAs: runAs, - WASMByteCode: wasmBz, - Source: source, - Builder: builder, - CodeHash: codeHash, - InstantiatePermission: permission, - UnpinCode: unpinCode, - Admin: admin, - Label: label, - Msg: msg, - Funds: funds, - } -} - -// 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 -} - -func NewMigrateContractProposal( - title string, - description string, - contract string, - codeID uint64, - msg RawContractMessage, -) *MigrateContractProposal { - return &MigrateContractProposal{ - Title: title, - Description: description, - Contract: contract, - CodeID: codeID, - Msg: msg, - } -} - -// 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 -} - -func NewSudoContractProposal( - title string, - description string, - contract string, - msg RawContractMessage, -) *SudoContractProposal { - return &SudoContractProposal{ - Title: title, - Description: description, - Contract: contract, - Msg: msg, - } -} - -// 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 -} - -func NewExecuteContractProposal( - title string, - description string, - runAs string, - contract string, - msg RawContractMessage, - funds sdk.Coins, -) *ExecuteContractProposal { - return &ExecuteContractProposal{title, description, runAs, contract, msg, funds} -} - -// 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 -} - -func NewUpdateAdminProposal( - title string, - description string, - newAdmin string, - contract string, -) *UpdateAdminProposal { - return &UpdateAdminProposal{title, description, newAdmin, contract} -} - -// 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) -} - -func NewClearAdminProposal( - title string, - description string, - contract string, -) *ClearAdminProposal { - return &ClearAdminProposal{title, description, contract} -} - -// 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) -} - -func NewPinCodesProposal( - title string, - description string, - codeIDs []uint64, -) *PinCodesProposal { - return &PinCodesProposal{ - Title: title, - Description: description, - CodeIDs: codeIDs, - } -} - -// 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) -} - -func NewUnpinCodesProposal( - title string, - description string, - codeIDs []uint64, -) *UnpinCodesProposal { - return &UnpinCodesProposal{ - Title: title, - Description: description, - CodeIDs: 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 -} - -func NewUpdateInstantiateConfigProposal( - title string, - description string, - accessConfigUpdates ...AccessConfigUpdate, -) *UpdateInstantiateConfigProposal { - return &UpdateInstantiateConfigProposal{ - Title: title, - Description: description, - AccessConfigUpdates: accessConfigUpdates, - } -} - -// 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.pb.go b/x/wasm/types/proposal.pb.go deleted file mode 100644 index aecf2aec5f..0000000000 --- a/x/wasm/types/proposal.pb.go +++ /dev/null @@ -1,5758 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmwasm/wasm/v1/proposal.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - _ "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" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = 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_be6422d717c730cb, []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_be6422d717c730cb, []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 enviroment 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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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" yaml:"title"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - // 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_be6422d717c730cb, []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" yaml:"title"` - // Description is a human readable text - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` - // 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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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_be6422d717c730cb, []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.proto", fileDescriptor_be6422d717c730cb) } - -var fileDescriptor_be6422d717c730cb = []byte{ - // 1163 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcd, 0x6f, 0xe3, 0x44, - 0x14, 0xcf, 0x34, 0x89, 0x93, 0x4c, 0x02, 0x64, 0xbd, 0xfd, 0x98, 0xed, 0x16, 0x3b, 0x78, 0x57, - 0xab, 0x68, 0xa5, 0x4d, 0xd4, 0x22, 0x10, 0x84, 0x0f, 0x29, 0x2e, 0x8b, 0xe8, 0x8a, 0x4a, 0x95, - 0xab, 0x6a, 0x25, 0x2e, 0x61, 0x62, 0x4f, 0x52, 0x8b, 0xc4, 0x13, 0x79, 0xec, 0x7e, 0xfc, 0x0b, - 0x9c, 0x38, 0x71, 0xe1, 0x8e, 0x2a, 0x4e, 0x2b, 0xc1, 0xbf, 0x80, 0x54, 0x71, 0xda, 0x03, 0x87, - 0x45, 0x48, 0x81, 0x4d, 0x0f, 0x7b, 0xe0, 0x80, 0xd4, 0x23, 0x07, 0x40, 0x9e, 0x71, 0x52, 0xb7, - 0x4d, 0xe2, 0x2e, 0xb4, 0x2b, 0x21, 0x71, 0x71, 0xf2, 0xe6, 0xcd, 0xd8, 0xbf, 0xdf, 0xfb, 0xcd, - 0x3c, 0xbf, 0x67, 0xa8, 0x9a, 0x94, 0x75, 0x77, 0x31, 0xeb, 0x56, 0xf9, 0x65, 0x67, 0xb9, 0xda, - 0x73, 0x69, 0x8f, 0x32, 0xdc, 0xa9, 0xf4, 0x5c, 0xea, 0x51, 0xb9, 0x38, 0x9c, 0x50, 0xe1, 0x97, - 0x9d, 0xe5, 0xc5, 0xd9, 0x36, 0x6d, 0x53, 0xee, 0xac, 0x06, 0xff, 0xc4, 0xbc, 0xc5, 0x1b, 0xc1, - 0x3c, 0xca, 0x1a, 0xc2, 0x21, 0x8c, 0xd0, 0xa5, 0x08, 0xab, 0xda, 0xc4, 0x8c, 0x54, 0x77, 0x96, - 0x9b, 0xc4, 0xc3, 0xcb, 0x55, 0x93, 0xda, 0x4e, 0xe8, 0x5f, 0x3a, 0x87, 0xc1, 0xdb, 0xef, 0x91, - 0xe1, 0xea, 0x6b, 0xb8, 0x6b, 0x3b, 0xb4, 0xca, 0xaf, 0x62, 0x48, 0x3b, 0x48, 0xc2, 0x6b, 0x9b, - 0x1e, 0x75, 0xc9, 0x2a, 0xb5, 0xc8, 0x46, 0x88, 0x57, 0x9e, 0x85, 0x69, 0xcf, 0xf6, 0x3a, 0x04, - 0x81, 0x12, 0x28, 0xe7, 0x0c, 0x61, 0xc8, 0x25, 0x98, 0xb7, 0x08, 0x33, 0x5d, 0xbb, 0xe7, 0xd9, - 0xd4, 0x41, 0x33, 0xdc, 0x17, 0x1d, 0x92, 0xe7, 0xa0, 0xe4, 0xfa, 0x4e, 0x03, 0x33, 0x94, 0x14, - 0x0b, 0x5d, 0xdf, 0xa9, 0x33, 0xf9, 0x4d, 0xf8, 0x72, 0x00, 0xa7, 0xd1, 0xdc, 0xf7, 0x48, 0xc3, - 0xa4, 0x16, 0x41, 0xa9, 0x12, 0x28, 0x17, 0xf4, 0xe2, 0xa0, 0xaf, 0x16, 0x1e, 0xd6, 0x37, 0xd7, - 0xf5, 0x7d, 0x8f, 0x03, 0x30, 0x0a, 0xc1, 0xbc, 0xa1, 0x25, 0x6f, 0xc1, 0x79, 0xdb, 0x61, 0x1e, - 0x76, 0x3c, 0x1b, 0x7b, 0xa4, 0xd1, 0x23, 0x6e, 0xd7, 0x66, 0x2c, 0x78, 0x76, 0xa6, 0x04, 0xca, - 0xf9, 0x15, 0xa5, 0x72, 0x36, 0xa2, 0x95, 0xba, 0x69, 0x12, 0xc6, 0x56, 0xa9, 0xd3, 0xb2, 0xdb, - 0xc6, 0x5c, 0x64, 0xf5, 0xc6, 0x68, 0xb1, 0xfc, 0x2a, 0x84, 0xbe, 0xd3, 0xb3, 0x1d, 0x01, 0x25, - 0x5b, 0x02, 0xe5, 0xac, 0x91, 0xe3, 0x23, 0xfc, 0xa9, 0xf3, 0x50, 0x62, 0xd4, 0x77, 0x4d, 0x82, - 0x72, 0x9c, 0x44, 0x68, 0xc9, 0x08, 0x66, 0x9a, 0xbe, 0xdd, 0xb1, 0x88, 0x8b, 0x20, 0x77, 0x0c, - 0x4d, 0xf9, 0x26, 0xcc, 0x05, 0xb7, 0x6a, 0x6c, 0x63, 0xb6, 0x8d, 0xf2, 0x01, 0x35, 0x23, 0x1b, - 0x0c, 0x7c, 0x84, 0xd9, 0x76, 0xed, 0x9d, 0x1f, 0xbe, 0xbb, 0xb7, 0x18, 0x8a, 0xd8, 0xa6, 0x3b, - 0x95, 0x50, 0xb5, 0xca, 0x2a, 0x75, 0x3c, 0xe2, 0x78, 0x9f, 0x3f, 0x7b, 0x74, 0x77, 0x9e, 0x8b, - 0x75, 0x4e, 0x06, 0x04, 0x1e, 0xa4, 0xb2, 0xe9, 0xa2, 0xf4, 0x20, 0x95, 0x95, 0x8a, 0x19, 0xed, - 0xcb, 0x24, 0xbc, 0xb9, 0x76, 0x42, 0x28, 0x58, 0xef, 0x62, 0xd3, 0xbb, 0x2a, 0xd1, 0x66, 0x61, - 0x1a, 0x5b, 0x5d, 0xdb, 0xe1, 0x5a, 0xe5, 0x0c, 0x61, 0xc8, 0xb7, 0x60, 0x86, 0x53, 0xb5, 0x2d, - 0x94, 0x2e, 0x81, 0x72, 0x4a, 0x87, 0x83, 0xbe, 0x2a, 0x05, 0xa8, 0xd7, 0x3e, 0x30, 0xa4, 0xc0, - 0xb5, 0x66, 0x05, 0x4b, 0x3b, 0xb8, 0x49, 0x3a, 0x48, 0x12, 0x4b, 0xb9, 0x21, 0x97, 0x61, 0xb2, - 0xcb, 0xda, 0x5c, 0xba, 0x82, 0x3e, 0xff, 0x47, 0x5f, 0x95, 0x0d, 0xbc, 0x3b, 0x64, 0xb1, 0x4e, - 0x18, 0xc3, 0x6d, 0x62, 0x04, 0x53, 0xe4, 0x16, 0x4c, 0xb7, 0x7c, 0xc7, 0x62, 0x28, 0x5b, 0x4a, - 0x96, 0xf3, 0x2b, 0x37, 0x2a, 0x61, 0xf8, 0x82, 0x5d, 0x1f, 0x89, 0x9f, 0xed, 0xe8, 0x6f, 0x1c, - 0xf6, 0xd5, 0xc4, 0x37, 0xbf, 0xa8, 0xe5, 0xb6, 0xed, 0x6d, 0xfb, 0xcd, 0x8a, 0x49, 0xbb, 0xe1, - 0x81, 0x09, 0x7f, 0xee, 0x31, 0xeb, 0xb3, 0xf0, 0x0c, 0x04, 0x0b, 0xd8, 0xc1, 0xb3, 0x47, 0x77, - 0x81, 0x21, 0x6e, 0x5f, 0xbb, 0x1f, 0x2f, 0x4d, 0x89, 0x4b, 0x33, 0x25, 0xec, 0x08, 0x68, 0xdf, - 0x27, 0xe1, 0xd2, 0x98, 0x19, 0x2b, 0xff, 0x2b, 0xf3, 0x4f, 0x95, 0x91, 0x65, 0x98, 0x62, 0xb8, - 0xe3, 0xf1, 0x13, 0x58, 0x30, 0xf8, 0x7f, 0x79, 0x01, 0x66, 0x5a, 0xf6, 0x5e, 0x23, 0x40, 0x0a, - 0xf9, 0x99, 0x95, 0x5a, 0xf6, 0xde, 0x3a, 0x6b, 0xd7, 0x3e, 0x8c, 0x97, 0xf1, 0xb5, 0x49, 0x32, - 0xae, 0x44, 0x74, 0xfc, 0x0b, 0xc0, 0x85, 0x75, 0xbb, 0xed, 0x5e, 0xe6, 0xe1, 0x5a, 0x84, 0x59, - 0x33, 0xbc, 0x57, 0x28, 0xd7, 0xc8, 0xbe, 0x98, 0x62, 0xa1, 0x36, 0x52, 0xac, 0x36, 0xb5, 0x7a, - 0x7c, 0x18, 0x96, 0x78, 0x18, 0x26, 0x70, 0x44, 0x40, 0xfb, 0x11, 0xc0, 0xd9, 0x4d, 0xdf, 0xa2, - 0x57, 0x42, 0x3f, 0x79, 0x86, 0x7e, 0xc8, 0x2c, 0x15, 0xcf, 0xec, 0xfd, 0x78, 0x66, 0x37, 0x44, - 0x0a, 0x1d, 0x83, 0x1d, 0x01, 0xed, 0xa7, 0x19, 0xb8, 0x70, 0x7f, 0x8f, 0x98, 0xfe, 0xd5, 0x67, - 0xcd, 0x69, 0x7a, 0x87, 0x84, 0xd3, 0xcf, 0x71, 0xcc, 0xa4, 0xab, 0x4d, 0x80, 0x17, 0xde, 0x32, - 0x13, 0xa2, 0x87, 0x80, 0xf6, 0x33, 0x80, 0xd7, 0xb7, 0x7a, 0x16, 0xf6, 0x48, 0x3d, 0x48, 0x43, - 0xff, 0x3a, 0xae, 0xcb, 0x30, 0xe7, 0x90, 0xdd, 0x86, 0x48, 0x70, 0x3c, 0xb4, 0xfa, 0xec, 0x71, - 0x5f, 0x2d, 0xee, 0xe3, 0x6e, 0xa7, 0xa6, 0x8d, 0x5c, 0x9a, 0x91, 0x75, 0xc8, 0x2e, 0x7f, 0xe4, - 0xb4, 0x98, 0xd7, 0xde, 0x8b, 0x67, 0x88, 0x38, 0xc3, 0x31, 0x1c, 0x10, 0xd0, 0xbe, 0x06, 0x50, - 0x5e, 0xed, 0x10, 0xec, 0x5e, 0x0e, 0xb9, 0x29, 0xc7, 0xa1, 0xf6, 0x6e, 0x3c, 0xd2, 0x05, 0x8e, - 0xf4, 0x3c, 0x1e, 0x04, 0xb4, 0xdf, 0x00, 0x2c, 0x6e, 0x88, 0x02, 0x86, 0x8d, 0x60, 0xde, 0x39, - 0x05, 0x53, 0x2f, 0x1e, 0xf7, 0xd5, 0x82, 0x88, 0x23, 0x1f, 0xd6, 0x86, 0xc0, 0xdf, 0x1a, 0x03, - 0x5c, 0x9f, 0x3f, 0xee, 0xab, 0xb2, 0x98, 0x1d, 0x71, 0x6a, 0xa7, 0x09, 0xbd, 0x0d, 0xb3, 0x61, - 0x0a, 0x0b, 0xce, 0x41, 0xb2, 0x9c, 0xd2, 0x95, 0x41, 0x5f, 0xcd, 0x88, 0x1c, 0xc6, 0x8e, 0xfb, - 0xea, 0x2b, 0xe2, 0x0e, 0xc3, 0x49, 0x9a, 0x91, 0x11, 0x79, 0x8d, 0xd5, 0x6a, 0xf1, 0x7c, 0xe7, - 0x38, 0xdf, 0xb3, 0xb4, 0x10, 0xd0, 0x7e, 0x07, 0x50, 0xde, 0x1a, 0x16, 0x6c, 0xff, 0x11, 0xbe, - 0x17, 0xd6, 0xf7, 0x3c, 0x31, 0x04, 0xb4, 0xaf, 0x00, 0x94, 0xa3, 0xb5, 0xad, 0xd8, 0xae, 0xd1, - 0x57, 0x08, 0x98, 0xf8, 0x0a, 0xf9, 0x74, 0x62, 0x19, 0x3d, 0x73, 0x91, 0x32, 0x5a, 0xcf, 0x05, - 0x39, 0x46, 0xe4, 0x8d, 0xf1, 0x15, 0xb5, 0xf6, 0xed, 0x0c, 0x54, 0x05, 0xa2, 0xd3, 0xaf, 0xd8, - 0x96, 0xdd, 0x7e, 0x81, 0xe2, 0x98, 0x70, 0x0e, 0x73, 0xdc, 0x0d, 0x93, 0x3f, 0xba, 0xe1, 0x73, - 0x48, 0x42, 0xa9, 0xfc, 0xca, 0xed, 0xe9, 0x34, 0x05, 0xfe, 0x28, 0xd9, 0xeb, 0xf8, 0x9c, 0x9b, - 0xd5, 0xd6, 0xe2, 0x65, 0xbc, 0x1d, 0x49, 0x28, 0x13, 0xe3, 0x81, 0x80, 0xf6, 0x67, 0x0a, 0xde, - 0xe2, 0x45, 0x7f, 0xdd, 0xb1, 0x5e, 0x60, 0x61, 0x7f, 0xf9, 0xdd, 0x58, 0xfa, 0xf2, 0xba, 0x31, - 0xe9, 0x6c, 0x37, 0x36, 0x2a, 0x76, 0x33, 0xd1, 0x62, 0x77, 0x54, 0xc7, 0x66, 0xc7, 0xd4, 0xb1, - 0xb9, 0xe7, 0x78, 0xc1, 0xc2, 0xab, 0xad, 0x63, 0x4f, 0x7a, 0xc9, 0xfc, 0xa4, 0x5e, 0xb2, 0x30, - 0xa5, 0x97, 0x7c, 0xe9, 0x4c, 0x2f, 0xb9, 0x1e, 0xbf, 0xf9, 0xca, 0x27, 0xbd, 0xe4, 0xf4, 0x6d, - 0x85, 0x80, 0xfe, 0xf1, 0xe1, 0x53, 0x25, 0xf1, 0xe4, 0xa9, 0x92, 0x38, 0x18, 0x28, 0xe0, 0x70, - 0xa0, 0x80, 0xc7, 0x03, 0x05, 0xfc, 0x3a, 0x50, 0xc0, 0x17, 0x47, 0x4a, 0xe2, 0xf1, 0x91, 0x92, - 0x78, 0x72, 0xa4, 0x24, 0x3e, 0xb9, 0x13, 0x61, 0xbe, 0x4a, 0x59, 0xf7, 0xe1, 0xf0, 0xf3, 0x82, - 0x55, 0xdd, 0x13, 0x9f, 0x19, 0x38, 0xfb, 0xa6, 0xc4, 0xbf, 0x28, 0xbc, 0xfe, 0x77, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x0f, 0x40, 0x90, 0x22, 0x08, 0x11, 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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if len(m.WASMByteCode) > 0 { - i -= len(m.WASMByteCode) - copy(dAtA[i:], m.WASMByteCode) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0x32 - } - if m.CodeID != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x28 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(len(m.Label))) - i-- - dAtA[i] = 0x32 - } - if m.CodeID != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x28 - } - if len(m.Admin) > 0 { - i -= len(m.Admin) - copy(dAtA[i:], m.Admin) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0x32 - } - if m.CodeID != 0 { - i = encodeVarintProposal(dAtA, i, uint64(m.CodeID)) - i-- - dAtA[i] = 0x28 - } - if len(m.Contract) > 0 { - i -= len(m.Contract) - copy(dAtA[i:], m.Contract) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(j2)) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(j4)) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.CodeID != 0 { - i = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.WASMByteCode) > 0 { - i -= len(m.WASMByteCode) - copy(dAtA[i:], m.WASMByteCode) - i = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(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 = encodeVarintProposal(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintProposal(dAtA []byte, offset int, v uint64) int { - offset -= sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.WASMByteCode) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.InstantiatePermission != nil { - l = m.InstantiatePermission.Size() - n += 1 + l + sovProposal(uint64(l)) - } - if m.UnpinCode { - n += 2 - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Builder) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.CodeHash) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovProposal(uint64(m.CodeID)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovProposal(uint64(m.CodeID)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovProposal(uint64(l)) - } - } - l = len(m.Salt) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.CodeID != 0 { - n += 1 + sovProposal(uint64(m.CodeID)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.NewAdmin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Contract) - if l > 0 { - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.CodeIDs) > 0 { - l = 0 - for _, e := range m.CodeIDs { - l += sovProposal(uint64(e)) - } - n += 1 + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.CodeIDs) > 0 { - l = 0 - for _, e := range m.CodeIDs { - l += sovProposal(uint64(e)) - } - n += 1 + sovProposal(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 + sovProposal(uint64(m.CodeID)) - } - l = m.InstantiatePermission.Size() - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.AccessConfigUpdates) > 0 { - for _, e := range m.AccessConfigUpdates { - l = e.Size() - n += 1 + l + sovProposal(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 + sovProposal(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.RunAs) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.WASMByteCode) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if m.InstantiatePermission != nil { - l = m.InstantiatePermission.Size() - n += 1 + l + sovProposal(uint64(l)) - } - if m.UnpinCode { - n += 2 - } - l = len(m.Admin) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Label) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - if len(m.Funds) > 0 { - for _, e := range m.Funds { - l = e.Size() - n += 1 + l + sovProposal(uint64(l)) - } - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.Builder) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - l = len(m.CodeHash) - if l > 0 { - n += 1 + l + sovProposal(uint64(l)) - } - return n -} - -func sovProposal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozProposal(x uint64) (n int) { - return sovProposal(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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contract = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - 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 ErrInvalidLengthProposal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 ErrIntOverflowProposal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProposal - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProposal - } - 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 := skipProposal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProposal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProposal(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, ErrIntOverflowProposal - } - 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, ErrIntOverflowProposal - } - 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, ErrIntOverflowProposal - } - 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, ErrInvalidLengthProposal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProposal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProposal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProposal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProposal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProposal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/wasm/types/proposal_test.go b/x/wasm/types/proposal_test.go deleted file mode 100644 index 622485886f..0000000000 --- a/x/wasm/types/proposal_test.go +++ /dev/null @@ -1,1130 +0,0 @@ -package types - -import ( - "bytes" - "encoding/json" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gopkg.in/yaml.v2" - - 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: sdk.NewInt(-1)}} - }), - expErr: true, - }, - "init funds with duplicates": { - src: InstantiateContractProposalFixture(func(p *InstantiateContractProposal) { - p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "foo", Amount: sdk.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: sdk.NewInt(-1)}} - }), - expErr: true, - }, - "init funds with duplicates": { - src: InstantiateContract2ProposalFixture(func(p *InstantiateContract2Proposal) { - p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "foo", Amount: sdk.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: sdk.NewInt(-1)}} - }), - expErr: true, - }, - "init funds with duplicates": { - src: StoreAndInstantiateContractProposalFixture(func(p *StoreAndInstantiateContractProposal) { - p.Funds = sdk.Coins{{Denom: "foo", Amount: sdk.NewInt(1)}, {Denom: "foo", Amount: sdk.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: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.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: sdk.NewInt(1)}, {Denom: "bar", Amount: sdk.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 TestConvertToProposals(t *testing.T) { - cases := map[string]struct { - input string - isError bool - proposals []ProposalType - }{ - "one proper item": { - input: "UpdateAdmin", - proposals: []ProposalType{ProposalTypeUpdateAdmin}, - }, - "multiple proper items": { - input: "StoreCode,InstantiateContract,MigrateContract", - proposals: []ProposalType{ProposalTypeStoreCode, ProposalTypeInstantiateContract, ProposalTypeMigrateContract}, - }, - "empty trailing item": { - input: "StoreCode,", - isError: true, - }, - "invalid item": { - input: "StoreCode,InvalidProposalType", - isError: true, - }, - } - - for name, tc := range cases { - t.Run(name, func(t *testing.T) { - chunks := strings.Split(tc.input, ",") - proposals, err := ConvertToProposals(chunks) - if tc.isError { - require.Error(t, err) - } else { - require.NoError(t, err) - require.Equal(t, proposals, tc.proposals) - } - }) - } -} - -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", sdk.NewInt(2)), sdk.NewCoin("BLX", sdk.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) - }) - } -} - -func TestProposalJsonSignBytes(t *testing.T) { - const myInnerMsg = `{"foo":"bar"}` - specs := map[string]struct { - src v1beta1.Content - exp string - }{ - "instantiate contract": { - src: &InstantiateContractProposal{Msg: RawContractMessage(myInnerMsg)}, - exp: ` -{ - "type":"cosmos-sdk/MsgSubmitProposal", - "value":{"content":{"type":"wasm/InstantiateContractProposal","value":{"funds":[],"msg":{"foo":"bar"}}},"initial_deposit":[]} -}`, - }, - "migrate contract": { - src: &MigrateContractProposal{Msg: RawContractMessage(myInnerMsg)}, - exp: ` -{ - "type":"cosmos-sdk/MsgSubmitProposal", - "value":{"content":{"type":"wasm/MigrateContractProposal","value":{"msg":{"foo":"bar"}}},"initial_deposit":[]} -}`, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - msg, err := v1beta1.NewMsgSubmitProposal(spec.src, sdk.NewCoins(), []byte{}) - require.NoError(t, err) - - bz := msg.GetSignBytes() - assert.JSONEq(t, spec.exp, string(bz), "exp %s\n got: %s\n", spec.exp, string(bz)) - }) - } -} diff --git a/x/wasm/types/test_fixtures.go b/x/wasm/types/test_fixtures.go index 2c0571836e..be4c5725e5 100644 --- a/x/wasm/types/test_fixtures.go +++ b/x/wasm/types/test_fixtures.go @@ -1,10 +1,7 @@ package types import ( - "bytes" _ "embed" - "encoding/hex" - "encoding/json" "math/rand" wasmvm "github.com/CosmWasm/wasmvm" @@ -206,250 +203,3 @@ func MsgExecuteContractFixture(mutators ...func(*MsgExecuteContract)) *MsgExecut } return r } - -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 -} - -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 -} - -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 -} - -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 -} - -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 -} - -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 -} - -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: sdk.NewInt(1), - }}, - } - - for _, m := range mutators { - m(p) - } - return p -} - -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 -} - -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.go b/x/wasm/types/tx.go index 2bf96987be..d739cb49aa 100644 --- a/x/wasm/types/tx.go +++ b/x/wasm/types/tx.go @@ -762,3 +762,32 @@ func hasDuplicates[T comparable](s []T) bool { } return false } + +func (msg MsgUpdateContractLabel) Route() string { + return RouterKey +} + +func (msg MsgUpdateContractLabel) Type() string { + return "update-contract-label" +} + +func (msg MsgUpdateContractLabel) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrap(err, "sender") + } + if err := ValidateLabel(msg.NewLabel); err != nil { + return errorsmod.Wrap(err, "label") + } + if _, err := sdk.AccAddressFromBech32(msg.Contract); err != nil { + return errorsmod.Wrap(err, "contract") + } + return nil +} + +func (msg MsgUpdateContractLabel) GetSigners() []sdk.AccAddress { + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{senderAddr} +} diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index 18a6494a28..40ae2a613c 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -6,6 +6,10 @@ package types import ( context "context" 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" @@ -17,15 +21,14 @@ import ( grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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. @@ -50,9 +53,11 @@ func (*MsgStoreCode) ProtoMessage() {} func (*MsgStoreCode) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{0} } + func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreCode.Marshal(b, m, deterministic) @@ -65,12 +70,15 @@ func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *MsgStoreCode) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreCode.Merge(m, src) } + func (m *MsgStoreCode) XXX_Size() int { return m.Size() } + func (m *MsgStoreCode) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreCode.DiscardUnknown(m) } @@ -91,9 +99,11 @@ func (*MsgStoreCodeResponse) ProtoMessage() {} func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{1} } + func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreCodeResponse.Marshal(b, m, deterministic) @@ -106,12 +116,15 @@ func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } + func (m *MsgStoreCodeResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreCodeResponse.Merge(m, src) } + func (m *MsgStoreCodeResponse) XXX_Size() int { return m.Size() } + func (m *MsgStoreCodeResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreCodeResponse.DiscardUnknown(m) } @@ -141,9 +154,11 @@ func (*MsgInstantiateContract) ProtoMessage() {} func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{2} } + func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgInstantiateContract.Marshal(b, m, deterministic) @@ -156,12 +171,15 @@ func (m *MsgInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } + func (m *MsgInstantiateContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgInstantiateContract.Merge(m, src) } + func (m *MsgInstantiateContract) XXX_Size() int { return m.Size() } + func (m *MsgInstantiateContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgInstantiateContract.DiscardUnknown(m) } @@ -182,9 +200,11 @@ func (*MsgInstantiateContractResponse) ProtoMessage() {} func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{3} } + func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgInstantiateContractResponse.Marshal(b, m, deterministic) @@ -197,12 +217,15 @@ func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } + func (m *MsgInstantiateContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgInstantiateContractResponse.Merge(m, src) } + func (m *MsgInstantiateContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgInstantiateContractResponse.DiscardUnknown(m) } @@ -237,9 +260,11 @@ func (*MsgInstantiateContract2) ProtoMessage() {} func (*MsgInstantiateContract2) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{4} } + func (m *MsgInstantiateContract2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgInstantiateContract2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgInstantiateContract2.Marshal(b, m, deterministic) @@ -252,12 +277,15 @@ func (m *MsgInstantiateContract2) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } + func (m *MsgInstantiateContract2) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgInstantiateContract2.Merge(m, src) } + func (m *MsgInstantiateContract2) XXX_Size() int { return m.Size() } + func (m *MsgInstantiateContract2) XXX_DiscardUnknown() { xxx_messageInfo_MsgInstantiateContract2.DiscardUnknown(m) } @@ -278,9 +306,11 @@ func (*MsgInstantiateContract2Response) ProtoMessage() {} func (*MsgInstantiateContract2Response) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{5} } + func (m *MsgInstantiateContract2Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgInstantiateContract2Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgInstantiateContract2Response.Marshal(b, m, deterministic) @@ -293,12 +323,15 @@ func (m *MsgInstantiateContract2Response) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } + func (m *MsgInstantiateContract2Response) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgInstantiateContract2Response.Merge(m, src) } + func (m *MsgInstantiateContract2Response) XXX_Size() int { return m.Size() } + func (m *MsgInstantiateContract2Response) XXX_DiscardUnknown() { xxx_messageInfo_MsgInstantiateContract2Response.DiscardUnknown(m) } @@ -323,9 +356,11 @@ func (*MsgExecuteContract) ProtoMessage() {} func (*MsgExecuteContract) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{6} } + func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgExecuteContract.Marshal(b, m, deterministic) @@ -338,12 +373,15 @@ func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *MsgExecuteContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgExecuteContract.Merge(m, src) } + func (m *MsgExecuteContract) XXX_Size() int { return m.Size() } + func (m *MsgExecuteContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgExecuteContract.DiscardUnknown(m) } @@ -362,9 +400,11 @@ func (*MsgExecuteContractResponse) ProtoMessage() {} func (*MsgExecuteContractResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{7} } + func (m *MsgExecuteContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgExecuteContractResponse.Marshal(b, m, deterministic) @@ -377,12 +417,15 @@ func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *MsgExecuteContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgExecuteContractResponse.Merge(m, src) } + func (m *MsgExecuteContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgExecuteContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgExecuteContractResponse.DiscardUnknown(m) } @@ -407,9 +450,11 @@ func (*MsgMigrateContract) ProtoMessage() {} func (*MsgMigrateContract) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{8} } + func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgMigrateContract.Marshal(b, m, deterministic) @@ -422,12 +467,15 @@ func (m *MsgMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *MsgMigrateContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgMigrateContract.Merge(m, src) } + func (m *MsgMigrateContract) XXX_Size() int { return m.Size() } + func (m *MsgMigrateContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgMigrateContract.DiscardUnknown(m) } @@ -447,9 +495,11 @@ func (*MsgMigrateContractResponse) ProtoMessage() {} func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{9} } + func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgMigrateContractResponse.Marshal(b, m, deterministic) @@ -462,12 +512,15 @@ func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *MsgMigrateContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgMigrateContractResponse.Merge(m, src) } + func (m *MsgMigrateContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgMigrateContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgMigrateContractResponse.DiscardUnknown(m) } @@ -490,9 +543,11 @@ func (*MsgUpdateAdmin) ProtoMessage() {} func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{10} } + func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateAdmin.Marshal(b, m, deterministic) @@ -505,12 +560,15 @@ func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } + func (m *MsgUpdateAdmin) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateAdmin.Merge(m, src) } + func (m *MsgUpdateAdmin) XXX_Size() int { return m.Size() } + func (m *MsgUpdateAdmin) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateAdmin.DiscardUnknown(m) } @@ -518,8 +576,7 @@ func (m *MsgUpdateAdmin) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo // MsgUpdateAdminResponse returns empty data -type MsgUpdateAdminResponse struct { -} +type MsgUpdateAdminResponse struct{} func (m *MsgUpdateAdminResponse) Reset() { *m = MsgUpdateAdminResponse{} } func (m *MsgUpdateAdminResponse) String() string { return proto.CompactTextString(m) } @@ -527,9 +584,11 @@ func (*MsgUpdateAdminResponse) ProtoMessage() {} func (*MsgUpdateAdminResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{11} } + func (m *MsgUpdateAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateAdminResponse.Marshal(b, m, deterministic) @@ -542,12 +601,15 @@ func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } + func (m *MsgUpdateAdminResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateAdminResponse.Merge(m, src) } + func (m *MsgUpdateAdminResponse) XXX_Size() int { return m.Size() } + func (m *MsgUpdateAdminResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateAdminResponse.DiscardUnknown(m) } @@ -568,9 +630,11 @@ func (*MsgClearAdmin) ProtoMessage() {} func (*MsgClearAdmin) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{12} } + func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgClearAdmin.Marshal(b, m, deterministic) @@ -583,12 +647,15 @@ func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } + func (m *MsgClearAdmin) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgClearAdmin.Merge(m, src) } + func (m *MsgClearAdmin) XXX_Size() int { return m.Size() } + func (m *MsgClearAdmin) XXX_DiscardUnknown() { xxx_messageInfo_MsgClearAdmin.DiscardUnknown(m) } @@ -596,8 +663,7 @@ func (m *MsgClearAdmin) XXX_DiscardUnknown() { var xxx_messageInfo_MsgClearAdmin proto.InternalMessageInfo // MsgClearAdminResponse returns empty data -type MsgClearAdminResponse struct { -} +type MsgClearAdminResponse struct{} func (m *MsgClearAdminResponse) Reset() { *m = MsgClearAdminResponse{} } func (m *MsgClearAdminResponse) String() string { return proto.CompactTextString(m) } @@ -605,9 +671,11 @@ func (*MsgClearAdminResponse) ProtoMessage() {} func (*MsgClearAdminResponse) Descriptor() ([]byte, []int) { return fileDescriptor_4f74d82755520264, []int{13} } + func (m *MsgClearAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgClearAdminResponse.Marshal(b, m, deterministic) @@ -620,18 +688,68 @@ func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } + func (m *MsgClearAdminResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgClearAdminResponse.Merge(m, src) } + func (m *MsgClearAdminResponse) XXX_Size() int { return m.Size() } + func (m *MsgClearAdminResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgClearAdminResponse.DiscardUnknown(m) } 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 @@ -646,11 +764,13 @@ 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{14} + return fileDescriptor_4f74d82755520264, []int{15} } + func (m *MsgUpdateInstantiateConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateInstantiateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateInstantiateConfig.Marshal(b, m, deterministic) @@ -663,12 +783,15 @@ func (m *MsgUpdateInstantiateConfig) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *MsgUpdateInstantiateConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateInstantiateConfig.Merge(m, src) } + func (m *MsgUpdateInstantiateConfig) XXX_Size() int { return m.Size() } + func (m *MsgUpdateInstantiateConfig) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateInstantiateConfig.DiscardUnknown(m) } @@ -676,18 +799,19 @@ func (m *MsgUpdateInstantiateConfig) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateInstantiateConfig proto.InternalMessageInfo // MsgUpdateInstantiateConfigResponse returns empty data -type MsgUpdateInstantiateConfigResponse struct { -} +type MsgUpdateInstantiateConfigResponse struct{} func (m *MsgUpdateInstantiateConfigResponse) Reset() { *m = MsgUpdateInstantiateConfigResponse{} } func (m *MsgUpdateInstantiateConfigResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateInstantiateConfigResponse) ProtoMessage() {} func (*MsgUpdateInstantiateConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{15} + return fileDescriptor_4f74d82755520264, []int{16} } + func (m *MsgUpdateInstantiateConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateInstantiateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateInstantiateConfigResponse.Marshal(b, m, deterministic) @@ -700,12 +824,15 @@ func (m *MsgUpdateInstantiateConfigResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } + func (m *MsgUpdateInstantiateConfigResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateInstantiateConfigResponse.Merge(m, src) } + func (m *MsgUpdateInstantiateConfigResponse) XXX_Size() int { return m.Size() } + func (m *MsgUpdateInstantiateConfigResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateInstantiateConfigResponse.DiscardUnknown(m) } @@ -728,11 +855,13 @@ 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{16} + return fileDescriptor_4f74d82755520264, []int{17} } + func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) @@ -745,12 +874,15 @@ func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } + func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParams.Merge(m, src) } + func (m *MsgUpdateParams) XXX_Size() int { return m.Size() } + func (m *MsgUpdateParams) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) } @@ -761,18 +893,19 @@ var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo // MsgUpdateParams message. // // Since: 0.40 -type MsgUpdateParamsResponse struct { -} +type MsgUpdateParamsResponse struct{} 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{17} + return fileDescriptor_4f74d82755520264, []int{18} } + func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) @@ -785,12 +918,15 @@ func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } + func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) } + func (m *MsgUpdateParamsResponse) XXX_Size() int { return m.Size() } + func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) } @@ -813,11 +949,13 @@ 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{18} + return fileDescriptor_4f74d82755520264, []int{19} } + func (m *MsgSudoContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgSudoContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSudoContract.Marshal(b, m, deterministic) @@ -830,12 +968,15 @@ func (m *MsgSudoContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } + func (m *MsgSudoContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSudoContract.Merge(m, src) } + func (m *MsgSudoContract) XXX_Size() int { return m.Size() } + func (m *MsgSudoContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgSudoContract.DiscardUnknown(m) } @@ -855,11 +996,13 @@ 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{19} + return fileDescriptor_4f74d82755520264, []int{20} } + func (m *MsgSudoContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgSudoContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgSudoContractResponse.Marshal(b, m, deterministic) @@ -872,12 +1015,15 @@ func (m *MsgSudoContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } + func (m *MsgSudoContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgSudoContractResponse.Merge(m, src) } + func (m *MsgSudoContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgSudoContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgSudoContractResponse.DiscardUnknown(m) } @@ -898,11 +1044,13 @@ 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{20} + return fileDescriptor_4f74d82755520264, []int{21} } + func (m *MsgPinCodes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgPinCodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgPinCodes.Marshal(b, m, deterministic) @@ -915,12 +1063,15 @@ func (m *MsgPinCodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } + func (m *MsgPinCodes) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgPinCodes.Merge(m, src) } + func (m *MsgPinCodes) XXX_Size() int { return m.Size() } + func (m *MsgPinCodes) XXX_DiscardUnknown() { xxx_messageInfo_MsgPinCodes.DiscardUnknown(m) } @@ -931,18 +1082,19 @@ var xxx_messageInfo_MsgPinCodes proto.InternalMessageInfo // MsgPinCodes message. // // Since: 0.40 -type MsgPinCodesResponse struct { -} +type MsgPinCodesResponse struct{} 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{21} + return fileDescriptor_4f74d82755520264, []int{22} } + func (m *MsgPinCodesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgPinCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgPinCodesResponse.Marshal(b, m, deterministic) @@ -955,12 +1107,15 @@ func (m *MsgPinCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } + func (m *MsgPinCodesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgPinCodesResponse.Merge(m, src) } + func (m *MsgPinCodesResponse) XXX_Size() int { return m.Size() } + func (m *MsgPinCodesResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgPinCodesResponse.DiscardUnknown(m) } @@ -981,11 +1136,13 @@ 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{22} + return fileDescriptor_4f74d82755520264, []int{23} } + func (m *MsgUnpinCodes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUnpinCodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUnpinCodes.Marshal(b, m, deterministic) @@ -998,12 +1155,15 @@ func (m *MsgUnpinCodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } + func (m *MsgUnpinCodes) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUnpinCodes.Merge(m, src) } + func (m *MsgUnpinCodes) XXX_Size() int { return m.Size() } + func (m *MsgUnpinCodes) XXX_DiscardUnknown() { xxx_messageInfo_MsgUnpinCodes.DiscardUnknown(m) } @@ -1014,18 +1174,19 @@ var xxx_messageInfo_MsgUnpinCodes proto.InternalMessageInfo // MsgUnpinCodes message. // // Since: 0.40 -type MsgUnpinCodesResponse struct { -} +type MsgUnpinCodesResponse struct{} 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{23} + return fileDescriptor_4f74d82755520264, []int{24} } + func (m *MsgUnpinCodesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgUnpinCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgUnpinCodesResponse.Marshal(b, m, deterministic) @@ -1038,12 +1199,15 @@ func (m *MsgUnpinCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } + func (m *MsgUnpinCodesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgUnpinCodesResponse.Merge(m, src) } + func (m *MsgUnpinCodesResponse) XXX_Size() int { return m.Size() } + func (m *MsgUnpinCodesResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgUnpinCodesResponse.DiscardUnknown(m) } @@ -1087,11 +1251,13 @@ 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{24} + return fileDescriptor_4f74d82755520264, []int{25} } + func (m *MsgStoreAndInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreAndInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreAndInstantiateContract.Marshal(b, m, deterministic) @@ -1104,12 +1270,15 @@ func (m *MsgStoreAndInstantiateContract) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } + func (m *MsgStoreAndInstantiateContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreAndInstantiateContract.Merge(m, src) } + func (m *MsgStoreAndInstantiateContract) XXX_Size() int { return m.Size() } + func (m *MsgStoreAndInstantiateContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreAndInstantiateContract.DiscardUnknown(m) } @@ -1133,11 +1302,13 @@ 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{25} + return fileDescriptor_4f74d82755520264, []int{26} } + func (m *MsgStoreAndInstantiateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreAndInstantiateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreAndInstantiateContractResponse.Marshal(b, m, deterministic) @@ -1150,12 +1321,15 @@ func (m *MsgStoreAndInstantiateContractResponse) XXX_Marshal(b []byte, determini return b[:n], nil } } + func (m *MsgStoreAndInstantiateContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreAndInstantiateContractResponse.Merge(m, src) } + func (m *MsgStoreAndInstantiateContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgStoreAndInstantiateContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreAndInstantiateContractResponse.DiscardUnknown(m) } @@ -1174,11 +1348,13 @@ 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{26} + return fileDescriptor_4f74d82755520264, []int{27} } + func (m *MsgAddCodeUploadParamsAddresses) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgAddCodeUploadParamsAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddCodeUploadParamsAddresses.Marshal(b, m, deterministic) @@ -1191,12 +1367,15 @@ func (m *MsgAddCodeUploadParamsAddresses) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } + func (m *MsgAddCodeUploadParamsAddresses) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddCodeUploadParamsAddresses.Merge(m, src) } + func (m *MsgAddCodeUploadParamsAddresses) XXX_Size() int { return m.Size() } + func (m *MsgAddCodeUploadParamsAddresses) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddCodeUploadParamsAddresses.DiscardUnknown(m) } @@ -1205,8 +1384,7 @@ var xxx_messageInfo_MsgAddCodeUploadParamsAddresses proto.InternalMessageInfo // MsgAddCodeUploadParamsAddressesResponse defines the response // structure for executing a MsgAddCodeUploadParamsAddresses message. -type MsgAddCodeUploadParamsAddressesResponse struct { -} +type MsgAddCodeUploadParamsAddressesResponse struct{} func (m *MsgAddCodeUploadParamsAddressesResponse) Reset() { *m = MsgAddCodeUploadParamsAddressesResponse{} @@ -1214,11 +1392,13 @@ 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{27} + return fileDescriptor_4f74d82755520264, []int{28} } + func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgAddCodeUploadParamsAddressesResponse.Marshal(b, m, deterministic) @@ -1231,12 +1411,15 @@ func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Marshal(b []byte, determin return b[:n], nil } } + func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgAddCodeUploadParamsAddressesResponse.Merge(m, src) } + func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_Size() int { return m.Size() } + func (m *MsgAddCodeUploadParamsAddressesResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgAddCodeUploadParamsAddressesResponse.DiscardUnknown(m) } @@ -1255,11 +1438,13 @@ 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{28} + return fileDescriptor_4f74d82755520264, []int{29} } + func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgRemoveCodeUploadParamsAddresses.Marshal(b, m, deterministic) @@ -1272,12 +1457,15 @@ func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Marshal(b []byte, deterministic return b[:n], nil } } + func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgRemoveCodeUploadParamsAddresses.Merge(m, src) } + func (m *MsgRemoveCodeUploadParamsAddresses) XXX_Size() int { return m.Size() } + func (m *MsgRemoveCodeUploadParamsAddresses) XXX_DiscardUnknown() { xxx_messageInfo_MsgRemoveCodeUploadParamsAddresses.DiscardUnknown(m) } @@ -1286,22 +1474,24 @@ var xxx_messageInfo_MsgRemoveCodeUploadParamsAddresses proto.InternalMessageInfo // MsgRemoveCodeUploadParamsAddressesResponse defines the response // structure for executing a MsgRemoveCodeUploadParamsAddresses message. -type MsgRemoveCodeUploadParamsAddressesResponse struct { -} +type MsgRemoveCodeUploadParamsAddressesResponse struct{} func (m *MsgRemoveCodeUploadParamsAddressesResponse) Reset() { *m = MsgRemoveCodeUploadParamsAddressesResponse{} } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveCodeUploadParamsAddressesResponse) ProtoMessage() {} func (*MsgRemoveCodeUploadParamsAddressesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{29} + return fileDescriptor_4f74d82755520264, []int{30} } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgRemoveCodeUploadParamsAddressesResponse.Marshal(b, m, deterministic) @@ -1314,12 +1504,15 @@ func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Marshal(b []byte, deter return b[:n], nil } } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgRemoveCodeUploadParamsAddressesResponse.Merge(m, src) } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_Size() int { return m.Size() } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgRemoveCodeUploadParamsAddressesResponse.DiscardUnknown(m) } @@ -1347,11 +1540,13 @@ 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{30} + return fileDescriptor_4f74d82755520264, []int{31} } + func (m *MsgStoreAndMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreAndMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreAndMigrateContract.Marshal(b, m, deterministic) @@ -1364,12 +1559,15 @@ func (m *MsgStoreAndMigrateContract) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } + func (m *MsgStoreAndMigrateContract) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreAndMigrateContract.Merge(m, src) } + func (m *MsgStoreAndMigrateContract) XXX_Size() int { return m.Size() } + func (m *MsgStoreAndMigrateContract) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreAndMigrateContract.DiscardUnknown(m) } @@ -1393,11 +1591,13 @@ 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{31} + return fileDescriptor_4f74d82755520264, []int{32} } + func (m *MsgStoreAndMigrateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } + func (m *MsgStoreAndMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MsgStoreAndMigrateContractResponse.Marshal(b, m, deterministic) @@ -1410,18 +1610,110 @@ func (m *MsgStoreAndMigrateContractResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } + func (m *MsgStoreAndMigrateContractResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_MsgStoreAndMigrateContractResponse.Merge(m, src) } + func (m *MsgStoreAndMigrateContractResponse) XXX_Size() int { return m.Size() } + func (m *MsgStoreAndMigrateContractResponse) XXX_DiscardUnknown() { xxx_messageInfo_MsgStoreAndMigrateContractResponse.DiscardUnknown(m) } var xxx_messageInfo_MsgStoreAndMigrateContractResponse proto.InternalMessageInfo +// MsgUpdateContractLabel sets a new label for a smart contract +type MsgUpdateContractLabel struct { + // Sender is the that actor that signed the messages + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // NewLabel string to be set + NewLabel string `protobuf:"bytes,2,opt,name=new_label,json=newLabel,proto3" json:"new_label,omitempty"` + // Contract is the address of the smart contract + Contract string `protobuf:"bytes,3,opt,name=contract,proto3" json:"contract,omitempty"` +} + +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} +} + +func (m *MsgUpdateContractLabel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *MsgUpdateContractLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateContractLabel.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 *MsgUpdateContractLabel) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateContractLabel.Merge(m, src) +} + +func (m *MsgUpdateContractLabel) XXX_Size() int { + return m.Size() +} + +func (m *MsgUpdateContractLabel) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateContractLabel.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateContractLabel proto.InternalMessageInfo + +// MsgUpdateContractLabelResponse returns empty data +type MsgUpdateContractLabelResponse struct{} + +func (m *MsgUpdateContractLabelResponse) Reset() { *m = MsgUpdateContractLabelResponse{} } +func (m *MsgUpdateContractLabelResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateContractLabelResponse) ProtoMessage() {} +func (*MsgUpdateContractLabelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4f74d82755520264, []int{34} +} + +func (m *MsgUpdateContractLabelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} + +func (m *MsgUpdateContractLabelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateContractLabelResponse.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 *MsgUpdateContractLabelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateContractLabelResponse.Merge(m, src) +} + +func (m *MsgUpdateContractLabelResponse) XXX_Size() int { + return m.Size() +} + +func (m *MsgUpdateContractLabelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateContractLabelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateContractLabelResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgStoreCode)(nil), "cosmwasm.wasm.v1.MsgStoreCode") proto.RegisterType((*MsgStoreCodeResponse)(nil), "cosmwasm.wasm.v1.MsgStoreCodeResponse") @@ -1437,6 +1729,7 @@ 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") @@ -1455,120 +1748,129 @@ func init() { proto.RegisterType((*MsgRemoveCodeUploadParamsAddressesResponse)(nil), "cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse") proto.RegisterType((*MsgStoreAndMigrateContract)(nil), "cosmwasm.wasm.v1.MsgStoreAndMigrateContract") proto.RegisterType((*MsgStoreAndMigrateContractResponse)(nil), "cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse") + proto.RegisterType((*MsgUpdateContractLabel)(nil), "cosmwasm.wasm.v1.MsgUpdateContractLabel") + proto.RegisterType((*MsgUpdateContractLabelResponse)(nil), "cosmwasm.wasm.v1.MsgUpdateContractLabelResponse") } func init() { proto.RegisterFile("cosmwasm/wasm/v1/tx.proto", fileDescriptor_4f74d82755520264) } var fileDescriptor_4f74d82755520264 = []byte{ - // 1644 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0xcb, 0x6f, 0x1b, 0x55, - 0x17, 0xcf, 0xc4, 0x8e, 0x1f, 0x27, 0x6e, 0x9b, 0x4e, 0xdd, 0xc4, 0x99, 0xb6, 0x76, 0x3a, 0x7d, - 0xc4, 0xcd, 0x97, 0xda, 0x8d, 0xbf, 0x7e, 0xfd, 0xa8, 0x61, 0x13, 0xa7, 0x48, 0xa4, 0x92, 0x21, - 0x9a, 0x28, 0xad, 0x40, 0x95, 0xac, 0xb1, 0xe7, 0x66, 0x32, 0xaa, 0x67, 0xc6, 0xf8, 0x8e, 0xf3, - 0x58, 0xb0, 0x01, 0x09, 0x09, 0xc4, 0x82, 0x0d, 0x7f, 0x02, 0x12, 0xb0, 0xa1, 0x0b, 0x16, 0x2c, - 0xbb, 0x42, 0x95, 0x60, 0x51, 0xb1, 0x42, 0x42, 0x18, 0x48, 0x91, 0xca, 0x0e, 0xa9, 0x4b, 0x56, - 0x68, 0xee, 0x9d, 0x19, 0x8f, 0xc7, 0x33, 0x63, 0x27, 0x69, 0x05, 0x12, 0x1b, 0x7b, 0xee, 0xbd, - 0xe7, 0x9c, 0x7b, 0x7e, 0xe7, 0x75, 0xcf, 0x9d, 0x81, 0xd9, 0x86, 0x8e, 0xd5, 0x1d, 0x11, 0xab, - 0x45, 0xf2, 0xb3, 0xbd, 0x54, 0x34, 0x76, 0x0b, 0xad, 0xb6, 0x6e, 0xe8, 0xec, 0x94, 0xbd, 0x54, - 0x20, 0x3f, 0xdb, 0x4b, 0x5c, 0xd6, 0x9c, 0xd1, 0x71, 0xb1, 0x2e, 0x62, 0x54, 0xdc, 0x5e, 0xaa, - 0x23, 0x43, 0x5c, 0x2a, 0x36, 0x74, 0x45, 0xa3, 0x1c, 0xdc, 0x8c, 0xb5, 0xae, 0x62, 0xd9, 0x94, - 0xa4, 0x62, 0xd9, 0x5a, 0x48, 0xcb, 0xba, 0xac, 0x93, 0xc7, 0xa2, 0xf9, 0x64, 0xcd, 0x9e, 0x1d, - 0xdc, 0x7b, 0xaf, 0x85, 0xb0, 0xb5, 0x3a, 0x4b, 0x85, 0xd5, 0x28, 0x1b, 0x1d, 0x58, 0x4b, 0x27, - 0x45, 0x55, 0xd1, 0xf4, 0x22, 0xf9, 0xa5, 0x53, 0xfc, 0x6f, 0x0c, 0xa4, 0xaa, 0x58, 0x5e, 0x37, - 0xf4, 0x36, 0x5a, 0xd1, 0x25, 0xc4, 0x4e, 0x43, 0x0c, 0x23, 0x4d, 0x42, 0xed, 0x0c, 0x33, 0xc7, - 0xe4, 0x93, 0x82, 0x35, 0x62, 0x6f, 0xc0, 0x71, 0x73, 0xb7, 0x5a, 0x7d, 0xcf, 0x40, 0xb5, 0x86, - 0x2e, 0xa1, 0xcc, 0xf8, 0x1c, 0x93, 0x4f, 0x55, 0xa6, 0xf6, 0xbb, 0xb9, 0xd4, 0xdd, 0xe5, 0xf5, - 0x6a, 0x65, 0xcf, 0x20, 0x12, 0x84, 0x94, 0x49, 0x67, 0x8f, 0xd8, 0x0d, 0x98, 0x56, 0x34, 0x6c, - 0x88, 0x9a, 0xa1, 0x88, 0x06, 0xaa, 0xb5, 0x50, 0x5b, 0x55, 0x30, 0x56, 0x74, 0x2d, 0x33, 0x31, - 0xc7, 0xe4, 0x27, 0x4b, 0xd9, 0x82, 0xd7, 0x5c, 0x85, 0xe5, 0x46, 0x03, 0x61, 0xbc, 0xa2, 0x6b, - 0x9b, 0x8a, 0x2c, 0x9c, 0x76, 0x71, 0xaf, 0x39, 0xcc, 0xe5, 0xf3, 0xef, 0x3e, 0x7d, 0xb0, 0x60, - 0xe9, 0xf6, 0xe1, 0xd3, 0x07, 0x0b, 0x27, 0x89, 0x29, 0xdc, 0x48, 0x6e, 0x47, 0x13, 0x91, 0xa9, - 0xe8, 0xed, 0x68, 0x22, 0x3a, 0x35, 0xc1, 0xdf, 0x85, 0xb4, 0x7b, 0x4d, 0x40, 0xb8, 0xa5, 0x6b, - 0x18, 0xb1, 0x17, 0x20, 0x6e, 0x62, 0xa9, 0x29, 0x12, 0x81, 0x1b, 0xad, 0xc0, 0x7e, 0x37, 0x17, - 0x33, 0x49, 0x56, 0x6f, 0x09, 0x31, 0x73, 0x69, 0x55, 0x62, 0x39, 0x48, 0x34, 0xb6, 0x50, 0xe3, - 0x3e, 0xee, 0xa8, 0x14, 0xb4, 0xe0, 0x8c, 0xf9, 0x87, 0xe3, 0x30, 0x5d, 0xc5, 0xf2, 0x6a, 0x4f, - 0xc9, 0x15, 0x5d, 0x33, 0xda, 0x62, 0xc3, 0x08, 0xb4, 0x64, 0x1a, 0x26, 0x44, 0x49, 0x55, 0x34, - 0x22, 0x2b, 0x29, 0xd0, 0x81, 0x5b, 0x93, 0x48, 0xa0, 0x26, 0x69, 0x98, 0x68, 0x8a, 0x75, 0xd4, - 0xcc, 0x44, 0x29, 0x2b, 0x19, 0xb0, 0x79, 0x88, 0xa8, 0x58, 0x26, 0xf6, 0x4c, 0x55, 0xa6, 0xff, - 0xec, 0xe6, 0x58, 0x41, 0xdc, 0xb1, 0xd5, 0xa8, 0x22, 0x8c, 0x45, 0x19, 0x09, 0x26, 0x09, 0xbb, - 0x09, 0x13, 0x9b, 0x1d, 0x4d, 0xc2, 0x99, 0xd8, 0x5c, 0x24, 0x3f, 0x59, 0x9a, 0x2d, 0x58, 0xe1, - 0x61, 0x06, 0x66, 0xc1, 0x0a, 0xcc, 0xc2, 0x8a, 0xae, 0x68, 0x95, 0xff, 0x3d, 0xea, 0xe6, 0xc6, - 0xbe, 0xf8, 0x39, 0x97, 0x97, 0x15, 0x63, 0xab, 0x53, 0x2f, 0x34, 0x74, 0xd5, 0x8a, 0x25, 0xeb, - 0xef, 0x2a, 0x96, 0xee, 0x5b, 0x71, 0x67, 0x32, 0xe0, 0xcf, 0x9e, 0x3e, 0x58, 0x60, 0x04, 0x2a, - 0xbe, 0xfc, 0x1f, 0x8f, 0x77, 0xce, 0xd8, 0xde, 0xf1, 0xb1, 0x13, 0xff, 0x3a, 0x64, 0xfd, 0x57, - 0x1c, 0x2f, 0x65, 0x20, 0x2e, 0x4a, 0x52, 0x1b, 0x61, 0x6c, 0x99, 0xd2, 0x1e, 0xb2, 0x2c, 0x44, - 0x25, 0xd1, 0x10, 0x2d, 0xb7, 0x90, 0x67, 0xfe, 0x8f, 0x71, 0x98, 0xf1, 0x17, 0x58, 0xfa, 0x17, - 0xfb, 0xc4, 0x34, 0x15, 0x16, 0x9b, 0x46, 0x26, 0x4e, 0x4d, 0x65, 0x3e, 0xb3, 0x33, 0x10, 0xdf, - 0x54, 0x76, 0x6b, 0xa6, 0xa6, 0x89, 0x39, 0x26, 0x9f, 0x10, 0x62, 0x9b, 0xca, 0x6e, 0x15, 0xcb, - 0xe5, 0x45, 0x8f, 0x03, 0xcf, 0x86, 0x38, 0xb0, 0xc4, 0xbf, 0x01, 0xb9, 0x80, 0xa5, 0x43, 0xba, - 0xf0, 0xbd, 0x71, 0x60, 0xab, 0x58, 0x7e, 0x75, 0x17, 0x35, 0x3a, 0x23, 0x64, 0x94, 0x99, 0xa0, - 0x16, 0x8d, 0xe5, 0x40, 0x67, 0x6c, 0x3b, 0x22, 0x72, 0x00, 0x47, 0x4c, 0xbc, 0xd8, 0xe4, 0x98, - 0xf7, 0xd8, 0x76, 0xc6, 0xb6, 0xad, 0x07, 0x2e, 0x7f, 0x0d, 0xb8, 0xc1, 0x59, 0xc7, 0xa2, 0xb6, - 0xdd, 0x18, 0x97, 0xdd, 0x1e, 0x32, 0xc4, 0x6e, 0x55, 0x45, 0x6e, 0x8b, 0x47, 0xb4, 0xdb, 0x48, - 0xb1, 0x6f, 0x19, 0x37, 0x3a, 0xd4, 0xb8, 0xc1, 0xa0, 0x3d, 0xba, 0x5a, 0xa0, 0x3d, 0xb3, 0xa1, - 0xa0, 0xdf, 0x67, 0xe0, 0x78, 0x15, 0xcb, 0x1b, 0x2d, 0x49, 0x34, 0xd0, 0x32, 0x49, 0xdc, 0x20, - 0xc0, 0x67, 0x20, 0xa9, 0xa1, 0x9d, 0x9a, 0x3b, 0xd5, 0x13, 0x1a, 0xda, 0xa1, 0x4c, 0x6e, 0x6b, - 0x44, 0xfa, 0xad, 0x51, 0xbe, 0xe0, 0x51, 0xff, 0x94, 0xad, 0xbe, 0x6b, 0x57, 0x3e, 0x43, 0x8e, - 0x02, 0xd7, 0x8c, 0xad, 0x36, 0x2f, 0xc3, 0xb1, 0x2a, 0x96, 0x57, 0x9a, 0x48, 0x6c, 0x87, 0x2b, - 0x18, 0xa6, 0x03, 0xef, 0xd1, 0x81, 0xb5, 0x75, 0xe8, 0xc9, 0xe5, 0x67, 0xe0, 0x74, 0xdf, 0x84, - 0xa3, 0xc1, 0xef, 0x0c, 0xb1, 0x2b, 0x55, 0xae, 0x3f, 0x53, 0x37, 0x15, 0x39, 0x50, 0x1f, 0x57, - 0x14, 0x8c, 0x07, 0x46, 0xc1, 0x3d, 0xe0, 0x4c, 0xab, 0x06, 0x1c, 0xf3, 0x91, 0x91, 0x8e, 0xf9, - 0x8c, 0x86, 0x76, 0x56, 0x7d, 0x4f, 0xfa, 0xa2, 0x07, 0x76, 0xae, 0xdf, 0xf4, 0x03, 0x58, 0xf8, - 0x8b, 0xc0, 0x07, 0xaf, 0x3a, 0x06, 0xf9, 0x92, 0x81, 0x13, 0x0e, 0xd9, 0x9a, 0xd8, 0x16, 0x55, - 0xcc, 0xde, 0x80, 0xa4, 0xd8, 0x31, 0xb6, 0xf4, 0xb6, 0x62, 0xec, 0x51, 0x43, 0x54, 0x32, 0xdf, - 0x7f, 0x75, 0x35, 0x6d, 0x15, 0x82, 0x65, 0x5a, 0xb1, 0xd6, 0x8d, 0xb6, 0xa2, 0xc9, 0x42, 0x8f, - 0x94, 0x7d, 0x19, 0x62, 0x2d, 0x22, 0x81, 0x18, 0x69, 0xb2, 0x94, 0x19, 0x04, 0x4b, 0x77, 0xa8, - 0x24, 0xcd, 0xca, 0x41, 0xab, 0x81, 0xc5, 0x42, 0x33, 0xa3, 0x27, 0xcc, 0x84, 0x98, 0xee, 0x87, - 0x48, 0x79, 0xf9, 0x59, 0x72, 0xac, 0xb9, 0xa7, 0x1c, 0x30, 0x5f, 0x53, 0x30, 0xeb, 0x1d, 0x49, - 0x77, 0x92, 0xfe, 0xb0, 0x60, 0x9e, 0x4b, 0x31, 0x0d, 0x45, 0xe5, 0x56, 0x93, 0xbf, 0x4a, 0x50, - 0xb9, 0xa7, 0x42, 0x93, 0xfd, 0x53, 0x06, 0x26, 0xab, 0x58, 0x5e, 0x53, 0x34, 0x33, 0x08, 0x0f, - 0xef, 0xb2, 0x9b, 0x26, 0x4a, 0x12, 0xd8, 0xa6, 0xd3, 0x22, 0xf9, 0x68, 0x25, 0xbb, 0xdf, 0xcd, - 0xc5, 0x69, 0x64, 0xe3, 0x67, 0xdd, 0xdc, 0x89, 0x3d, 0x51, 0x6d, 0x96, 0x79, 0x9b, 0x88, 0x17, - 0xe2, 0x34, 0xda, 0x31, 0xad, 0x05, 0xfd, 0xd0, 0xa6, 0x6c, 0x68, 0xb6, 0x5e, 0xfc, 0x69, 0x38, - 0xe5, 0x1a, 0x3a, 0x8e, 0xfa, 0x9c, 0x21, 0x95, 0x60, 0x43, 0x6b, 0xfd, 0x8d, 0x00, 0x2e, 0x0d, - 0x02, 0x70, 0x6a, 0x49, 0x4f, 0x33, 0xab, 0x96, 0xf4, 0x26, 0x1c, 0x10, 0xdf, 0x46, 0x49, 0xc7, - 0x46, 0xba, 0xe9, 0x65, 0x4d, 0xf2, 0xeb, 0x7d, 0x0f, 0x8b, 0x6a, 0xf0, 0x96, 0x11, 0x39, 0xe2, - 0x2d, 0x23, 0x7a, 0x84, 0x5b, 0x06, 0x7b, 0x0e, 0xa0, 0x63, 0xe2, 0xa7, 0xaa, 0x4c, 0x90, 0x16, - 0x29, 0xd9, 0xb1, 0x2d, 0xd2, 0xeb, 0x1a, 0x63, 0xee, 0xae, 0xd1, 0x69, 0x08, 0xe3, 0x3e, 0x0d, - 0x61, 0xe2, 0x00, 0x7d, 0x48, 0xf2, 0xc5, 0x36, 0x84, 0x66, 0xcd, 0xd7, 0x3b, 0xed, 0x06, 0xca, - 0x80, 0x55, 0xf3, 0xc9, 0xc8, 0x6c, 0xd5, 0xea, 0x1d, 0xa5, 0x69, 0x1e, 0x06, 0x93, 0xb4, 0x55, - 0xb3, 0x86, 0xe6, 0xf1, 0x49, 0xc2, 0x69, 0x4b, 0xc4, 0x5b, 0x99, 0x94, 0x75, 0x13, 0xd2, 0x25, - 0xf4, 0x9a, 0x88, 0xb7, 0xca, 0x37, 0x06, 0xa3, 0xea, 0x42, 0xdf, 0xa5, 0xcc, 0x3f, 0x54, 0xf8, - 0x3b, 0x70, 0x39, 0x9c, 0xe2, 0x90, 0x3d, 0xe4, 0x37, 0x0c, 0xe9, 0x4a, 0x97, 0x25, 0xc9, 0xf4, - 0xd5, 0x46, 0xab, 0xa9, 0x8b, 0x12, 0x2d, 0x9b, 0x56, 0xf4, 0x1d, 0x21, 0xf9, 0x4a, 0x90, 0x14, - 0x6d, 0x21, 0x24, 0xfb, 0x92, 0x95, 0xf4, 0xb3, 0x6e, 0x6e, 0x8a, 0xa6, 0x9c, 0xb3, 0xc4, 0x0b, - 0x3d, 0xb2, 0xf2, 0xff, 0x07, 0xed, 0x73, 0xd1, 0xb6, 0x4f, 0x98, 0x92, 0xfc, 0x15, 0x98, 0x1f, - 0x42, 0xe2, 0x64, 0xe6, 0x77, 0x0c, 0x39, 0xfb, 0x04, 0xa4, 0xea, 0xdb, 0xe8, 0x9f, 0x01, 0xbb, - 0x3c, 0x08, 0x7b, 0xde, 0x86, 0x3d, 0x44, 0x4f, 0x7e, 0x11, 0x16, 0x86, 0x53, 0x39, 0xe0, 0x7f, - 0x1a, 0x27, 0x2d, 0x8e, 0x1d, 0x49, 0xde, 0x26, 0xf8, 0xf9, 0x95, 0xa4, 0xa3, 0xbe, 0xf8, 0x88, - 0x1c, 0xa5, 0x24, 0xb9, 0x8f, 0xe7, 0xa8, 0xff, 0xf1, 0x3c, 0xfc, 0xd2, 0x59, 0x2e, 0x0d, 0x7a, - 0x25, 0xe7, 0x4d, 0x56, 0x6f, 0x67, 0xbe, 0x47, 0x62, 0x2b, 0x60, 0xf5, 0xb9, 0xbd, 0x51, 0x71, - 0x72, 0x39, 0xd2, 0xcb, 0xe5, 0xd2, 0x8f, 0xc7, 0x20, 0x52, 0xc5, 0x32, 0xbb, 0x0e, 0xc9, 0xde, - 0x9b, 0x2a, 0x1f, 0x03, 0xba, 0xdf, 0xf1, 0x70, 0x97, 0xc3, 0xd7, 0x1d, 0x8d, 0xdf, 0x86, 0x53, - 0x7e, 0x47, 0x58, 0xde, 0x97, 0xdd, 0x87, 0x92, 0xbb, 0x36, 0x2a, 0xa5, 0xb3, 0xa5, 0x01, 0x69, - 0xdf, 0xd7, 0x13, 0x57, 0x46, 0x95, 0x54, 0xe2, 0x96, 0x46, 0x26, 0x75, 0x76, 0x45, 0x70, 0xc2, - 0x7b, 0xa3, 0xbe, 0xe8, 0x2b, 0xc5, 0x43, 0xc5, 0x2d, 0x8e, 0x42, 0xe5, 0xde, 0xc6, 0x9b, 0x7b, - 0xfe, 0xdb, 0x78, 0xa8, 0x02, 0xb6, 0x09, 0x0a, 0xb4, 0x37, 0x61, 0xd2, 0x7d, 0xe5, 0x9b, 0xf3, - 0x65, 0x76, 0x51, 0x70, 0xf9, 0x61, 0x14, 0x8e, 0xe8, 0x3b, 0x00, 0xae, 0xbb, 0x5a, 0xce, 0x97, - 0xaf, 0x47, 0xc0, 0xcd, 0x0f, 0x21, 0x70, 0xe4, 0xbe, 0x03, 0x33, 0x41, 0x17, 0xb0, 0xc5, 0x10, - 0xe5, 0x06, 0xa8, 0xb9, 0xeb, 0x07, 0xa1, 0x76, 0xb6, 0xbf, 0x07, 0xa9, 0xbe, 0xeb, 0xce, 0xf9, - 0x10, 0x29, 0x94, 0x84, 0xbb, 0x32, 0x94, 0xc4, 0x2d, 0xbd, 0xef, 0xfe, 0xe1, 0x2f, 0xdd, 0x4d, - 0x12, 0x20, 0xdd, 0xf7, 0x2e, 0xb0, 0x06, 0x09, 0xa7, 0xe7, 0x3f, 0xe7, 0xcb, 0x66, 0x2f, 0x73, - 0x97, 0x42, 0x97, 0xdd, 0x4e, 0x76, 0xb5, 0xe1, 0xfe, 0x4e, 0xee, 0x11, 0x04, 0x38, 0x79, 0xb0, - 0x3b, 0x66, 0x3f, 0x60, 0xe0, 0x4c, 0x58, 0x6b, 0x7c, 0x2d, 0xb8, 0x2c, 0xf9, 0x73, 0x70, 0x2f, - 0x1d, 0x94, 0xc3, 0xd1, 0xe5, 0x13, 0x06, 0x72, 0xc3, 0x9a, 0x01, 0xff, 0x58, 0x1a, 0xc2, 0xc5, - 0xbd, 0x72, 0x18, 0x2e, 0x47, 0xaf, 0x8f, 0x18, 0x38, 0x1b, 0xda, 0x98, 0xf9, 0x57, 0xb7, 0x30, - 0x16, 0xee, 0xe6, 0x81, 0x59, 0xdc, 0x79, 0x19, 0xd4, 0x35, 0x2c, 0x86, 0xda, 0xde, 0x5b, 0xc1, - 0xae, 0x1f, 0x84, 0xda, 0xde, 0xbe, 0x72, 0xeb, 0xd1, 0xaf, 0xd9, 0xb1, 0x47, 0xfb, 0x59, 0xe6, - 0xf1, 0x7e, 0x96, 0xf9, 0x65, 0x3f, 0xcb, 0x7c, 0xfc, 0x24, 0x3b, 0xf6, 0xf8, 0x49, 0x76, 0xec, - 0x87, 0x27, 0xd9, 0xb1, 0xb7, 0x2e, 0xbb, 0x9a, 0xfb, 0x15, 0x1d, 0xab, 0x77, 0xed, 0x0f, 0x3f, - 0x52, 0x71, 0x97, 0x7e, 0x00, 0x22, 0x0d, 0x7e, 0x3d, 0x46, 0x3e, 0xe8, 0xfc, 0xf7, 0xaf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xdf, 0x59, 0x6a, 0x1b, 0x9a, 0x1a, 0x00, 0x00, + // 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, 0x00, 0xd3, 0x9a, 0x81, 0x2c, 0xd9, 0xb0, + 0x34, 0xd9, 0x82, 0xd5, 0x26, 0x6c, 0xe9, 0x1a, 0x42, 0x9a, 0x69, 0xa4, 0xc6, 0xb2, 0x5c, 0x6e, + 0xa2, 0x98, 0xce, 0xfb, 0xd5, 0x95, 0x5f, 0xae, 0xd7, 0x21, 0x42, 0x2b, 0xa6, 0xb1, 0xa9, 0xa9, + 0xd2, 0x29, 0x0a, 0x7b, 0xcd, 0x43, 0x2e, 0x9d, 0x7b, 0xeb, 0xf1, 0xbd, 0x79, 0x87, 0xb7, 0xf7, + 0x1e, 0xdf, 0x9b, 0x3f, 0x81, 0x55, 0x41, 0x4b, 0x72, 0x33, 0x1a, 0x8f, 0x4c, 0x45, 0x6f, 0x46, + 0xe3, 0xd1, 0xa9, 0x31, 0xf1, 0x36, 0x48, 0xd2, 0x67, 0x12, 0x44, 0x4d, 0xd3, 0x40, 0x90, 0x3f, + 0x0f, 0xc6, 0x6d, 0x59, 0xaa, 0x9a, 0x82, 0xc5, 0x8d, 0x96, 0xc1, 0x7e, 0x27, 0x13, 0xb3, 0x41, + 0x56, 0x6f, 0x48, 0x31, 0xfb, 0x68, 0x55, 0xe1, 0x05, 0x10, 0xaf, 0x6f, 0xc1, 0xfa, 0x5d, 0xd4, + 0xd6, 0x89, 0xd0, 0x92, 0xb7, 0x16, 0xef, 0x8f, 0x82, 0xe9, 0x0a, 0x52, 0x57, 0xbb, 0x4c, 0xae, + 0x98, 0x86, 0xd5, 0x92, 0xeb, 0x56, 0xa0, 0x26, 0x93, 0x60, 0x4c, 0x56, 0x74, 0xcd, 0xc0, 0xb4, + 0x12, 0x12, 0x59, 0xd0, 0x9c, 0x44, 0x02, 0x39, 0x49, 0x82, 0xb1, 0x86, 0x5c, 0x83, 0x8d, 0x54, + 0x94, 0xa0, 0xe2, 0x05, 0x9f, 0x03, 0x11, 0x1d, 0xa9, 0x58, 0x9f, 0x93, 0xe5, 0xe9, 0x3f, 0x3a, + 0x19, 0x5e, 0x92, 0x77, 0x5c, 0x36, 0x2a, 0x10, 0x21, 0x59, 0x85, 0x92, 0x0d, 0xc2, 0x6f, 0x82, + 0xb1, 0xcd, 0xb6, 0xa1, 0xa0, 0x54, 0x2c, 0x1b, 0xc9, 0x4d, 0x14, 0x67, 0xf3, 0x8e, 0x7b, 0xd8, + 0x8e, 0x99, 0x77, 0x1c, 0x33, 0xbf, 0x62, 0x6a, 0x46, 0xf9, 0xbf, 0x0f, 0x3a, 0x99, 0x91, 0xcf, + 0x7e, 0xca, 0xe4, 0x54, 0xcd, 0xda, 0x6a, 0xd7, 0xf2, 0x75, 0x53, 0x77, 0x7c, 0xc9, 0xf9, 0x77, + 0x05, 0x29, 0x77, 0x1d, 0xbf, 0xb3, 0x11, 0xd0, 0x27, 0x8f, 0xef, 0xcd, 0x73, 0x12, 0x21, 0x5f, + 0xfa, 0xb7, 0xcf, 0x3a, 0xa7, 0x5d, 0xeb, 0x30, 0xf4, 0x24, 0xbe, 0x0c, 0xd2, 0xec, 0x13, 0xcf, + 0x4a, 0x29, 0x30, 0x2e, 0x2b, 0x4a, 0x0b, 0x22, 0xe4, 0xa8, 0xd2, 0x5d, 0xf2, 0x3c, 0x88, 0x2a, + 0xb2, 0x25, 0x3b, 0x66, 0xc1, 0xdf, 0xe2, 0xef, 0xa3, 0x60, 0x86, 0x4d, 0xb0, 0xf8, 0x0f, 0xb6, + 0x89, 0xad, 0x2a, 0x24, 0x37, 0xac, 0xd4, 0x38, 0x51, 0x95, 0xfd, 0xcd, 0xcf, 0x80, 0xf1, 0x4d, + 0x6d, 0xb7, 0x6a, 0x73, 0x1a, 0xcf, 0x72, 0xb9, 0xb8, 0x14, 0xdb, 0xd4, 0x76, 0x2b, 0x48, 0x2d, + 0x2d, 0xf8, 0x0c, 0x78, 0x26, 0xc4, 0x80, 0x45, 0xf1, 0x15, 0x90, 0x09, 0x38, 0x3a, 0xa4, 0x09, + 0xdf, 0x1e, 0x05, 0x7c, 0x05, 0xa9, 0x2f, 0xec, 0xc2, 0x7a, 0x7b, 0x88, 0x88, 0xb2, 0x03, 0xd4, + 0x81, 0x71, 0x0c, 0xe8, 0xad, 0x5d, 0x43, 0x44, 0x0e, 0x60, 0x88, 0xb1, 0x67, 0x1b, 0x1c, 0x73, + 0x3e, 0xdd, 0xce, 0xb8, 0xba, 0xf5, 0x89, 0x2b, 0x2e, 0x02, 0xa1, 0x7f, 0xd7, 0xd3, 0xa8, 0xab, + 0x37, 0x8e, 0xd2, 0xdb, 0x7d, 0x0e, 0xeb, 0xad, 0xa2, 0xa9, 0x2d, 0xf9, 0x88, 0x7a, 0x1b, 0xca, + 0xf7, 0x1d, 0xe5, 0x46, 0x07, 0x2a, 0x37, 0x58, 0x68, 0x1f, 0xaf, 0x8e, 0xd0, 0xbe, 0xdd, 0x50, + 0xa1, 0xdf, 0xe1, 0xc0, 0xb1, 0x0a, 0x52, 0x37, 0x9a, 0x8a, 0x6c, 0xc1, 0x65, 0x1c, 0xb8, 0x41, + 0x02, 0x9f, 0x06, 0x09, 0x03, 0xee, 0x54, 0xe9, 0x50, 0x8f, 0x1b, 0x70, 0x87, 0x20, 0xd1, 0xda, + 0x88, 0xf4, 0x6a, 0xa3, 0x74, 0xde, 0xc7, 0xfe, 0x49, 0x97, 0x7d, 0xea, 0x56, 0x31, 0x85, 0x4b, + 0x01, 0xb5, 0xe3, 0xb2, 0x2d, 0xaa, 0xe0, 0x5f, 0x15, 0xa4, 0xae, 0x34, 0xa0, 0xdc, 0x0a, 0x67, + 0x30, 0x8c, 0x07, 0xd1, 0xc7, 0x03, 0xef, 0xf2, 0xd0, 0xa5, 0x2b, 0xce, 0x80, 0x53, 0x3d, 0x1b, + 0x1e, 0x07, 0x1f, 0x71, 0x80, 0xa7, 0xeb, 0x2a, 0xe1, 0x72, 0xb8, 0xfa, 0xf7, 0x7a, 0x60, 0x09, + 0x1f, 0x1d, 0xa6, 0x84, 0x97, 0x13, 0x76, 0xb8, 0x90, 0x10, 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, 0x68, 0x39, 0xbd, 0xdf, 0xc9, 0x8c, 0x13, 0xcf, 0x46, 0x4f, 0x3a, 0x99, 0xe3, 0x7b, + 0xb2, 0xde, 0x28, 0x89, 0x2e, 0x90, 0x28, 0x8d, 0x13, 0x6f, 0x47, 0x24, 0x53, 0xf5, 0x8a, 0x36, + 0xe5, 0x8a, 0xe6, 0xf2, 0x25, 0x9e, 0x02, 0x27, 0xa9, 0xa5, 0x67, 0xa8, 0x4f, 0x39, 0x9c, 0xa7, + 0x36, 0x8c, 0xe6, 0x5f, 0x28, 0xc0, 0xc5, 0x7e, 0x01, 0xbc, 0x4c, 0xd7, 0xe5, 0xcc, 0xc9, 0x74, + 0xdd, 0x0d, 0x4f, 0x88, 0x6f, 0xa2, 0xb8, 0x9f, 0xc4, 0xbd, 0xfe, 0xb2, 0xa1, 0xb0, 0x3a, 0xf3, + 0xc3, 0x4a, 0xd5, 0x3f, 0x03, 0x45, 0x8e, 0x38, 0x03, 0x45, 0x8f, 0x30, 0x03, 0xf1, 0x67, 0x01, + 0x68, 0xdb, 0xf2, 0x13, 0x56, 0xc6, 0x70, 0x03, 0x97, 0x68, 0xbb, 0x1a, 0xe9, 0xf6, 0xb4, 0x31, + 0xba, 0xa7, 0xf5, 0xda, 0xd5, 0x71, 0x46, 0xbb, 0x1a, 0x3f, 0x40, 0x97, 0x94, 0x78, 0xb6, 0xed, + 0xaa, 0x9d, 0xf3, 0xcd, 0x76, 0xab, 0x0e, 0x53, 0xc0, 0xc9, 0xf9, 0x78, 0x65, 0x37, 0x92, 0xb5, + 0xb6, 0xd6, 0xb0, 0x8b, 0xc1, 0x04, 0x69, 0x24, 0x9d, 0xa5, 0x5d, 0xdc, 0xb1, 0x3b, 0x6d, 0xc9, + 0x68, 0x2b, 0x35, 0xe9, 0xcc, 0x69, 0xa6, 0x02, 0x5f, 0x94, 0xd1, 0x56, 0xe9, 0x5a, 0xbf, 0x57, + 0x9d, 0xef, 0x19, 0x19, 0xd9, 0xae, 0x22, 0xde, 0x02, 0x97, 0xc2, 0x21, 0x0e, 0xd9, 0xe1, 0x7e, + 0xc5, 0xe1, 0x9e, 0x79, 0x59, 0x51, 0x6c, 0x5b, 0x6d, 0x34, 0x1b, 0xa6, 0xac, 0x90, 0xb4, 0xe9, + 0x78, 0xdf, 0x11, 0x82, 0xaf, 0x08, 0x12, 0xb2, 0x4b, 0x04, 0x47, 0x5f, 0xa2, 0x9c, 0x7c, 0xd2, + 0xc9, 0x4c, 0x91, 0x90, 0xf3, 0x8e, 0x44, 0xa9, 0x0b, 0x56, 0xfa, 0x5f, 0xbf, 0x7e, 0x2e, 0xb8, + 0xfa, 0x09, 0x63, 0x52, 0xbc, 0x0c, 0xe6, 0x06, 0x80, 0x78, 0x91, 0xf9, 0x2d, 0x87, 0x6b, 0x9f, + 0x04, 0x75, 0x73, 0x1b, 0xfe, 0x3d, 0xc4, 0x2e, 0xf5, 0x8b, 0x3d, 0xe7, 0x8a, 0x3d, 0x80, 0x4f, + 0x71, 0x01, 0xcc, 0x0f, 0x86, 0xf2, 0x84, 0xff, 0x71, 0x14, 0xb7, 0x38, 0xae, 0x27, 0xf9, 0x5b, + 0xf4, 0xa7, 0x97, 0x92, 0x8e, 0xfa, 0x2c, 0x13, 0x39, 0x4a, 0x4a, 0xa2, 0xcb, 0x73, 0x94, 0x5d, + 0x9e, 0x07, 0x8f, 0xc4, 0xa5, 0x62, 0xbf, 0x55, 0x32, 0xfe, 0x60, 0xf5, 0xcf, 0x0d, 0x7b, 0xd8, + 0xb7, 0x02, 0x4e, 0x9f, 0xda, 0x7b, 0x8f, 0x17, 0xcb, 0x11, 0x2a, 0x96, 0xbf, 0xe6, 0xa8, 0xc6, + 0xdf, 0xbd, 0xf2, 0x25, 0x9c, 0x57, 0x17, 0x7b, 0x3b, 0xd7, 0x10, 0x9b, 0xfa, 0x46, 0x14, 0x92, + 0xa3, 0xbb, 0x23, 0x0a, 0x21, 0x77, 0xd5, 0x3f, 0x1e, 0x84, 0x10, 0xec, 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, } // Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn +var ( + _ context.Context + _ grpc.ClientConn +) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -1590,7 +1892,7 @@ type MsgClient interface { ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) // Migrate runs a code upgrade/ downgrade for a smart contract MigrateContract(ctx context.Context, in *MsgMigrateContract, opts ...grpc.CallOption) (*MsgMigrateContractResponse, error) - // UpdateAdmin sets a new admin for a smart contract + // UpdateAdmin sets a new admin for a smart contract UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, error) // ClearAdmin removes any admin stored for a smart contract ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...grpc.CallOption) (*MsgClearAdminResponse, error) @@ -1634,6 +1936,10 @@ type MsgClient interface { // // Since: 0.42 StoreAndMigrateContract(ctx context.Context, in *MsgStoreAndMigrateContract, opts ...grpc.CallOption) (*MsgStoreAndMigrateContractResponse, error) + // UpdateContractLabel sets a new label for a smart contract + // + // Since: 0.43 + UpdateContractLabel(ctx context.Context, in *MsgUpdateContractLabel, opts ...grpc.CallOption) (*MsgUpdateContractLabelResponse, error) } type msgClient struct { @@ -1788,6 +2094,15 @@ func (c *msgClient) StoreAndMigrateContract(ctx context.Context, in *MsgStoreAnd return out, nil } +func (c *msgClient) UpdateContractLabel(ctx context.Context, in *MsgUpdateContractLabel, opts ...grpc.CallOption) (*MsgUpdateContractLabelResponse, error) { + out := new(MsgUpdateContractLabelResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/UpdateContractLabel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // StoreCode to submit Wasm code to the system @@ -1802,7 +2117,7 @@ type MsgServer interface { ExecuteContract(context.Context, *MsgExecuteContract) (*MsgExecuteContractResponse, error) // Migrate runs a code upgrade/ downgrade for a smart contract MigrateContract(context.Context, *MsgMigrateContract) (*MsgMigrateContractResponse, error) - // UpdateAdmin sets a new admin for a smart contract + // UpdateAdmin sets a new admin for a smart contract UpdateAdmin(context.Context, *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) // ClearAdmin removes any admin stored for a smart contract ClearAdmin(context.Context, *MsgClearAdmin) (*MsgClearAdminResponse, error) @@ -1846,61 +2161,83 @@ type MsgServer interface { // // Since: 0.42 StoreAndMigrateContract(context.Context, *MsgStoreAndMigrateContract) (*MsgStoreAndMigrateContractResponse, error) + // UpdateContractLabel sets a new label for a smart contract + // + // Since: 0.43 + UpdateContractLabel(context.Context, *MsgUpdateContractLabel) (*MsgUpdateContractLabelResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +type UnimplementedMsgServer struct{} func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) (*MsgStoreCodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StoreCode not implemented") } + func (*UnimplementedMsgServer) InstantiateContract(ctx context.Context, req *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract not implemented") } + func (*UnimplementedMsgServer) InstantiateContract2(ctx context.Context, req *MsgInstantiateContract2) (*MsgInstantiateContract2Response, error) { return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract2 not implemented") } + func (*UnimplementedMsgServer) ExecuteContract(ctx context.Context, req *MsgExecuteContract) (*MsgExecuteContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteContract not implemented") } + func (*UnimplementedMsgServer) MigrateContract(ctx context.Context, req *MsgMigrateContract) (*MsgMigrateContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MigrateContract not implemented") } + func (*UnimplementedMsgServer) UpdateAdmin(ctx context.Context, req *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateAdmin not implemented") } + func (*UnimplementedMsgServer) ClearAdmin(ctx context.Context, req *MsgClearAdmin) (*MsgClearAdminResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClearAdmin not implemented") } + func (*UnimplementedMsgServer) UpdateInstantiateConfig(ctx context.Context, req *MsgUpdateInstantiateConfig) (*MsgUpdateInstantiateConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateInstantiateConfig not implemented") } + func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } + func (*UnimplementedMsgServer) SudoContract(ctx context.Context, req *MsgSudoContract) (*MsgSudoContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SudoContract not implemented") } + func (*UnimplementedMsgServer) PinCodes(ctx context.Context, req *MsgPinCodes) (*MsgPinCodesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PinCodes not implemented") } + func (*UnimplementedMsgServer) UnpinCodes(ctx context.Context, req *MsgUnpinCodes) (*MsgUnpinCodesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UnpinCodes not implemented") } + func (*UnimplementedMsgServer) StoreAndInstantiateContract(ctx context.Context, req *MsgStoreAndInstantiateContract) (*MsgStoreAndInstantiateContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StoreAndInstantiateContract not implemented") } + func (*UnimplementedMsgServer) RemoveCodeUploadParamsAddresses(ctx context.Context, req *MsgRemoveCodeUploadParamsAddresses) (*MsgRemoveCodeUploadParamsAddressesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveCodeUploadParamsAddresses not implemented") } + func (*UnimplementedMsgServer) AddCodeUploadParamsAddresses(ctx context.Context, req *MsgAddCodeUploadParamsAddresses) (*MsgAddCodeUploadParamsAddressesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddCodeUploadParamsAddresses not implemented") } + func (*UnimplementedMsgServer) StoreAndMigrateContract(ctx context.Context, req *MsgStoreAndMigrateContract) (*MsgStoreAndMigrateContractResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StoreAndMigrateContract not implemented") } +func (*UnimplementedMsgServer) UpdateContractLabel(ctx context.Context, req *MsgUpdateContractLabel) (*MsgUpdateContractLabelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateContractLabel not implemented") +} + func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } @@ -2193,6 +2530,24 @@ func _Msg_StoreAndMigrateContract_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Msg_UpdateContractLabel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateContractLabel) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateContractLabel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1.Msg/UpdateContractLabel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateContractLabel(ctx, req.(*MsgUpdateContractLabel)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmwasm.wasm.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -2261,6 +2616,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "StoreAndMigrateContract", Handler: _Msg_StoreAndMigrateContract_Handler, }, + { + MethodName: "UpdateContractLabel", + Handler: _Msg_UpdateContractLabel_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmwasm/wasm/v1/tx.proto", @@ -2867,11 +3226,49 @@ func (m *MsgClearAdminResponse) MarshalTo(dAtA []byte) (int, error) { return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgClearAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgClearAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 } @@ -3103,20 +3500,20 @@ func (m *MsgPinCodes) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.CodeIDs) > 0 { - dAtA5 := make([]byte, len(m.CodeIDs)*10) - var j4 int + dAtA6 := make([]byte, len(m.CodeIDs)*10) + var j5 int for _, num := range m.CodeIDs { for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j4++ + j5++ } - dAtA5[j4] = uint8(num) - j4++ + dAtA6[j5] = uint8(num) + j5++ } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintTx(dAtA, i, uint64(j4)) + i -= j5 + copy(dAtA[i:], dAtA6[:j5]) + i = encodeVarintTx(dAtA, i, uint64(j5)) i-- dAtA[i] = 0x12 } @@ -3174,20 +3571,20 @@ func (m *MsgUnpinCodes) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.CodeIDs) > 0 { - dAtA7 := make([]byte, len(m.CodeIDs)*10) - var j6 int + dAtA8 := make([]byte, len(m.CodeIDs)*10) + var j7 int for _, num := range m.CodeIDs { for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j6++ + j7++ } - dAtA7[j6] = uint8(num) - j6++ + dAtA8[j7] = uint8(num) + j7++ } - i -= j6 - copy(dAtA[i:], dAtA7[:j6]) - i = encodeVarintTx(dAtA, i, uint64(j6)) + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintTx(dAtA, i, uint64(j7)) i-- dAtA[i] = 0x12 } @@ -3605,6 +4002,73 @@ func (m *MsgStoreAndMigrateContractResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *MsgUpdateContractLabel) 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 *MsgUpdateContractLabel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateContractLabel) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Contract))) + i-- + dAtA[i] = 0x1a + } + if len(m.NewLabel) > 0 { + i -= len(m.NewLabel) + copy(dAtA[i:], m.NewLabel) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewLabel))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateContractLabelResponse) 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 *MsgUpdateContractLabelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateContractLabelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3616,6 +4080,7 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } + func (m *MsgStoreCode) Size() (n int) { if m == nil { return 0 @@ -3895,6 +4360,20 @@ 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 @@ -4216,12 +4695,44 @@ func (m *MsgStoreAndMigrateContractResponse) Size() (n int) { return n } +func (m *MsgUpdateContractLabel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewLabel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateContractLabelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } + func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4374,6 +4885,7 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4477,6 +4989,7 @@ func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4710,6 +5223,7 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4826,6 +5340,7 @@ func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgInstantiateContract2) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5113,6 +5628,7 @@ func (m *MsgInstantiateContract2) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgInstantiateContract2Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5229,6 +5745,7 @@ func (m *MsgInstantiateContract2Response) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5411,6 +5928,7 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgExecuteContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5495,6 +6013,7 @@ func (m *MsgExecuteContractResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5662,6 +6181,7 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5746,6 +6266,7 @@ func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5892,6 +6413,7 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateAdminResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5942,6 +6464,7 @@ func (m *MsgUpdateAdminResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6041,50 +6564,154 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + 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 *MsgClearAdminResponse) 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: MsgClearAdminResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClearAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *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 } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgClearAdminResponse) 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 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.InstantiatePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgClearAdminResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgClearAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -6106,6 +6733,7 @@ func (m *MsgClearAdminResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateInstantiateConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6243,6 +6871,7 @@ func (m *MsgUpdateInstantiateConfig) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateInstantiateConfigResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6293,6 +6922,7 @@ func (m *MsgUpdateInstantiateConfigResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6408,6 +7038,7 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6458,6 +7089,7 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgSudoContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6606,6 +7238,7 @@ func (m *MsgSudoContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgSudoContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6690,6 +7323,7 @@ func (m *MsgSudoContractResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgPinCodes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6848,6 +7482,7 @@ func (m *MsgPinCodes) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgPinCodesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6898,6 +7533,7 @@ func (m *MsgPinCodesResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUnpinCodes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7056,6 +7692,7 @@ func (m *MsgUnpinCodes) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgUnpinCodesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7106,6 +7743,7 @@ func (m *MsgUnpinCodesResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgStoreAndInstantiateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7508,6 +8146,7 @@ func (m *MsgStoreAndInstantiateContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgStoreAndInstantiateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7624,6 +8263,7 @@ func (m *MsgStoreAndInstantiateContractResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgAddCodeUploadParamsAddresses) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7738,6 +8378,7 @@ func (m *MsgAddCodeUploadParamsAddresses) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgAddCodeUploadParamsAddressesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7788,6 +8429,7 @@ func (m *MsgAddCodeUploadParamsAddressesResponse) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgRemoveCodeUploadParamsAddresses) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7902,6 +8544,7 @@ func (m *MsgRemoveCodeUploadParamsAddresses) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgRemoveCodeUploadParamsAddressesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7952,6 +8595,7 @@ func (m *MsgRemoveCodeUploadParamsAddressesResponse) Unmarshal(dAtA []byte) erro } return nil } + func (m *MsgStoreAndMigrateContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -8170,6 +8814,7 @@ func (m *MsgStoreAndMigrateContract) Unmarshal(dAtA []byte) error { } return nil } + func (m *MsgStoreAndMigrateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -8307,6 +8952,205 @@ func (m *MsgStoreAndMigrateContractResponse) Unmarshal(dAtA []byte) error { } return nil } + +func (m *MsgUpdateContractLabel) 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: MsgUpdateContractLabel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateContractLabel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewLabel = 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 ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contract = string(dAtA[iNdEx:postIndex]) + 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 *MsgUpdateContractLabelResponse) 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: MsgUpdateContractLabelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateContractLabelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/wasm/types/tx_test.go b/x/wasm/types/tx_test.go index e3ea0f610a..2e980fd795 100644 --- a/x/wasm/types/tx_test.go +++ b/x/wasm/types/tx_test.go @@ -1364,3 +1364,71 @@ func TestMsgStoreAndMigrateContractValidation(t *testing.T) { }) } } + +func TestMsgUpdateContractLabel(t *testing.T) { + // proper address size + goodAddress := sdk.AccAddress(make([]byte, 20)).String() + otherGoodAddress := sdk.AccAddress(bytes.Repeat([]byte{0x1}, 20)).String() + + specs := map[string]struct { + src MsgUpdateContractLabel + expErr bool + }{ + "all good": { + src: MsgUpdateContractLabel{ + Sender: goodAddress, + NewLabel: "new label", + Contract: otherGoodAddress, + }, + }, + "new label required": { + src: MsgUpdateContractLabel{ + Sender: goodAddress, + Contract: otherGoodAddress, + }, + expErr: true, + }, + "bad sender": { + src: MsgUpdateContractLabel{ + Sender: badAddress, + NewLabel: "new label", + Contract: otherGoodAddress, + }, + expErr: true, + }, + "empty new label": { + src: MsgUpdateContractLabel{ + Sender: goodAddress, + NewLabel: "", + Contract: otherGoodAddress, + }, + expErr: true, + }, + "bad new label": { + src: MsgUpdateContractLabel{ + Sender: goodAddress, + NewLabel: " start with space ", + Contract: otherGoodAddress, + }, + expErr: true, + }, + "bad contract addr": { + src: MsgUpdateContractLabel{ + Sender: goodAddress, + NewLabel: "new label", + Contract: badAddress, + }, + 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) + return + } + require.NoError(t, err) + }) + } +}