Containerized Protobuf generation (#304)

* Docker container based Protobuf generation and linting

* Add protobuf comments

* Update contrib/prototools-docker/Dockerfile

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update contrib/prototools-docker/Dockerfile

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/wasm/internal/types/msg.proto

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

* Update x/wasm/internal/types/types.proto

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>

Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
This commit is contained in:
Alexander Peters
2020-11-11 12:13:04 +01:00
committed by GitHub
parent 4fb3a50fa7
commit 550c6f5c4f
28 changed files with 1604 additions and 424 deletions

View File

@@ -6,6 +6,11 @@ COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
# for dockerized protobuf tools
PROTO_CONTAINER := cosmwasm/prototool-docker:latest
DOCKER_BUF := docker run --rm -v $(shell pwd)/buf.yaml:/workspace/buf.yaml -v $(shell go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk):/workspace/cosmos_sdk_dir -v $(shell pwd):/workspace/wasmd --workdir /workspace $(PROTO_CONTAINER)
HTTPS_GIT := https://github.com/CosmWasm/wasmd.git
export GO111MODULE = on
# process build tags
@@ -198,16 +203,19 @@ format:
###############################################################################
proto-all: proto-gen proto-lint proto-check-breaking
.PHONY: proto-all
proto-gen:
@./scripts/protocgen.sh
proto-gen: proto-lint
@docker run --rm -v $(shell go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk):/workspace/cosmos_sdk_dir -v $(shell pwd):/workspace --workdir /workspace --env COSMOS_SDK_DIR=/workspace/cosmos_sdk_dir $(PROTO_CONTAINER) ./scripts/protocgen.sh
.PHONY: proto-gen
proto-lint:
@buf check lint --error-format=json
@$(DOCKER_BUF) buf check lint --error-format=json
.PHONY: proto-lint
proto-check-breaking:
@buf check breaking --against-input '.git#branch=master'
@$(DOCKER_BUF) buf check breaking --against-input $(HTTPS_GIT)#branch=master
.PHONY: proto-check-breaking
.PHONY: all build-linux install install-debug \
go-mod-cache draw-deps clean build format \

View File

@@ -1,10 +1,10 @@
# Wasm Zone
[![CircleCI](https://circleci.com/gh/cosmwasm/wasmd/tree/master.svg?style=shield)](https://circleci.com/gh/cosmwasm/wasmd/tree/master)
[![CircleCI](https://circleci.com/gh/CosmWasm/wasmd/tree/master.svg?style=shield)](https://circleci.com/gh/CosmWasm/wasmd/tree/master)
[![codecov](https://codecov.io/gh/cosmwasm/wasmd/branch/master/graph/badge.svg)](https://codecov.io/gh/cosmwasm/wasmd)
[![Go Report Card](https://goreportcard.com/badge/github.com/CosmWasm/wasmd)](https://goreportcard.com/report/github.com/CosmWasm/wasmd)
[![license](https://img.shields.io/github/license/cosmwasm/wasmd.svg)](https://github.com/CosmWasm/wasmd/blob/master/LICENSE)
[![LoC](https://tokei.rs/b1/github/cosmwasm/wasmd)](https://github.com/CosmWasm/wasmd)
[![license](https://img.shields.io/github/license/CosmWasm/wasmd.svg)](https://github.com/CosmWasm/wasmd/blob/master/LICENSE)
[![LoC](https://tokei.rs/b1/github/CosmWasm/wasmd)](https://github.com/CosmWasm/wasmd)
<!-- [![GolangCI](https://golangci.com/badges/github.com/CosmWasm/wasmd.svg)](https://golangci.com/r/github.com/CosmWasm/wasmd) -->
This repository hosts `Wasmd`, the first implementation of a cosmos zone with wasm smart contracts enabled.
@@ -13,7 +13,7 @@ This code was forked from the `cosmos/gaia` repository as a basis and then we ad
many gaia-specific files. However, the `wasmd` binary should function just like `gaiad` except for the
addition of the `x/wasm` module.
**Note**: Requires [Go 1.14+](https://golang.org/dl/)
**Note**: Requires [Go 1.15+](https://golang.org/dl/)
## Supported Systems
@@ -68,24 +68,11 @@ To set up a single node testnet, [look at the deployment documentation](./docs/d
If you want to deploy a whole cluster, [look at the network scripts](./networks/README.md).
## Protobuf
1. Install [protoc](https://github.com/protocolbuffers/protobuf#protocol-compiler-installation)
2. Install [cosmos-extension](https://github.com/regen-network/cosmos-proto/) for [gogo-protobuf](https://github.com/gogo/protobuf)
```sh
go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos
```
3. Install [grpc gateway extension](github.com/grpc-ecosystem/grpc-gateway)
```go
go install \ upgrade_stargate_rebased 3a8aa77
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/golang/protobuf/protoc-gen-go
```
3. Run generator
```sh
make proto-gen
Generate protobuf
```shell script
make proto-gen
```
The generators are executed within a Docker [container](./contrib/prototools-docker), now.
## Dockerized

View File

@@ -1,6 +1,12 @@
version: v1beta1
build:
roots:
- .
# Note: these are not local path. These roots are mounted into the docker container
- wasmd/
- cosmos_sdk_dir/third_party/proto/
- cosmos_sdk_dir/proto/
excludes:
# - cosmos_sdk_dir
lint:
use:
- DEFAULT
@@ -9,11 +15,22 @@ lint:
except:
- UNARY_RPC
- COMMENT_FIELD
- SERVICE_SUFFIX
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_STANDARD_NAME
- PACKAGE_DIRECTORY_MATCH
ignore:
- third_party
- tendermint
- gogoproto
- cosmos_proto
- google
- confio
breaking:
use:
- FILE
ignore:
- third_party
- tendermint
- gogoproto
- cosmos_proto
- google
- confio

View File

@@ -0,0 +1,51 @@
FROM golang:1.15.3-alpine3.12 AS build
#ARG PROTOTOOL_VERSION=1.10.0
ARG PROTODOC_VERSION=1.3.2
ARG GRPC_GATEWAY_VERSION=1.16.0
ARG REGEN_GOGOPROTO_VERSION=0.3.0
ARG REGEN_PROTOBUF_VERSION=1.3.2-alpha.regen.4
ARG BUF_VERSION=0.30.0
RUN apk --no-cache add --update curl git libc6-compat make upx
RUN go get -d \
github.com/gogo/protobuf/gogoproto && \
mkdir -p /usr/include/google/protobuf/ && \
mv /go/src/github.com/gogo/protobuf/protobuf/google/protobuf/empty.proto /usr/include/google/protobuf/ && \
mv /go/src/github.com/gogo/protobuf/protobuf/google/protobuf/descriptor.proto /usr/include/google/protobuf/
RUN GO111MODULE=on go get \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} && \
mv /go/bin/protoc-gen-grpc-gateway /usr/local/bin/ && \
mv /go/bin/protoc-gen-swagger /usr/local/bin/
# Install regen fork of gogo proto
# To install a fix version this can only be done via this go.mod workaround
WORKDIR /work
RUN GO111MODULE=on go mod init foobar && \
go mod edit -replace github.com/gogo/protobuf=github.com/regen-network/protobuf@v${REGEN_PROTOBUF_VERSION} && \
go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@v${REGEN_GOGOPROTO_VERSION} && \
mv /go/bin/protoc-gen-gocosmos* /usr/local/bin/
RUN GO111MODULE=on go get \
github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v${PROTODOC_VERSION} && \
mv /go/bin/protoc-gen-doc /usr/local/bin/
RUN GO111MODULE=on go get \
github.com/bufbuild/buf/cmd/buf@v${BUF_VERSION} && \
mv /go/bin/buf /usr/local/bin/
RUN upx --lzma /usr/local/bin/*
FROM golang:1.15.3-alpine3.12
ENV LD_LIBRARY_PATH=/lib64:/lib
WORKDIR /work
RUN apk --no-cache add --update curl git libc6-compat make
RUN apk --no-cache add --update ca-certificates libc6-compat protoc
COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /usr/include /usr/include
RUN chmod -R 755 /usr/include

View File

@@ -0,0 +1,21 @@
Prototool Docker Helper
=======================
Docker container for all the protobuf generation...
Based on the work by @pseudomuto [prototool-docker](https://github.com/charithe/prototool-docker) project:
Installs generators and tools from:
* https://github.com/bufbuild/buf
* https://github.com/grpc-ecosystem
* https://github.com/regen-network/cosmos-proto
* https://github.com/pseudomuto/protoc-gen-doc
### Build
```shell script
docker build -t cosmwasm/prototools-docker -f ./contrib/prototools-docker/Dockerfile .
```
```shell script
docker run -it -v $(go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk):/workspace/cosmos_sdk_dir -v $(pwd):/workspace --workdir /workspace --env COSMOS_SDK_DIR=/cosmos_sdk_dir cosmwasm/prototool-docker sh
```

3
doc/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Generated doc
Tutorials and project doc is available on https://docs.cosmwasm.com/

899
doc/proto.md Normal file
View File

@@ -0,0 +1,899 @@
# Protocol Documentation
<a name="top"></a>
## Table of Contents
- [x/wasm/internal/types/genesis.proto](#x/wasm/internal/types/genesis.proto)
- [Code](#wasmd.x.wasmd.v1beta1.Code)
- [Contract](#wasmd.x.wasmd.v1beta1.Contract)
- [GenesisState](#wasmd.x.wasmd.v1beta1.GenesisState)
- [Sequence](#wasmd.x.wasmd.v1beta1.Sequence)
- [x/wasm/internal/types/msg.proto](#x/wasm/internal/types/msg.proto)
- [MsgClearAdmin](#wasmd.x.wasmd.v1beta1.MsgClearAdmin)
- [MsgExecuteContract](#wasmd.x.wasmd.v1beta1.MsgExecuteContract)
- [MsgInstantiateContract](#wasmd.x.wasmd.v1beta1.MsgInstantiateContract)
- [MsgMigrateContract](#wasmd.x.wasmd.v1beta1.MsgMigrateContract)
- [MsgStoreCode](#wasmd.x.wasmd.v1beta1.MsgStoreCode)
- [MsgUpdateAdmin](#wasmd.x.wasmd.v1beta1.MsgUpdateAdmin)
- [x/wasm/internal/types/proposal.proto](#x/wasm/internal/types/proposal.proto)
- [ClearAdminProposal](#wasmd.x.wasmd.v1beta1.ClearAdminProposal)
- [InstantiateContractProposal](#wasmd.x.wasmd.v1beta1.InstantiateContractProposal)
- [MigrateContractProposal](#wasmd.x.wasmd.v1beta1.MigrateContractProposal)
- [StoreCodeProposal](#wasmd.x.wasmd.v1beta1.StoreCodeProposal)
- [UpdateAdminProposal](#wasmd.x.wasmd.v1beta1.UpdateAdminProposal)
- [x/wasm/internal/types/query.proto](#x/wasm/internal/types/query.proto)
- [CodeInfoResponse](#wasmd.x.wasmd.v1beta1.CodeInfoResponse)
- [ContractInfoWithAddress](#wasmd.x.wasmd.v1beta1.ContractInfoWithAddress)
- [QueryAllContractStateRequest](#wasmd.x.wasmd.v1beta1.QueryAllContractStateRequest)
- [QueryAllContractStateResponse](#wasmd.x.wasmd.v1beta1.QueryAllContractStateResponse)
- [QueryCodeRequest](#wasmd.x.wasmd.v1beta1.QueryCodeRequest)
- [QueryCodeResponse](#wasmd.x.wasmd.v1beta1.QueryCodeResponse)
- [QueryCodesResponse](#wasmd.x.wasmd.v1beta1.QueryCodesResponse)
- [QueryContractHistoryRequest](#wasmd.x.wasmd.v1beta1.QueryContractHistoryRequest)
- [QueryContractHistoryResponse](#wasmd.x.wasmd.v1beta1.QueryContractHistoryResponse)
- [QueryContractInfoRequest](#wasmd.x.wasmd.v1beta1.QueryContractInfoRequest)
- [QueryContractInfoResponse](#wasmd.x.wasmd.v1beta1.QueryContractInfoResponse)
- [QueryContractsByCodeRequest](#wasmd.x.wasmd.v1beta1.QueryContractsByCodeRequest)
- [QueryContractsByCodeResponse](#wasmd.x.wasmd.v1beta1.QueryContractsByCodeResponse)
- [QueryRawContractStateRequest](#wasmd.x.wasmd.v1beta1.QueryRawContractStateRequest)
- [QueryRawContractStateResponse](#wasmd.x.wasmd.v1beta1.QueryRawContractStateResponse)
- [QuerySmartContractStateRequest](#wasmd.x.wasmd.v1beta1.QuerySmartContractStateRequest)
- [QuerySmartContractStateResponse](#wasmd.x.wasmd.v1beta1.QuerySmartContractStateResponse)
- [Query](#wasmd.x.wasmd.v1beta1.Query)
- [x/wasm/internal/types/types.proto](#x/wasm/internal/types/types.proto)
- [AbsoluteTxPosition](#wasmd.x.wasmd.v1beta1.AbsoluteTxPosition)
- [AccessConfig](#wasmd.x.wasmd.v1beta1.AccessConfig)
- [AccessTypeParam](#wasmd.x.wasmd.v1beta1.AccessTypeParam)
- [CodeInfo](#wasmd.x.wasmd.v1beta1.CodeInfo)
- [ContractCodeHistoryEntry](#wasmd.x.wasmd.v1beta1.ContractCodeHistoryEntry)
- [ContractHistory](#wasmd.x.wasmd.v1beta1.ContractHistory)
- [ContractInfo](#wasmd.x.wasmd.v1beta1.ContractInfo)
- [Model](#wasmd.x.wasmd.v1beta1.Model)
- [Params](#wasmd.x.wasmd.v1beta1.Params)
- [AccessType](#wasmd.x.wasmd.v1beta1.AccessType)
- [ContractCodeHistoryOperationType](#wasmd.x.wasmd.v1beta1.ContractCodeHistoryOperationType)
- [Scalar Value Types](#scalar-value-types)
<a name="x/wasm/internal/types/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## x/wasm/internal/types/genesis.proto
<a name="wasmd.x.wasmd.v1beta1.Code"></a>
### Code
Code struct encompasses CodeInfo and CodeBytes
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_id | [uint64](#uint64) | | |
| code_info | [CodeInfo](#wasmd.x.wasmd.v1beta1.CodeInfo) | | |
| code_bytes | [bytes](#bytes) | | |
<a name="wasmd.x.wasmd.v1beta1.Contract"></a>
### Contract
Contract struct encompasses ContractAddress, ContractInfo, and ContractState
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| contract_address | [bytes](#bytes) | | |
| contract_info | [ContractInfo](#wasmd.x.wasmd.v1beta1.ContractInfo) | | |
| contract_state | [Model](#wasmd.x.wasmd.v1beta1.Model) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.GenesisState"></a>
### GenesisState
GenesisState - genesis state of x/wasm
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| params | [Params](#wasmd.x.wasmd.v1beta1.Params) | | |
| codes | [Code](#wasmd.x.wasmd.v1beta1.Code) | repeated | |
| contracts | [Contract](#wasmd.x.wasmd.v1beta1.Contract) | repeated | |
| sequences | [Sequence](#wasmd.x.wasmd.v1beta1.Sequence) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.Sequence"></a>
### Sequence
Sequence key and value of an id generation counter
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id_key | [bytes](#bytes) | | |
| value | [uint64](#uint64) | | |
<a name="x/wasm/internal/types/msg.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## x/wasm/internal/types/msg.proto
<a name="wasmd.x.wasmd.v1beta1.MsgClearAdmin"></a>
### MsgClearAdmin
MsgClearAdmin removes any admin stored for a smart contract
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
<a name="wasmd.x.wasmd.v1beta1.MsgExecuteContract"></a>
### MsgExecuteContract
MsgExecuteContract submits the given message data to a smart contract
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
| msg | [bytes](#bytes) | | Msg json encoded message to be passed to the contract |
| sent_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | SentFunds coins that are transferred to the contract on execution |
<a name="wasmd.x.wasmd.v1beta1.MsgInstantiateContract"></a>
### MsgInstantiateContract
MsgInstantiateContract create a new smart contract instance for the given code id.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| admin | [bytes](#bytes) | | 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. |
| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation |
| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation |
<a name="wasmd.x.wasmd.v1beta1.MsgMigrateContract"></a>
### MsgMigrateContract
MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
| code_id | [uint64](#uint64) | | CodeID references the new WASM code |
| migrate_msg | [bytes](#bytes) | | MigrateMsg json encoded message to be passed to the contract on migration |
<a name="wasmd.x.wasmd.v1beta1.MsgStoreCode"></a>
### MsgStoreCode
MsgStoreCode submit WASM code to the system
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| wasm_byte_code | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed |
| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract&#39;s source code, optional |
| builder | [string](#string) | | Builder is a valid docker image name with tag, optional |
| instantiate_permission | [AccessConfig](#wasmd.x.wasmd.v1beta1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional |
<a name="wasmd.x.wasmd.v1beta1.MsgUpdateAdmin"></a>
### MsgUpdateAdmin
MsgUpdateAdmin sets a new admin for a smart contract
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [bytes](#bytes) | | Sender is the that actor that signed the messages |
| new_admin | [bytes](#bytes) | | NewAdmin address to be set |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
<a name="x/wasm/internal/types/proposal.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## x/wasm/internal/types/proposal.proto
<a name="wasmd.x.wasmd.v1beta1.ClearAdminProposal"></a>
### ClearAdminProposal
ClearAdminProposal gov proposal content type to clear the admin of a contract.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | Title is a short summary |
| description | [string](#string) | | Description is a human readable text |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
<a name="wasmd.x.wasmd.v1beta1.InstantiateContractProposal"></a>
### InstantiateContractProposal
InstantiateContractProposal gov proposal content type to instantiate a contract.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | Title is a short summary |
| description | [string](#string) | | Description is a human readable text |
| run_as | [bytes](#bytes) | | RunAs is the address that is passed to the contract&#39;s environment as sender |
| admin | [bytes](#bytes) | | 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. |
| init_msg | [bytes](#bytes) | | InitMsg json encoded message to be passed to the contract on instantiation |
| init_funds | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | InitFunds coins that are transferred to the contract on instantiation |
<a name="wasmd.x.wasmd.v1beta1.MigrateContractProposal"></a>
### MigrateContractProposal
MigrateContractProposal gov proposal content type to migrate a contract.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | Title is a short summary |
| description | [string](#string) | | Description is a human readable text |
| run_as | [bytes](#bytes) | | RunAs is the address that is passed to the contract&#39;s environment as sender |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
| code_id | [uint64](#uint64) | | CodeID references the new WASM code |
| migrate_msg | [bytes](#bytes) | | MigrateMsg json encoded message to be passed to the contract on migration |
<a name="wasmd.x.wasmd.v1beta1.StoreCodeProposal"></a>
### StoreCodeProposal
StoreCodeProposal gov proposal content type to submit WASM code to the system
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | Title is a short summary |
| description | [string](#string) | | Description is a human readable text |
| run_as | [bytes](#bytes) | | RunAs is the address that is passed to the contract&#39;s environment as sender |
| wasm_byte_code | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed |
| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract&#39;s source code, optional |
| builder | [string](#string) | | Builder is a valid docker image name with tag, optional |
| instantiate_permission | [AccessConfig](#wasmd.x.wasmd.v1beta1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional |
<a name="wasmd.x.wasmd.v1beta1.UpdateAdminProposal"></a>
### UpdateAdminProposal
UpdateAdminProposal gov proposal content type to set an admin for a contract.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | Title is a short summary |
| description | [string](#string) | | Description is a human readable text |
| new_admin | [bytes](#bytes) | | NewAdmin address to be set |
| contract | [bytes](#bytes) | | Contract is the address of the smart contract |
<a name="x/wasm/internal/types/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## x/wasm/internal/types/query.proto
<a name="wasmd.x.wasmd.v1beta1.CodeInfoResponse"></a>
### CodeInfoResponse
CodeInfoResponse contains code meta data from CodeInfo
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_id | [uint64](#uint64) | | id for legacy support |
| creator | [bytes](#bytes) | | |
| data_hash | [bytes](#bytes) | | |
| source | [string](#string) | | |
| builder | [string](#string) | | |
<a name="wasmd.x.wasmd.v1beta1.ContractInfoWithAddress"></a>
### ContractInfoWithAddress
ContractInfoWithAddress adds the address (key) to the ContractInfo representation
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | |
| contract_info | [ContractInfo](#wasmd.x.wasmd.v1beta1.ContractInfo) | | |
<a name="wasmd.x.wasmd.v1beta1.QueryAllContractStateRequest"></a>
### QueryAllContractStateRequest
QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract |
<a name="wasmd.x.wasmd.v1beta1.QueryAllContractStateResponse"></a>
### QueryAllContractStateResponse
QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| models | [Model](#wasmd.x.wasmd.v1beta1.Model) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.QueryCodeRequest"></a>
### 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 |
<a name="wasmd.x.wasmd.v1beta1.QueryCodeResponse"></a>
### QueryCodeResponse
QueryCodeResponse is the response type for the Query/Code RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_info | [CodeInfoResponse](#wasmd.x.wasmd.v1beta1.CodeInfoResponse) | | |
| data | [bytes](#bytes) | | |
<a name="wasmd.x.wasmd.v1beta1.QueryCodesResponse"></a>
### QueryCodesResponse
QueryCodesResponse is the response type for the Query/Codes RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_infos | [CodeInfoResponse](#wasmd.x.wasmd.v1beta1.CodeInfoResponse) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.QueryContractHistoryRequest"></a>
### QueryContractHistoryRequest
QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract to query |
<a name="wasmd.x.wasmd.v1beta1.QueryContractHistoryResponse"></a>
### QueryContractHistoryResponse
QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| entries | [ContractCodeHistoryEntry](#wasmd.x.wasmd.v1beta1.ContractCodeHistoryEntry) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.QueryContractInfoRequest"></a>
### QueryContractInfoRequest
QueryContractInfoRequest is the request type for the Query/ContractInfo RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract to query |
<a name="wasmd.x.wasmd.v1beta1.QueryContractInfoResponse"></a>
### QueryContractInfoResponse
QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract |
| contract_info | [ContractInfo](#wasmd.x.wasmd.v1beta1.ContractInfo) | | |
<a name="wasmd.x.wasmd.v1beta1.QueryContractsByCodeRequest"></a>
### QueryContractsByCodeRequest
QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_id | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID |
<a name="wasmd.x.wasmd.v1beta1.QueryContractsByCodeResponse"></a>
### QueryContractsByCodeResponse
QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| contract_infos | [ContractInfoWithAddress](#wasmd.x.wasmd.v1beta1.ContractInfoWithAddress) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.QueryRawContractStateRequest"></a>
### QueryRawContractStateRequest
QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract |
| query_data | [bytes](#bytes) | | |
<a name="wasmd.x.wasmd.v1beta1.QueryRawContractStateResponse"></a>
### 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 |
<a name="wasmd.x.wasmd.v1beta1.QuerySmartContractStateRequest"></a>
### QuerySmartContractStateRequest
QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| address | [bytes](#bytes) | | address is the address of the contract |
| query_data | [bytes](#bytes) | | QueryData contains the query data passed to the contract |
<a name="wasmd.x.wasmd.v1beta1.QuerySmartContractStateResponse"></a>
### 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 |
<a name="wasmd.x.wasmd.v1beta1.Query"></a>
### Query
Query provides defines the gRPC querier service
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ContractInfo | [QueryContractInfoRequest](#wasmd.x.wasmd.v1beta1.QueryContractInfoRequest) | [QueryContractInfoResponse](#wasmd.x.wasmd.v1beta1.QueryContractInfoResponse) | ContractInfo gets the contract meta data |
| ContractHistory | [QueryContractHistoryRequest](#wasmd.x.wasmd.v1beta1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#wasmd.x.wasmd.v1beta1.QueryContractHistoryResponse) | ContractHistory gets the contract code history |
| ContractsByCode | [QueryContractsByCodeRequest](#wasmd.x.wasmd.v1beta1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#wasmd.x.wasmd.v1beta1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id |
| AllContractState | [QueryAllContractStateRequest](#wasmd.x.wasmd.v1beta1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#wasmd.x.wasmd.v1beta1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract |
| RawContractState | [QueryRawContractStateRequest](#wasmd.x.wasmd.v1beta1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#wasmd.x.wasmd.v1beta1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract |
| SmartContractState | [QuerySmartContractStateRequest](#wasmd.x.wasmd.v1beta1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#wasmd.x.wasmd.v1beta1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract |
| Code | [QueryCodeRequest](#wasmd.x.wasmd.v1beta1.QueryCodeRequest) | [QueryCodeResponse](#wasmd.x.wasmd.v1beta1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code |
| Codes | [.google.protobuf.Empty](#google.protobuf.Empty) | [QueryCodesResponse](#wasmd.x.wasmd.v1beta1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes |
<a name="x/wasm/internal/types/types.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## x/wasm/internal/types/types.proto
<a name="wasmd.x.wasmd.v1beta1.AbsoluteTxPosition"></a>
### AbsoluteTxPosition
AbsoluteTxPosition can be used to sort contracts
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| block_height | [int64](#int64) | | BlockHeight is the block the contract was created at |
| tx_index | [uint64](#uint64) | | TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) |
<a name="wasmd.x.wasmd.v1beta1.AccessConfig"></a>
### AccessConfig
AccessConfig access control type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission | [AccessType](#wasmd.x.wasmd.v1beta1.AccessType) | | |
| address | [bytes](#bytes) | | |
<a name="wasmd.x.wasmd.v1beta1.AccessTypeParam"></a>
### AccessTypeParam
AccessTypeParam
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [AccessType](#wasmd.x.wasmd.v1beta1.AccessType) | | |
<a name="wasmd.x.wasmd.v1beta1.CodeInfo"></a>
### CodeInfo
CodeInfo is data for the uploaded contract WASM code
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_hash | [bytes](#bytes) | | CodeHash is the unique CodeID |
| creator | [bytes](#bytes) | | Creator address who initially stored the code |
| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract&#39;s source code, optional |
| builder | [string](#string) | | Builder is a valid docker image name with tag, optional |
| instantiate_config | [AccessConfig](#wasmd.x.wasmd.v1beta1.AccessConfig) | | InstantiateConfig access control to apply on contract creation, optional |
<a name="wasmd.x.wasmd.v1beta1.ContractCodeHistoryEntry"></a>
### ContractCodeHistoryEntry
ContractCodeHistoryEntry metadata to a contract.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| operation | [ContractCodeHistoryOperationType](#wasmd.x.wasmd.v1beta1.ContractCodeHistoryOperationType) | | |
| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
| updated | [AbsoluteTxPosition](#wasmd.x.wasmd.v1beta1.AbsoluteTxPosition) | | Updated Tx position when the operation was executed. |
| msg | [bytes](#bytes) | | |
<a name="wasmd.x.wasmd.v1beta1.ContractHistory"></a>
### ContractHistory
ContractHistory contains a sorted list of code updates to a contract
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_history_entries | [ContractCodeHistoryEntry](#wasmd.x.wasmd.v1beta1.ContractCodeHistoryEntry) | repeated | |
<a name="wasmd.x.wasmd.v1beta1.ContractInfo"></a>
### ContractInfo
ContractInfo stores a WASM contract instance
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
| creator | [bytes](#bytes) | | Creator address who initially instantiated the contract |
| admin | [bytes](#bytes) | | Admin is an optional address that can execute migrations |
| label | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
| created | [AbsoluteTxPosition](#wasmd.x.wasmd.v1beta1.AbsoluteTxPosition) | | Created Tx position when the contract was instantiated. This data should kept internal and not be exposed via query results. Just use for sorting |
<a name="wasmd.x.wasmd.v1beta1.Model"></a>
### Model
Model is a struct that holds a KV pair
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [bytes](#bytes) | | hex-encode key to read it better (this is often ascii) |
| value | [bytes](#bytes) | | base64-encode raw value |
<a name="wasmd.x.wasmd.v1beta1.Params"></a>
### Params
Params defines the set of wasm parameters.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code_upload_access | [AccessConfig](#wasmd.x.wasmd.v1beta1.AccessConfig) | | |
| instantiate_default_permission | [AccessType](#wasmd.x.wasmd.v1beta1.AccessType) | | |
| max_wasm_code_size | [uint64](#uint64) | | |
<a name="wasmd.x.wasmd.v1beta1.AccessType"></a>
### AccessType
AccessType permission types
| Name | Number | Description |
| ---- | ------ | ----------- |
| ACCESS_TYPE_UNSPECIFIED | 0 | AccessTypeUnspecified placeholder for empty value |
| ACCESS_TYPE_NOBODY | 1 | AccessTypeNobody forbidden |
| ACCESS_TYPE_ONLY_ADDRESS | 2 | AccessTypeOnlyAddress restricted to an address |
| ACCESS_TYPE_EVERYBODY | 3 | AccessTypeEverybody unrestricted |
<a name="wasmd.x.wasmd.v1beta1.ContractCodeHistoryOperationType"></a>
### ContractCodeHistoryOperationType
ContractCodeHistoryOperationType actions that caused a code change
| Name | Number | Description |
| ---- | ------ | ----------- |
| CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED | 0 | ContractCodeHistoryOperationTypeUnspecified placeholder for empty value |
| CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT | 1 | ContractCodeHistoryOperationTypeInit on chain contract instantiation |
| CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE | 2 | ContractCodeHistoryOperationTypeMigrate code migration |
| CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS | 3 | ContractCodeHistoryOperationTypeGenesis based on genesis data |
## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

View File

@@ -1,23 +1,19 @@
#!/usr/bin/env bash
#!/bin/sh
set -eo pipefail
project_dir=x/wasm/internal/types/
cosmos_sdk_dir=$(go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk)
PROJECT_PROTO_DIR=x/wasm/internal/types/
COSMOS_SDK_DIR=${COSMOS_SDK_DIR:-$(go list -f "{{ .Dir }}" -m github.com/cosmos/cosmos-sdk)}
# Generate Go types from protobuf
protoc \
-I=. \
-I="$cosmos_sdk_dir/third_party/proto" \
-I="$cosmos_sdk_dir/proto" \
--gocosmos_out=Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,plugins=interfacetype+grpc,paths=source_relative:. \
$(find "${project_dir}" -maxdepth 1 -name '*.proto')
# Generate gRPC gateway (*.pb.gw.go in respective modules) files
protoc \
-I=. \
-I="$cosmos_sdk_dir/third_party/proto" \
-I="$cosmos_sdk_dir/proto" \
-I="$COSMOS_SDK_DIR/third_party/proto" \
-I="$COSMOS_SDK_DIR/proto" \
--gocosmos_out=Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,plugins=interfacetype+grpc,paths=source_relative:. \
--grpc-gateway_out .\
--grpc-gateway_opt logtostderr=true \
--grpc-gateway_opt paths=source_relative \
$(find "${project_dir}" -maxdepth 1 -name '*.proto')
--grpc-gateway_opt paths=Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,paths=source_relative \
--doc_out=./doc \
--doc_opt=markdown,proto.md \
$(find "${PROJECT_PROTO_DIR}" -maxdepth 1 -name '*.proto')

View File

@@ -465,7 +465,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
assert.Equal(t, expContractInfo, *gotContractInfo)
expHistory := []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
},

View File

@@ -288,7 +288,7 @@ func TestInstantiate(t *testing.T) {
assert.Equal(t, info.Label, "demo contract 1")
exp := []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: codeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: json.RawMessage(initMsgBz),
@@ -850,12 +850,12 @@ func TestMigrate(t *testing.T) {
assert.Equal(t, spec.codeID, cInfo.CodeID)
expHistory := []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: originalCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: initMsgBz,
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: spec.codeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: spec.migrateMsg,

View File

@@ -230,44 +230,44 @@ func TestLegacyQueryContractHistory(t *testing.T) {
}{
"response with internal fields cleared": {
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),
}},
expContent: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Msg: []byte(`"init message"`),
}},
},
"response with multiple entries": {
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 2,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"migrate message 1"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 3,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"migrate message 2"`),
}},
expContent: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: firstCodeID,
Msg: []byte(`"init message"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 2,
Msg: []byte(`"migrate message 1"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 3,
Msg: []byte(`"migrate message 2"`),
}},
@@ -275,7 +275,7 @@ func TestLegacyQueryContractHistory(t *testing.T) {
"unknown contract address": {
srcQueryAddr: otherAddr,
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),

View File

@@ -104,7 +104,7 @@ func TestInstantiateProposal(t *testing.T) {
assert.Equal(t, otherAddress, cInfo.Admin)
assert.Equal(t, "testing", cInfo.Label)
expHistory := []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: src.CodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: src.InitMsg,
@@ -175,11 +175,11 @@ func TestMigrateProposal(t *testing.T) {
assert.Equal(t, anyAddress, cInfo.Admin)
assert.Equal(t, "testing", cInfo.Label)
expHistory := []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: src.CodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: src.MigrateMsg,

View File

@@ -7,7 +7,7 @@ import (
"github.com/CosmWasm/wasmd/x/wasm/internal/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/golang/protobuf/ptypes/empty"
prototypes "github.com/gogo/protobuf/types"
)
type grpcQuerier struct {
@@ -133,7 +133,7 @@ func (q grpcQuerier) Code(c context.Context, req *types.QueryCodeRequest) (*type
}, nil
}
func (q grpcQuerier) Codes(c context.Context, _ *empty.Empty) (*types.QueryCodesResponse, error) {
func (q grpcQuerier) Codes(c context.Context, _ *prototypes.Empty) (*types.QueryCodesResponse, error) {
rsp, err := queryCodeList(sdk.UnwrapSDKContext(c), *q.keeper)
switch {
case err != nil:

View File

@@ -227,44 +227,44 @@ func TestQueryContractHistory(t *testing.T) {
}{
"response with internal fields cleared": {
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),
}},
expContent: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Msg: []byte(`"init message"`),
}},
},
"response with multiple entries": {
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 2,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"migrate message 1"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 3,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"migrate message 2"`),
}},
expContent: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeInit,
Operation: types.ContractCodeHistoryOperationTypeInit,
CodeID: firstCodeID,
Msg: []byte(`"init message"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 2,
Msg: []byte(`"migrate message 1"`),
}, {
Operation: types.ContractCodeHistoryTypeMigrate,
Operation: types.ContractCodeHistoryOperationTypeMigrate,
CodeID: 3,
Msg: []byte(`"migrate message 2"`),
}},
@@ -272,7 +272,7 @@ func TestQueryContractHistory(t *testing.T) {
"unknown contract address": {
srcQueryAddr: otherAddr,
srcHistory: []types.ContractCodeHistoryEntry{{
Operation: types.ContractCodeHistoryTypeGenesis,
Operation: types.ContractCodeHistoryOperationTypeGenesis,
CodeID: firstCodeID,
Updated: types.NewAbsoluteTxPosition(ctx),
Msg: []byte(`"init message"`),

View File

@@ -215,7 +215,7 @@ func (m *Contract) GetContractState() []Model {
return nil
}
// Sequence id and value of a counter
// Sequence key and value of an id generation counter
type Sequence struct {
IDKey []byte `protobuf:"bytes,1,opt,name=id_key,json=idKey,proto3" json:"id_key,omitempty"`
Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`

View File

@@ -28,7 +28,7 @@ message Contract {
repeated Model contract_state = 3 [(gogoproto.nullable) = false];
}
// Sequence id and value of a counter
// Sequence key and value of an id generation counter
message Sequence {
bytes id_key = 1 [(gogoproto.customname) = "IDKey"];
uint64 value = 2;

View File

@@ -26,7 +26,9 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MsgStoreCode submit WASM code to the system
type MsgStoreCode struct {
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// WASMByteCode can be raw or gzip compressed
WASMByteCode []byte `protobuf:"bytes,2,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"`
@@ -34,8 +36,8 @@ type MsgStoreCode struct {
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
// Builder is a valid docker image name with tag, optional
Builder string `protobuf:"bytes,4,opt,name=builder,proto3" json:"builder,omitempty"`
// InstantiatePermission to apply on contract creation, optional
InstantiatePermission *AccessConfig `protobuf:"bytes,5,opt,name=InstantiatePermission,proto3" json:"InstantiatePermission,omitempty"`
// InstantiatePermission access control to apply on contract creation, optional
InstantiatePermission *AccessConfig `protobuf:"bytes,5,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"`
}
func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} }
@@ -71,14 +73,20 @@ func (m *MsgStoreCode) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgStoreCode proto.InternalMessageInfo
// MsgInstantiateContract create a new smart contract instance for the given code id.
type MsgInstantiateContract struct {
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Admin is an optional address that can execute migrations
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin,omitempty"`
CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
InitMsg encoding_json.RawMessage `protobuf:"bytes,5,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin,omitempty"`
// CodeID is the reference to the stored WASM code
CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
// Label is optional metadata to be stored with a contract instance.
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
// InitMsg json encoded message to be passed to the contract on instantiation
InitMsg encoding_json.RawMessage `protobuf:"bytes,5,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
// InitFunds coins that are transferred to the contract on instantiation
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
}
func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} }
@@ -114,11 +122,16 @@ func (m *MsgInstantiateContract) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgInstantiateContract proto.InternalMessageInfo
// MsgExecuteContract submits the given message data to a smart contract
type MsgExecuteContract struct {
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
Msg encoding_json.RawMessage `protobuf:"bytes,3,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"`
SentFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=sent_funds,json=sentFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"sent_funds"`
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
// Msg json encoded message to be passed to the contract
Msg encoding_json.RawMessage `protobuf:"bytes,3,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"`
// SentFunds coins that are transferred to the contract on execution
SentFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,5,rep,name=sent_funds,json=sentFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"sent_funds"`
}
func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} }
@@ -154,11 +167,16 @@ func (m *MsgExecuteContract) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgExecuteContract proto.InternalMessageInfo
// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
type MsgMigrateContract struct {
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
MigrateMsg encoding_json.RawMessage `protobuf:"bytes,4,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"`
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
// CodeID references the new WASM code
CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
// MigrateMsg json encoded message to be passed to the contract on migration
MigrateMsg encoding_json.RawMessage `protobuf:"bytes,4,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"`
}
func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} }
@@ -194,9 +212,13 @@ func (m *MsgMigrateContract) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgMigrateContract proto.InternalMessageInfo
// MsgUpdateAdmin sets a new admin for a smart contract
type MsgUpdateAdmin struct {
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// NewAdmin address to be set
NewAdmin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=new_admin,json=newAdmin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_admin,omitempty"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
}
@@ -233,8 +255,11 @@ func (m *MsgUpdateAdmin) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo
// MsgClearAdmin removes any admin stored for a smart contract
type MsgClearAdmin struct {
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Sender is the that actor that signed the messages
Sender github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=sender,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"sender,omitempty"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
}
@@ -283,49 +308,49 @@ func init() {
func init() { proto.RegisterFile("x/wasm/internal/types/msg.proto", fileDescriptor_22c4d58a052e9e95) }
var fileDescriptor_22c4d58a052e9e95 = []byte{
// 657 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00,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xdf, 0x1b, 0x15,
0xeb, 0xdf, 0xf7, 0x62, 0x54, 0xcd, 0xae, 0xc4, 0xc7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x86,
0xec, 0xce, 0x81, 0xa5, 0x07, 0x00, 0x00,
}
func (m *MsgStoreCode) Marshal() (dAtA []byte, err error) {

View File

@@ -10,7 +10,9 @@ option go_package = "github.com/CosmWasm/wasmd/x/wasmd/internal/types";
option (gogoproto.goproto_getters_all) = false;
// MsgStoreCode submit Wasm code to the system
message MsgStoreCode {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// WASMByteCode can be raw or gzip compressed
bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"];
@@ -18,41 +20,65 @@ message MsgStoreCode {
string source = 3;
// Builder is a valid docker image name with tag, optional
string builder = 4;
// InstantiatePermission to apply on contract creation, optional
AccessConfig InstantiatePermission = 5;
// InstantiatePermission access control to apply on contract creation, optional
AccessConfig instantiate_permission = 5;
}
// MsgInstantiateContract create a new smart contract instance for the given code id.
message MsgInstantiateContract {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Admin is an optional address that can execute migrations
bytes admin = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// CodeID is the reference to the stored WASM code
uint64 code_id = 3 [(gogoproto.customname) = "CodeID"];
// Label is optional metadata to be stored with a contract instance.
string label = 4;
// InitMsg json encoded message to be passed to the contract on instantiation
bytes init_msg = 5 [(gogoproto.casttype) = "encoding/json.RawMessage"];
// InitFunds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin init_funds = 6 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// MsgExecuteContract submits the given message data to a smart contract
message MsgExecuteContract {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Contract is the address of the smart contract
bytes contract = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Msg json encoded message to be passed to the contract
bytes msg = 3 [(gogoproto.casttype) = "encoding/json.RawMessage"];
// SentFunds coins that are transferred to the contract on execution
repeated cosmos.base.v1beta1.Coin sent_funds = 5 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
message MsgMigrateContract {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Contract is the address of the smart contract
bytes contract = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// CodeID references the new WASM code
uint64 code_id = 3 [(gogoproto.customname) = "CodeID"];
// MigrateMsg json encoded message to be passed to the contract on migration
bytes migrate_msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"];
}
// MsgUpdateAdmin sets a new admin for a smart contract
message MsgUpdateAdmin {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// NewAdmin address to be set
bytes new_admin = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Contract is the address of the smart contract
bytes contract = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// MsgClearAdmin removes any admin stored for a smart contract
message MsgClearAdmin {
// Sender is the that actor that signed the messages
bytes sender = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Contract is the address of the smart contract
bytes contract = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

View File

@@ -53,7 +53,7 @@ func (a AccessType) String() string {
case AccessTypeEverybody:
return "Everybody"
}
return "Undefined"
return "Unspecified"
}
func (a *AccessType) UnmarshalText(text []byte) error {
@@ -63,7 +63,7 @@ func (a *AccessType) UnmarshalText(text []byte) error {
return nil
}
}
*a = AccessTypeUndefined
*a = AccessTypeUnspecified
return nil
}
func (a AccessType) MarshalText() ([]byte, error) {
@@ -143,7 +143,7 @@ func validateAccessType(i interface{}) error {
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if a == AccessTypeUndefined {
if a == AccessTypeUnspecified {
return sdkerrors.Wrap(ErrEmpty, "type")
}
for _, v := range AllAccessTypes {
@@ -167,7 +167,7 @@ func validateMaxWasmCodeSize(i interface{}) error {
func (v AccessConfig) ValidateBasic() error {
switch v.Permission {
case AccessTypeUndefined:
case AccessTypeUnspecified:
return sdkerrors.Wrap(ErrEmpty, "type")
case AccessTypeNobody, AccessTypeEverybody:
if len(v.Address) != 0 {

View File

@@ -93,7 +93,7 @@ func TestValidateParams(t *testing.T) {
},
"reject undefined permission in CodeUploadAccess": {
src: Params{
CodeUploadAccess: AccessConfig{Permission: AccessTypeUndefined},
CodeUploadAccess: AccessConfig{Permission: AccessTypeUnspecified},
InstantiateDefaultPermission: AccessTypeOnlyAddress,
MaxWasmCodeSize: DefaultMaxWasmCodeSize,
},
@@ -124,11 +124,11 @@ func TestAccessTypeMarshalJson(t *testing.T) {
src AccessType
exp string
}{
"Undefined": {src: AccessTypeUndefined, exp: `"Undefined"`},
"Unspecified": {src: AccessTypeUnspecified, exp: `"Unspecified"`},
"Nobody": {src: AccessTypeNobody, exp: `"Nobody"`},
"OnlyAddress": {src: AccessTypeOnlyAddress, exp: `"OnlyAddress"`},
"Everybody": {src: AccessTypeEverybody, exp: `"Everybody"`},
"unknown": {src: 999, exp: `"Undefined"`},
"unknown": {src: 999, exp: `"Unspecified"`},
}
for msg, spec := range specs {
t.Run(msg, func(t *testing.T) {
@@ -144,11 +144,11 @@ func TestAccessTypeUnmarshalJson(t *testing.T) {
src string
exp AccessType
}{
"Undefined": {src: `"Undefined"`, exp: AccessTypeUndefined},
"Unspecified": {src: `"Unspecified"`, exp: AccessTypeUnspecified},
"Nobody": {src: `"Nobody"`, exp: AccessTypeNobody},
"OnlyAddress": {src: `"OnlyAddress"`, exp: AccessTypeOnlyAddress},
"Everybody": {src: `"Everybody"`, exp: AccessTypeEverybody},
"unknown": {src: `""`, exp: AccessTypeUndefined},
"unknown": {src: `""`, exp: AccessTypeUnspecified},
}
for msg, spec := range specs {
t.Run(msg, func(t *testing.T) {

View File

@@ -27,8 +27,11 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// StoreCodeProposal gov proposal content type to submit WASM code to the system
type StoreCodeProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"run_as,omitempty"`
@@ -39,7 +42,7 @@ type StoreCodeProposal struct {
// Builder is a valid docker image name with tag, optional
Builder string `protobuf:"bytes,6,opt,name=builder,proto3" json:"builder,omitempty"`
// InstantiatePermission to apply on contract creation, optional
InstantiatePermission *AccessConfig `protobuf:"bytes,7,opt,name=InstantiatePermission,proto3" json:"InstantiatePermission,omitempty"`
InstantiatePermission *AccessConfig `protobuf:"bytes,7,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"`
}
func (m *StoreCodeProposal) Reset() { *m = StoreCodeProposal{} }
@@ -76,16 +79,22 @@ var xxx_messageInfo_StoreCodeProposal proto.InternalMessageInfo
// InstantiateContractProposal gov proposal content type to instantiate a contract.
type InstantiateContractProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"run_as,omitempty"`
// Admin is an optional address that can execute migrations
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin,omitempty"`
CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"`
InitMsg encoding_json.RawMessage `protobuf:"bytes,7,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" 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"`
// InitMsg json encoded message to be passed to the contract on instantiation
InitMsg encoding_json.RawMessage `protobuf:"bytes,7,opt,name=init_msg,json=initMsg,proto3,casttype=encoding/json.RawMessage" json:"init_msg,omitempty"`
// InitFunds coins that are transferred to the contract on instantiation
InitFunds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=init_funds,json=initFunds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"init_funds"`
}
func (m *InstantiateContractProposal) Reset() { *m = InstantiateContractProposal{} }
@@ -122,13 +131,18 @@ var xxx_messageInfo_InstantiateContractProposal proto.InternalMessageInfo
// MigrateContractProposal gov proposal content type to migrate a contract.
type MigrateContractProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"run_as,omitempty"`
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
CodeID uint64 `protobuf:"varint,5,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
MigrateMsg encoding_json.RawMessage `protobuf:"bytes,6,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"`
RunAs github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"run_as,omitempty"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" 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"`
// MigrateMsg json encoded message to be passed to the contract on migration
MigrateMsg encoding_json.RawMessage `protobuf:"bytes,6,opt,name=migrate_msg,json=migrateMsg,proto3,casttype=encoding/json.RawMessage" json:"migrate_msg,omitempty"`
}
func (m *MigrateContractProposal) Reset() { *m = MigrateContractProposal{} }
@@ -165,10 +179,14 @@ var xxx_messageInfo_MigrateContractProposal proto.InternalMessageInfo
// UpdateAdminProposal gov proposal content type to set an admin for a contract.
type UpdateAdminProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
NewAdmin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_admin,omitempty" yaml:"new_admin"`
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_admin,omitempty" yaml:"new_admin"`
// Contract is the address of the smart contract
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
}
func (m *UpdateAdminProposal) Reset() { *m = UpdateAdminProposal{} }
@@ -205,9 +223,12 @@ var xxx_messageInfo_UpdateAdminProposal proto.InternalMessageInfo
// ClearAdminProposal gov proposal content type to clear the admin of a contract.
type ClearAdminProposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
Contract github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
// 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 github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=contract,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"contract,omitempty"`
}
func (m *ClearAdminProposal) Reset() { *m = ClearAdminProposal{} }
@@ -255,50 +276,50 @@ func init() {
}
var fileDescriptor_00b43267813130fb = []byte{
// 679 bytes of a gzipped FileDescriptorProto
// 684 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xcd, 0x4e, 0xdb, 0x4a,
0x18, 0x8d, 0x13, 0x92, 0xc0, 0x24, 0xba, 0xe2, 0xfa, 0xc2, 0xbd, 0xbe, 0xb4, 0xb2, 0x53, 0xd3,
0x45, 0x36, 0xd8, 0x40, 0xa5, 0x56, 0xaa, 0xd4, 0x45, 0x92, 0xfe, 0xb1, 0x88, 0x84, 0x8c, 0x5a,
0xd4, 0x6e, 0xa2, 0xb1, 0x67, 0x70, 0x87, 0xda, 0x33, 0xd1, 0xcc, 0xa4, 0x21, 0xbb, 0x3e, 0x42,
0xf7, 0x7d, 0x81, 0xaa, 0x4f, 0x92, 0x55, 0xc5, 0x12, 0x75, 0x91, 0x96, 0xf0, 0x06, 0x5d, 0xb2,
0xaa, 0x66, 0x6c, 0x50, 0x2a, 0xb1, 0x40, 0xc0, 0x82, 0x4d, 0x26, 0x5f, 0xbe, 0xf3, 0x9d, 0x9c,
0x39, 0x67, 0xec, 0x01, 0xf7, 0x0f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, 0x07, 0xf9,
0xfa, 0xe7, 0xed, 0x13, 0x56, 0xf4, 0xc5, 0xf3, 0xe0, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd4,
0xce, 0x48, 0x5a, 0x10, 0x07, 0x00, 0x00,
0x18, 0x8d, 0x13, 0x92, 0xc0, 0x24, 0xba, 0xe2, 0xfa, 0x02, 0xd7, 0x97, 0x5b, 0x39, 0x69, 0xe8,
0x22, 0x1b, 0x6c, 0xa0, 0x52, 0x2b, 0x55, 0xea, 0x22, 0x49, 0xff, 0x58, 0x44, 0x42, 0x46, 0x2d,
0x12, 0x9b, 0x68, 0xec, 0x19, 0xdc, 0xa1, 0xf6, 0x8c, 0x35, 0x33, 0x69, 0xc8, 0xae, 0x8f, 0xd0,
0x7d, 0x5f, 0xa0, 0xea, 0x93, 0x64, 0x55, 0xb1, 0x44, 0xaa, 0x94, 0x96, 0xf0, 0x06, 0x5d, 0xb2,
0xaa, 0x66, 0x6c, 0xd2, 0x54, 0x62, 0x81, 0x80, 0x05, 0x9b, 0x4c, 0xbe, 0x7c, 0xe7, 0x3b, 0x39,
0x73, 0xce, 0xd8, 0x03, 0x1e, 0x1c, 0xb9, 0x03, 0x28, 0x62, 0x97, 0x50, 0x89, 0x39, 0x85, 0x91,
0x2b, 0x87, 0x09, 0x16, 0x6e, 0xc2, 0x59, 0xc2, 0x04, 0x8c, 0x9c, 0x84, 0x33, 0xc9, 0xcc, 0x65,
0x85, 0x41, 0xce, 0x91, 0x93, 0xae, 0xef, 0x37, 0x7d, 0x2c, 0xe1, 0xe6, 0xea, 0x52, 0xc8, 0x42,
0xa6, 0x11, 0xae, 0xfa, 0x96, 0x82, 0x57, 0xed, 0x80, 0x89, 0x98, 0x09, 0xd7, 0x87, 0x02, 0xbb,
0x19, 0xd4, 0x0d, 0x18, 0xa1, 0x59, 0xff, 0xfe, 0xe5, 0x7f, 0xa9, 0x3f, 0x53, 0x48, 0xe3, 0x5b,
0x1e, 0xfc, 0xbd, 0x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x61, 0xe3, 0x43, 0x1e, 0xfc, 0xf3, 0x3a, 0x41, 0x50, 0xe2, 0x96,
0x3a, 0x40, 0x37, 0x36, 0xd3, 0x07, 0x0b, 0x14, 0x0f, 0x7a, 0xe9, 0x69, 0x4e, 0xfd, 0x7c, 0xfe,
0x73, 0x5c, 0x5b, 0x1c, 0xc2, 0x38, 0x7a, 0xd2, 0x98, 0xb6, 0x1a, 0xd7, 0xf0, 0x85, 0xe2, 0x81,
0xd6, 0x78, 0xcb, 0x36, 0x37, 0x3e, 0x19, 0xc0, 0xec, 0x44, 0x18, 0xf2, 0xdb, 0x71, 0x60, 0x56,
0x5d, 0xe1, 0xc6, 0xea, 0xda, 0x6f, 0x46, 0xa7, 0x76, 0xee, 0xe4, 0xd4, 0xce, 0x7d, 0x9e, 0xd8,
0xc6, 0x68, 0x62, 0x1b, 0xc7, 0x13, 0xdb, 0xf8, 0x31, 0xb1, 0x8d, 0x8f, 0x67, 0x76, 0xee, 0xf8,
0xcc, 0xce, 0x9d, 0x9c, 0xd9, 0xb9, 0xfd, 0x8d, 0x19, 0xfa, 0x0e, 0x13, 0xf1, 0x9e, 0xba, 0x70,
0xf4, 0x9b, 0xd2, 0x3d, 0xca, 0xd6, 0x3f, 0xaf, 0x1f, 0xbf, 0xa4, 0x6f, 0x9e, 0x87, 0xbf, 0x02,
0x00, 0x00, 0xff, 0xff, 0x4f, 0xeb, 0x52, 0x56, 0x11, 0x07, 0x00, 0x00,
}
func (this *StoreCodeProposal) Equal(that interface{}) bool {

View File

@@ -10,8 +10,11 @@ option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;
// StoreCodeProposal gov proposal content type to submit WASM code to the system
message StoreCodeProposal {
// 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
bytes run_as = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
@@ -22,47 +25,63 @@ message StoreCodeProposal {
// Builder is a valid docker image name with tag, optional
string builder = 6;
// InstantiatePermission to apply on contract creation, optional
AccessConfig InstantiatePermission = 7;
AccessConfig instantiate_permission = 7;
}
// InstantiateContractProposal gov proposal content type to instantiate a contract.
message InstantiateContractProposal {
// 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
bytes run_as = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Admin is an optional address that can execute migrations
bytes admin = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// 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;
// InitMsg json encoded message to be passed to the contract on instantiation
bytes init_msg = 7 [(gogoproto.casttype) = "encoding/json.RawMessage"];
// InitFunds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin init_funds = 8 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
}
// MigrateContractProposal gov proposal content type to migrate a contract.
message MigrateContractProposal {
// 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
bytes run_as = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Contract is the address of the smart contract
bytes contract = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// CodeID references the new WASM code
uint64 code_id = 5 [(gogoproto.customname) = "CodeID"];
// MigrateMsg json encoded message to be passed to the contract on migration
bytes migrate_msg = 6 [(gogoproto.casttype) = "encoding/json.RawMessage"];
}
// UpdateAdminProposal gov proposal content type to set an admin for a contract.
message UpdateAdminProposal {
// Title is a short summary
string title = 1;
// Description is a human readable text
string description = 2;
// NewAdmin address to be set
bytes new_admin = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", (gogoproto.moretags) = "yaml:\"new_admin\""];
// Contract is the address of the smart contract
bytes contract = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// ClearAdminProposal gov proposal content type to clear the admin of a contract.
message ClearAdminProposal {
// 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
bytes contract = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}

View File

@@ -12,7 +12,7 @@ import (
_ "github.com/gogo/protobuf/gogoproto"
grpc1 "github.com/gogo/protobuf/grpc"
proto "github.com/gogo/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
types "github.com/gogo/protobuf/types"
github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
@@ -77,7 +77,7 @@ var xxx_messageInfo_QueryContractInfoRequest proto.InternalMessageInfo
type QueryContractInfoResponse struct {
// address is the address of the contract
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
*ContractInfo `protobuf:"bytes,2,opt,name=ContractInfo,proto3,embedded=ContractInfo" json:""`
*ContractInfo `protobuf:"bytes,2,opt,name=contract_info,json=contractInfo,proto3,embedded=contract_info" json:""`
}
func (m *QueryContractInfoResponse) Reset() { *m = QueryContractInfoResponse{} }
@@ -113,6 +113,7 @@ func (m *QueryContractInfoResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryContractInfoResponse proto.InternalMessageInfo
// QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method
type QueryContractHistoryRequest struct {
// address is the address of the contract to query
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
@@ -151,6 +152,7 @@ func (m *QueryContractHistoryRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryContractHistoryRequest proto.InternalMessageInfo
// QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method
type QueryContractHistoryResponse struct {
Entries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"`
}
@@ -188,6 +190,7 @@ func (m *QueryContractHistoryResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryContractHistoryResponse proto.InternalMessageInfo
// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method
type QueryContractsByCodeRequest struct {
CodeId uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
}
@@ -228,7 +231,7 @@ var xxx_messageInfo_QueryContractsByCodeRequest proto.InternalMessageInfo
// ContractInfoWithAddress adds the address (key) to the ContractInfo representation
type ContractInfoWithAddress struct {
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
*ContractInfo `protobuf:"bytes,2,opt,name=ContractInfo,proto3,embedded=ContractInfo" json:""`
*ContractInfo `protobuf:"bytes,2,opt,name=contract_info,json=contractInfo,proto3,embedded=contract_info" json:""`
}
func (m *ContractInfoWithAddress) Reset() { *m = ContractInfoWithAddress{} }
@@ -264,6 +267,7 @@ func (m *ContractInfoWithAddress) XXX_DiscardUnknown() {
var xxx_messageInfo_ContractInfoWithAddress proto.InternalMessageInfo
// QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method
type QueryContractsByCodeResponse struct {
ContractInfos []ContractInfoWithAddress `protobuf:"bytes,1,rep,name=contract_infos,json=contractInfos,proto3" json:"contract_infos"`
}
@@ -301,6 +305,7 @@ func (m *QueryContractsByCodeResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryContractsByCodeResponse proto.InternalMessageInfo
// QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method
type QueryAllContractStateRequest struct {
// address is the address of the contract
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
@@ -339,6 +344,7 @@ func (m *QueryAllContractStateRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAllContractStateRequest proto.InternalMessageInfo
// QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method
type QueryAllContractStateResponse struct {
Models []Model `protobuf:"bytes,1,rep,name=models,proto3" json:"models"`
}
@@ -376,6 +382,7 @@ func (m *QueryAllContractStateResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAllContractStateResponse proto.InternalMessageInfo
// QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method
type QueryRawContractStateRequest struct {
// address is the address of the contract
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
@@ -415,7 +422,9 @@ func (m *QueryRawContractStateRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryRawContractStateRequest proto.InternalMessageInfo
// QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method
type QueryRawContractStateResponse struct {
// Data contains the raw store data
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}
@@ -452,10 +461,12 @@ func (m *QueryRawContractStateResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryRawContractStateResponse proto.InternalMessageInfo
// QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method
type QuerySmartContractStateRequest struct {
// address is the address of the contract
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
QueryData []byte `protobuf:"bytes,2,opt,name=query_data,json=queryData,proto3" json:"query_data,omitempty"`
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty"`
// QueryData contains the query data passed to the contract
QueryData []byte `protobuf:"bytes,2,opt,name=query_data,json=queryData,proto3" json:"query_data,omitempty"`
}
func (m *QuerySmartContractStateRequest) Reset() { *m = QuerySmartContractStateRequest{} }
@@ -491,7 +502,9 @@ func (m *QuerySmartContractStateRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QuerySmartContractStateRequest proto.InternalMessageInfo
// QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method
type QuerySmartContractStateResponse struct {
// Data contains the json data returned from the smart contract
Data encoding_json.RawMessage `protobuf:"bytes,1,opt,name=data,proto3,casttype=encoding/json.RawMessage" json:"data,omitempty"`
}
@@ -528,6 +541,7 @@ func (m *QuerySmartContractStateResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QuerySmartContractStateResponse proto.InternalMessageInfo
// QueryCodeRequest is the request type for the Query/Code RPC method
type QueryCodeRequest struct {
CodeId uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
}
@@ -565,6 +579,7 @@ func (m *QueryCodeRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryCodeRequest proto.InternalMessageInfo
// CodeInfoResponse contains code meta data from CodeInfo
type CodeInfoResponse struct {
CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"id"`
Creator github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
@@ -606,6 +621,7 @@ func (m *CodeInfoResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_CodeInfoResponse proto.InternalMessageInfo
// QueryCodeResponse is the response type for the Query/Code RPC method
type QueryCodeResponse struct {
*CodeInfoResponse `protobuf:"bytes,1,opt,name=code_info,json=codeInfo,proto3,embedded=code_info" json:""`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data"`
@@ -644,6 +660,7 @@ func (m *QueryCodeResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryCodeResponse proto.InternalMessageInfo
// QueryCodesResponse is the response type for the Query/Codes RPC method
type QueryCodesResponse struct {
CodeInfos []CodeInfoResponse `protobuf:"bytes,1,rep,name=code_infos,json=codeInfos,proto3" json:"code_infos"`
}
@@ -704,74 +721,75 @@ func init() {
func init() { proto.RegisterFile("x/wasm/internal/types/query.proto", fileDescriptor_845473e9a3330642) }
var fileDescriptor_845473e9a3330642 = []byte{
// 1071 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0x1b, 0x45,
0x14, 0xce, 0xa4, 0x8e, 0x13, 0x4f, 0x03, 0x98, 0x51, 0x69, 0x8d, 0xeb, 0xae, 0xc3, 0x82, 0xa8,
0x0b, 0xea, 0x6e, 0x12, 0xb7, 0x15, 0x3f, 0x4e, 0x71, 0x5a, 0x29, 0x15, 0x14, 0xd4, 0x8d, 0x50,
// 1074 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xcf, 0xa4, 0x8e, 0x13, 0x4f, 0x53, 0x30, 0xa3, 0xd2, 0x1a, 0xd7, 0x5d, 0x87, 0x05, 0x51,
0x17, 0xd4, 0xdd, 0x24, 0x6e, 0x2b, 0xfe, 0x9c, 0xe2, 0xb4, 0x52, 0x2a, 0x28, 0x88, 0x8d, 0x50,
0x25, 0x7a, 0x88, 0xc6, 0xbb, 0x13, 0x7b, 0x5b, 0x7b, 0xc7, 0xdd, 0x19, 0x93, 0x58, 0x51, 0x84,
0xe0, 0x88, 0x38, 0x20, 0xf5, 0x82, 0xc4, 0x3f, 0x80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fa, 0x74, 0xcb,
0xdc, 0x79, 0xd6, 0xfe, 0x77, 0xc9, 0x6f, 0x08, 0x93, 0xe3, 0xad, 0x9e, 0xdc, 0x1a, 0xc5, 0x23,
0x71, 0x50, 0xe5, 0x6f, 0x9f, 0x36, 0x0d, 0x04, 0xbc, 0xa7, 0x04, 0xdc, 0x22, 0xe5, 0xf1, 0x86,
0x07, 0x45, 0x06, 0x25, 0x7c, 0x8e, 0x53, 0x6a, 0x3b, 0x5f, 0x1b, 0xbd, 0x35, 0x9f, 0xed, 0xe1,
0xd2, 0xf8, 0x40, 0xe0, 0xf5, 0xba, 0xe2, 0xa5, 0x91, 0xc2, 0xa8, 0x8d, 0x4b, 0x36, 0xf1, 0x8c,
0xea, 0x88, 0xe4, 0x92, 0x11, 0x7e, 0xec, 0x18, 0xd1, 0x97, 0x90, 0x71, 0x37, 0xf8, 0x12, 0xca,
0x5f, 0x1f, 0x07, 0xd8, 0x6f, 0xa6, 0x7a, 0x5e, 0x21, 0x5e, 0x24, 0xe4, 0x38, 0x62, 0xc5, 0xda,
0xfb, 0x4b, 0x9b, 0xfa, 0xbe, 0xa7, 0xa1, 0xbd, 0x9e, 0x86, 0xf6, 0x7b, 0x1a, 0xfa, 0xb3, 0xa7,
0xa1, 0x6f, 0x0e, 0xb4, 0xa9, 0xfd, 0x03, 0x6d, 0xea, 0x8f, 0x03, 0x6d, 0xea, 0xd3, 0xc5, 0xd8,
0x58, 0x5a, 0xe5, 0xa2, 0xf9, 0x20, 0xa8, 0xa1, 0x30, 0xcd, 0x6d, 0xb8, 0x0e, 0x7e, 0xc7, 0x55,
0xd3, 0x8a, 0x6a, 0xf9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x5e, 0x6a, 0x4f, 0x37, 0x0e,
0x00, 0x00,
}
func (this *QueryContractInfoRequest) Equal(that interface{}) bool {
@@ -1242,14 +1260,22 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
// ContractInfo gets the contract meta data
ContractInfo(ctx context.Context, in *QueryContractInfoRequest, opts ...grpc.CallOption) (*QueryContractInfoResponse, error)
// ContractHistory gets the contract code history
ContractHistory(ctx context.Context, in *QueryContractHistoryRequest, opts ...grpc.CallOption) (*QueryContractHistoryResponse, error)
// ContractsByCode lists all smart contracts for a code id
ContractsByCode(ctx context.Context, in *QueryContractsByCodeRequest, opts ...grpc.CallOption) (*QueryContractsByCodeResponse, error)
// AllContractState gets all raw store data for a single contract
AllContractState(ctx context.Context, in *QueryAllContractStateRequest, opts ...grpc.CallOption) (*QueryAllContractStateResponse, error)
// RawContractState gets single key from the raw store data of a contract
RawContractState(ctx context.Context, in *QueryRawContractStateRequest, opts ...grpc.CallOption) (*QueryRawContractStateResponse, error)
// SmartContractState get smart query result from the contract
SmartContractState(ctx context.Context, in *QuerySmartContractStateRequest, opts ...grpc.CallOption) (*QuerySmartContractStateResponse, error)
// Code gets the binary code and metadata for a singe wasm code
Code(ctx context.Context, in *QueryCodeRequest, opts ...grpc.CallOption) (*QueryCodeResponse, error)
Codes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*QueryCodesResponse, error)
// Codes gets the metadata for all stored wasm codes
Codes(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*QueryCodesResponse, error)
}
type queryClient struct {
@@ -1323,7 +1349,7 @@ func (c *queryClient) Code(ctx context.Context, in *QueryCodeRequest, opts ...gr
return out, nil
}
func (c *queryClient) Codes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*QueryCodesResponse, error) {
func (c *queryClient) Codes(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*QueryCodesResponse, error) {
out := new(QueryCodesResponse)
err := c.cc.Invoke(ctx, "/wasmd.x.wasmd.v1beta1.Query/Codes", in, out, opts...)
if err != nil {
@@ -1334,14 +1360,22 @@ func (c *queryClient) Codes(ctx context.Context, in *empty.Empty, opts ...grpc.C
// QueryServer is the server API for Query service.
type QueryServer interface {
// ContractInfo gets the contract meta data
ContractInfo(context.Context, *QueryContractInfoRequest) (*QueryContractInfoResponse, error)
// ContractHistory gets the contract code history
ContractHistory(context.Context, *QueryContractHistoryRequest) (*QueryContractHistoryResponse, error)
// ContractsByCode lists all smart contracts for a code id
ContractsByCode(context.Context, *QueryContractsByCodeRequest) (*QueryContractsByCodeResponse, error)
// AllContractState gets all raw store data for a single contract
AllContractState(context.Context, *QueryAllContractStateRequest) (*QueryAllContractStateResponse, error)
// RawContractState gets single key from the raw store data of a contract
RawContractState(context.Context, *QueryRawContractStateRequest) (*QueryRawContractStateResponse, error)
// SmartContractState get smart query result from the contract
SmartContractState(context.Context, *QuerySmartContractStateRequest) (*QuerySmartContractStateResponse, error)
// Code gets the binary code and metadata for a singe wasm code
Code(context.Context, *QueryCodeRequest) (*QueryCodeResponse, error)
Codes(context.Context, *empty.Empty) (*QueryCodesResponse, error)
// Codes gets the metadata for all stored wasm codes
Codes(context.Context, *types.Empty) (*QueryCodesResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@@ -1369,7 +1403,7 @@ func (*UnimplementedQueryServer) SmartContractState(ctx context.Context, req *Qu
func (*UnimplementedQueryServer) Code(ctx context.Context, req *QueryCodeRequest) (*QueryCodeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Code not implemented")
}
func (*UnimplementedQueryServer) Codes(ctx context.Context, req *empty.Empty) (*QueryCodesResponse, error) {
func (*UnimplementedQueryServer) Codes(ctx context.Context, req *types.Empty) (*QueryCodesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Codes not implemented")
}
@@ -1504,7 +1538,7 @@ func _Query_Code_Handler(srv interface{}, ctx context.Context, dec func(interfac
}
func _Query_Codes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(empty.Empty)
in := new(types.Empty)
if err := dec(in); err != nil {
return nil, err
}
@@ -1516,7 +1550,7 @@ func _Query_Codes_Handler(srv interface{}, ctx context.Context, dec func(interfa
FullMethod: "/wasmd.x.wasmd.v1beta1.Query/Codes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Codes(ctx, req.(*empty.Empty))
return srv.(QueryServer).Codes(ctx, req.(*types.Empty))
}
return interceptor(ctx, in, info, handler)
}

View File

@@ -13,9 +13,9 @@ import (
"io"
"net/http"
types_1 "github.com/gogo/protobuf/types"
"github.com/golang/protobuf/descriptor"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/grpc-ecosystem/grpc-gateway/utilities"
"google.golang.org/grpc"
@@ -457,7 +457,7 @@ func local_request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler
}
func request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var protoReq types_1.Empty
var metadata runtime.ServerMetadata
msg, err := client.Codes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
@@ -466,7 +466,7 @@ func request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, cli
}
func local_request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq empty.Empty
var protoReq types_1.Empty
var metadata runtime.ServerMetadata
msg, err := server.Codes(ctx, &protoReq)

View File

@@ -12,27 +12,35 @@ option (gogoproto.equal_all) = true;
// Query provides defines the gRPC querier service
service Query {
// ContractInfo gets the contract meta data
rpc ContractInfo (QueryContractInfoRequest) returns (QueryContractInfoResponse) {
option (google.api.http).get = "/wasm/v1beta1/contract/{address}";
}
// ContractHistory gets the contract code history
rpc ContractHistory (QueryContractHistoryRequest) returns (QueryContractHistoryResponse) {
option (google.api.http).get = "/wasm/v1beta1/contract/{address}/history";
}
// ContractsByCode lists all smart contracts for a code id
rpc ContractsByCode (QueryContractsByCodeRequest) returns (QueryContractsByCodeResponse) {
option (google.api.http).get = "/wasm/v1beta1/code/{code_id}/contracts";
}
// AllContractState gets all raw store data for a single contract
rpc AllContractState (QueryAllContractStateRequest) returns (QueryAllContractStateResponse) {
option (google.api.http).get = "/wasm/v1beta1/contract/{address}/state";
}
// RawContractState gets single key from the raw store data of a contract
rpc RawContractState (QueryRawContractStateRequest) returns (QueryRawContractStateResponse) {
option (google.api.http).get = "/wasm/v1beta1/contract/{address}/raw/{query_data}";
}
// SmartContractState get smart query result from the contract
rpc SmartContractState (QuerySmartContractStateRequest) returns (QuerySmartContractStateResponse) {
option (google.api.http).get = "/wasm/v1beta1/contract/{address}/smart/{query_data}";
}
// Code gets the binary code and metadata for a singe wasm code
rpc Code (QueryCodeRequest) returns (QueryCodeResponse) {
option (google.api.http).get = "/wasm/v1beta1/code/{code_id}";
}
// Codes gets the metadata for all stored wasm codes
rpc Codes (google.protobuf.Empty) returns (QueryCodesResponse) {
option (google.api.http).get = "/wasm/v1beta1/code";
}
@@ -47,18 +55,20 @@ message QueryContractInfoRequest {
message QueryContractInfoResponse {
// address is the address of the contract
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
ContractInfo ContractInfo = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
ContractInfo contract_info = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
}
// QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method
message QueryContractHistoryRequest {
// address is the address of the contract to query
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// QueryContractHistoryResponse is the response type for the Query/ContractHistory RPC method
message QueryContractHistoryResponse {
repeated ContractCodeHistoryEntry entries = 1 [(gogoproto.nullable) = false];
}
// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode RPC method
message QueryContractsByCodeRequest {
uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
}
@@ -66,46 +76,55 @@ message QueryContractsByCodeRequest {
// ContractInfoWithAddress adds the address (key) to the ContractInfo representation
message ContractInfoWithAddress {
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
ContractInfo ContractInfo = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
ContractInfo contract_info = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
}
// QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method
message QueryContractsByCodeResponse {
repeated ContractInfoWithAddress contract_infos = 1 [(gogoproto.nullable) = false];
}
// QueryAllContractStateRequest is the request type for the Query/AllContractState RPC method
message QueryAllContractStateRequest {
// address is the address of the contract
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
}
// QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method
message QueryAllContractStateResponse {
repeated Model models = 1 [(gogoproto.nullable) = false];
}
// QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method
message QueryRawContractStateRequest {
// address is the address of the contract
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
bytes query_data = 2;
}
// QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method
message QueryRawContractStateResponse {
// Data contains the raw store data
bytes data = 1;
}
// QuerySmartContractStateRequest is the request type for the Query/SmartContractState RPC method
message QuerySmartContractStateRequest {
// address is the address of the contract
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// QueryData contains the query data passed to the contract
bytes query_data = 2;
}
// QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method
message QuerySmartContractStateResponse {
// Data contains the json data returned from the smart contract
bytes data = 1 [(gogoproto.casttype) = "encoding/json.RawMessage"];
}
// QueryCodeRequest is the request type for the Query/Code RPC method
message QueryCodeRequest {
uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID
}
// CodeInfoResponse contains code meta data from CodeInfo
message CodeInfoResponse {
uint64 code_id = 1 [(gogoproto.customname) = "CodeID", (gogoproto.jsontag) = "id"]; // id for legacy support
bytes creator = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
@@ -114,11 +133,13 @@ message CodeInfoResponse {
string builder = 5;
}
// QueryCodeResponse is the response type for the Query/Code RPC method
message QueryCodeResponse {
CodeInfoResponse code_info = 1 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
bytes data = 2 [(gogoproto.jsontag) = "data"];
}
// QueryCodesResponse is the response type for the Query/Codes RPC method
message QueryCodesResponse {
repeated CodeInfoResponse code_infos = 1 [(gogoproto.nullable) = false];
}

View File

@@ -46,7 +46,7 @@ func NewCodeInfo(codeHash []byte, creator sdk.AccAddress, source string, builder
}
}
var AllCodeHistoryTypes = []ContractCodeHistoryOperationType{ContractCodeHistoryTypeGenesis, ContractCodeHistoryTypeInit, ContractCodeHistoryTypeMigrate}
var AllCodeHistoryTypes = []ContractCodeHistoryOperationType{ContractCodeHistoryOperationTypeGenesis, ContractCodeHistoryOperationTypeInit, ContractCodeHistoryOperationTypeMigrate}
func (c *ContractHistory) AppendCodeHistory(newEntries ...ContractCodeHistoryEntry) {
c.CodeHistoryEntries = append(c.CodeHistoryEntries, newEntries...)
@@ -83,7 +83,7 @@ func (c *ContractInfo) ValidateBasic() error {
func (c ContractInfo) InitialHistory(initMsg []byte) ContractCodeHistoryEntry {
return ContractCodeHistoryEntry{
Operation: ContractCodeHistoryTypeInit,
Operation: ContractCodeHistoryOperationTypeInit,
CodeID: c.CodeID,
Updated: c.Created,
Msg: initMsg,
@@ -92,7 +92,7 @@ func (c ContractInfo) InitialHistory(initMsg []byte) ContractCodeHistoryEntry {
func (c *ContractInfo) AddMigration(ctx sdk.Context, codeID uint64, msg []byte) ContractCodeHistoryEntry {
h := ContractCodeHistoryEntry{
Operation: ContractCodeHistoryTypeMigrate,
Operation: ContractCodeHistoryOperationTypeMigrate,
CodeID: codeID,
Updated: NewAbsoluteTxPosition(ctx),
Msg: msg,
@@ -105,7 +105,7 @@ func (c *ContractInfo) AddMigration(ctx sdk.Context, codeID uint64, msg []byte)
func (c *ContractInfo) ResetFromGenesis(ctx sdk.Context) ContractCodeHistoryEntry {
c.Created = NewAbsoluteTxPosition(ctx)
return ContractCodeHistoryEntry{
Operation: ContractCodeHistoryTypeGenesis,
Operation: ContractCodeHistoryOperationTypeGenesis,
CodeID: c.CodeID,
Updated: c.Created,
}

View File

@@ -27,54 +27,64 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// AccessType permission types
type AccessType int32
const (
AccessTypeUndefined AccessType = 0
AccessTypeNobody AccessType = 1
// AccessTypeUnspecified placeholder for empty value
AccessTypeUnspecified AccessType = 0
// AccessTypeNobody forbidden
AccessTypeNobody AccessType = 1
// AccessTypeOnlyAddress restricted to an address
AccessTypeOnlyAddress AccessType = 2
AccessTypeEverybody AccessType = 3
// AccessTypeEverybody unrestricted
AccessTypeEverybody AccessType = 3
)
var AccessType_name = map[int32]string{
0: "UNDEFINED",
1: "NOBODY",
2: "ONLY_ADDRESS",
3: "EVERYBODY",
0: "ACCESS_TYPE_UNSPECIFIED",
1: "ACCESS_TYPE_NOBODY",
2: "ACCESS_TYPE_ONLY_ADDRESS",
3: "ACCESS_TYPE_EVERYBODY",
}
var AccessType_value = map[string]int32{
"UNDEFINED": 0,
"NOBODY": 1,
"ONLY_ADDRESS": 2,
"EVERYBODY": 3,
"ACCESS_TYPE_UNSPECIFIED": 0,
"ACCESS_TYPE_NOBODY": 1,
"ACCESS_TYPE_ONLY_ADDRESS": 2,
"ACCESS_TYPE_EVERYBODY": 3,
}
func (AccessType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_45de2b3fc8aff6aa, []int{0}
}
// ContractCodeHistoryOperationType actions that caused a code change
type ContractCodeHistoryOperationType int32
const (
Undefined ContractCodeHistoryOperationType = 0
ContractCodeHistoryTypeInit ContractCodeHistoryOperationType = 1
ContractCodeHistoryTypeMigrate ContractCodeHistoryOperationType = 2
ContractCodeHistoryTypeGenesis ContractCodeHistoryOperationType = 3
// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value
ContractCodeHistoryOperationTypeUnspecified ContractCodeHistoryOperationType = 0
// ContractCodeHistoryOperationTypeInit on chain contract instantiation
ContractCodeHistoryOperationTypeInit ContractCodeHistoryOperationType = 1
// ContractCodeHistoryOperationTypeMigrate code migration
ContractCodeHistoryOperationTypeMigrate ContractCodeHistoryOperationType = 2
// ContractCodeHistoryOperationTypeGenesis based on genesis data
ContractCodeHistoryOperationTypeGenesis ContractCodeHistoryOperationType = 3
)
var ContractCodeHistoryOperationType_name = map[int32]string{
0: "Undefined",
1: "Init",
2: "Migrate",
3: "Genesis",
0: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED",
1: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT",
2: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE",
3: "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS",
}
var ContractCodeHistoryOperationType_value = map[string]int32{
"Undefined": 0,
"Init": 1,
"Migrate": 2,
"Genesis": 3,
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": 0,
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": 1,
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": 2,
"CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": 3,
}
func (x ContractCodeHistoryOperationType) String() string {
@@ -85,6 +95,7 @@ func (ContractCodeHistoryOperationType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_45de2b3fc8aff6aa, []int{1}
}
// AccessTypeParam
type AccessTypeParam struct {
Value AccessType `protobuf:"varint,1,opt,name=value,proto3,enum=wasmd.x.wasmd.v1beta1.AccessType" json:"value,omitempty" yaml:"value"`
}
@@ -122,6 +133,7 @@ func (m *AccessTypeParam) XXX_DiscardUnknown() {
var xxx_messageInfo_AccessTypeParam proto.InternalMessageInfo
// AccessConfig access control type.
type AccessConfig struct {
Permission AccessType `protobuf:"varint,1,opt,name=permission,proto3,enum=wasmd.x.wasmd.v1beta1.AccessType" json:"permission,omitempty" yaml:"permission"`
Address github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=address,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"address,omitempty" yaml:"address"`
@@ -201,11 +213,16 @@ var xxx_messageInfo_Params proto.InternalMessageInfo
// CodeInfo is data for the uploaded contract WASM code
type CodeInfo struct {
CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"`
Creator github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
Builder string `protobuf:"bytes,4,opt,name=builder,proto3" json:"builder,omitempty"`
InstantiateConfig AccessConfig `protobuf:"bytes,5,opt,name=instantiate_config,json=instantiateConfig,proto3" json:"instantiate_config"`
// CodeHash is the unique CodeID
CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"`
// Creator address who initially stored the code
Creator github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
// Source is a valid absolute HTTPS URI to the contract's source code, optional
Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
// Builder is a valid docker image name with tag, optional
Builder string `protobuf:"bytes,4,opt,name=builder,proto3" json:"builder,omitempty"`
// InstantiateConfig access control to apply on contract creation, optional
InstantiateConfig AccessConfig `protobuf:"bytes,5,opt,name=instantiate_config,json=instantiateConfig,proto3" json:"instantiate_config"`
}
func (m *CodeInfo) Reset() { *m = CodeInfo{} }
@@ -243,12 +260,16 @@ var xxx_messageInfo_CodeInfo proto.InternalMessageInfo
// ContractInfo stores a WASM contract instance
type ContractInfo struct {
CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
// CodeID is the reference to the stored WASM code
CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
// Creator address who initially instantiated the contract
Creator github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=creator,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"creator,omitempty"`
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin,omitempty"`
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
// never show this in query results, just use for sorting
// (Note: when using json tag "-" amino refused to serialize it...)
// Admin is an optional address that can execute migrations
Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin,omitempty"`
// Label is optional metadata to be stored with a contract instance.
Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"`
// Created Tx position when the contract was instantiated.
// This data should kept internal and not be exposed via query results. Just use for sorting
Created *AbsoluteTxPosition `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"`
}
@@ -285,6 +306,7 @@ func (m *ContractInfo) XXX_DiscardUnknown() {
var xxx_messageInfo_ContractInfo proto.InternalMessageInfo
// ContractHistory contains a sorted list of code updates to a contract
type ContractHistory struct {
CodeHistoryEntries []ContractCodeHistoryEntry `protobuf:"bytes,1,rep,name=code_history_entries,json=codeHistoryEntries,proto3" json:"code_history_entries"`
}
@@ -322,12 +344,14 @@ func (m *ContractHistory) XXX_DiscardUnknown() {
var xxx_messageInfo_ContractHistory proto.InternalMessageInfo
// ContractCodeHistoryEntry stores code updates to a contract.
// ContractCodeHistoryEntry metadata to a contract.
type ContractCodeHistoryEntry struct {
Operation ContractCodeHistoryOperationType `protobuf:"varint,1,opt,name=operation,proto3,enum=wasmd.x.wasmd.v1beta1.ContractCodeHistoryOperationType" json:"operation,omitempty"`
CodeID uint64 `protobuf:"varint,2,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
Updated *AbsoluteTxPosition `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"`
Msg encoding_json.RawMessage `protobuf:"bytes,4,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"`
// CodeID is the reference to the stored WASM code
CodeID uint64 `protobuf:"varint,2,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"`
// Updated Tx position when the operation was executed.
Updated *AbsoluteTxPosition `protobuf:"bytes,3,opt,name=updated,proto3" json:"updated,omitempty"`
Msg encoding_json.RawMessage `protobuf:"bytes,4,opt,name=msg,proto3,casttype=encoding/json.RawMessage" json:"msg,omitempty"`
}
func (m *ContractCodeHistoryEntry) Reset() { *m = ContractCodeHistoryEntry{} }
@@ -407,9 +431,9 @@ var xxx_messageInfo_AbsoluteTxPosition proto.InternalMessageInfo
// Model is a struct that holds a KV pair
type Model struct {
// hex-encode key to read it better (this is often ascii)
Key github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=Key,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"Key,omitempty"`
Key github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"key,omitempty"`
// base64-encode raw value
Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *Model) Reset() { *m = Model{} }
@@ -462,76 +486,80 @@ func init() {
func init() { proto.RegisterFile("x/wasm/internal/types/types.proto", fileDescriptor_45de2b3fc8aff6aa) }
var fileDescriptor_45de2b3fc8aff6aa = []byte{
// 1096 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0x1b, 0xc5,
0x1b, 0xf6, 0xda, 0x8e, 0x9d, 0x4c, 0xfd, 0x6b, 0xdc, 0xf9, 0x25, 0xe0, 0xb8, 0x65, 0xd7, 0xd9,
0x0a, 0x94, 0x14, 0xd5, 0x26, 0x01, 0x09, 0xd4, 0x5b, 0xfc, 0x87, 0xc6, 0x2d, 0xf9, 0xa3, 0x4d,
0x53, 0x1a, 0x24, 0x64, 0x8d, 0x77, 0x27, 0xf6, 0xd0, 0xdd, 0x19, 0x6b, 0x67, 0x9c, 0xda, 0x39,
0x71, 0x44, 0xe1, 0x82, 0x38, 0x71, 0x89, 0x84, 0x44, 0x0f, 0xfd, 0x02, 0x7c, 0x03, 0x0e, 0xb9,
0x20, 0xf5, 0xc8, 0xc9, 0x82, 0x44, 0x7c, 0x81, 0x1c, 0x73, 0x42, 0x33, 0xb3, 0xc6, 0x86, 0x34,
0x21, 0x54, 0x5c, 0xbc, 0x3b, 0xef, 0x3c, 0xcf, 0xf3, 0xce, 0xfb, 0xcc, 0x3b, 0xeb, 0x01, 0xf3,
0xbd, 0xd2, 0x33, 0xc4, 0x83, 0x12, 0xa1, 0x02, 0x87, 0x14, 0xf9, 0x25, 0xd1, 0xef, 0x60, 0xae,
0x7f, 0x8b, 0x9d, 0x90, 0x09, 0x06, 0x67, 0x25, 0xc0, 0x2b, 0xf6, 0x8a, 0xfa, 0xb9, 0xb7, 0xd4,
0xc4, 0x02, 0x2d, 0xe5, 0x67, 0x5a, 0xac, 0xc5, 0x14, 0xa2, 0x24, 0x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 0x8d, 0x31, 0x11, 0x3d, 0x61,
0x3f, 0x8f, 0x83, 0x4c, 0x85, 0x51, 0x11, 0x22, 0x57, 0x28, 0x1b, 0x6e, 0x83, 0xb4, 0xb2, 0x81,
0x78, 0xca, 0x84, 0x64, 0x19, 0x1c, 0x0f, 0xac, 0x94, 0x72, 0xa9, 0xea, 0xa4, 0xe4, 0x54, 0xdd,
0xfb, 0x6f, 0xed, 0xb8, 0x0f, 0x26, 0x90, 0x17, 0x10, 0xaa, 0xdc, 0x78, 0x2d, 0x29, 0xcd, 0x87,
0x33, 0x60, 0xc2, 0x47, 0x4d, 0xec, 0x47, 0xee, 0xe9, 0x01, 0xac, 0x44, 0x6b, 0xc5, 0x5e, 0x64,
0xd8, 0xe2, 0x45, 0x86, 0x35, 0x39, 0xf3, 0xbb, 0x02, 0x3f, 0xea, 0x6d, 0x32, 0x4e, 0x04, 0x61,
0xd4, 0x19, 0x32, 0xed, 0x7d, 0x30, 0x3d, 0x74, 0x69, 0x95, 0x70, 0xc1, 0xc2, 0x3e, 0x6c, 0x81,
0x19, 0xdd, 0x2f, 0x7a, 0xdc, 0xc0, 0x54, 0x84, 0x04, 0xcb, 0xb3, 0x99, 0x58, 0xb8, 0xb6, 0x5c,
0xba, 0x20, 0xc9, 0x50, 0x45, 0x1a, 0x1a, 0x29, 0xd5, 0xa8, 0x08, 0xfb, 0xd1, 0x0e, 0xa9, 0xc3,
0x3e, 0x16, 0x27, 0x98, 0xdb, 0x5f, 0xc7, 0x41, 0xee, 0x22, 0x1a, 0xdc, 0x06, 0x53, 0xac, 0x83,
0x43, 0x24, 0x46, 0x1f, 0xba, 0x0f, 0xaf, 0x9e, 0x7a, 0x63, 0x48, 0x95, 0x27, 0xd5, 0x19, 0x29,
0x8d, 0x77, 0x41, 0xfc, 0xc2, 0x2e, 0xa8, 0x80, 0x74, 0xb7, 0xe3, 0x29, 0x67, 0x13, 0xff, 0xda,
0xd9, 0x88, 0x09, 0x8b, 0x20, 0x11, 0xf0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d, 0x9a, 0x29, 0x75, 0xd1, 0x79, 0xff, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff,
0x6b, 0xe9, 0x46, 0x0d, 0x3a, 0x09, 0x00, 0x00,
// 1165 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x8f, 0xdb, 0xc4,
0x17, 0x8f, 0x93, 0xfd, 0xd5, 0x69, 0xd4, 0xa6, 0xf3, 0xdd, 0xfd, 0x36, 0x0d, 0x25, 0xc9, 0xba,
0x20, 0xb6, 0xbf, 0x92, 0x76, 0x41, 0x14, 0xf5, 0x96, 0x38, 0x66, 0xd7, 0x85, 0x4d, 0x56, 0x93,
0x2c, 0xed, 0x22, 0x55, 0xd6, 0xc4, 0x9e, 0x4d, 0x86, 0xda, 0x9e, 0xc8, 0x33, 0x69, 0x93, 0x9e,
0x38, 0xa2, 0x70, 0x41, 0x9c, 0xb8, 0x44, 0x42, 0xa2, 0x42, 0xfd, 0x53, 0x7a, 0x41, 0xea, 0x91,
0x53, 0x04, 0x5b, 0x71, 0xe0, 0xba, 0xc7, 0x9e, 0x90, 0xc7, 0x8e, 0x62, 0x68, 0xb7, 0x1b, 0x2a,
0x2e, 0xb6, 0xe7, 0xcd, 0xfb, 0x7c, 0xde, 0xbc, 0xcf, 0x7b, 0xcf, 0x36, 0x58, 0x1f, 0x94, 0x1f,
0x61, 0xee, 0x96, 0xa9, 0x27, 0x88, 0xef, 0x61, 0xa7, 0x2c, 0x86, 0x3d, 0xc2, 0xc3, 0x6b, 0xa9,
0xe7, 0x33, 0xc1, 0xe0, 0x5a, 0xe0, 0x60, 0x97, 0x06, 0xa5, 0xf0, 0xfe, 0xf0, 0x66, 0x9b, 0x08,
0x7c, 0x33, 0xb7, 0xda, 0x61, 0x1d, 0x26, 0x3d, 0xca, 0xc1, 0x53, 0xe8, 0xac, 0xb6, 0xc1, 0xd9,
0x8a, 0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, 0xd4, 0x7c, 0xf4, 0x5b, 0xc4, 0x23, 0x9c, 0xf2,
0xdc, 0x42, 0x50, 0xac, 0x2a, 0x7a, 0xf6, 0x7b, 0x3e, 0xf1, 0xf4, 0x30, 0xaf, 0x3c, 0x3b, 0xcc,
0x2b, 0xcf, 0x0f, 0xf3, 0xca, 0x6f, 0x87, 0x79, 0xe5, 0xbb, 0x17, 0xf9, 0xc4, 0xf3, 0x17, 0xf9,
0xc4, 0xaf, 0x2f, 0xf2, 0x89, 0x2f, 0x6f, 0xc4, 0xe6, 0x40, 0x63, 0xdc, 0x0d, 0x3e, 0xa6, 0xf2,
0x3f, 0xd1, 0x2e, 0x0f, 0xa2, 0xfb, 0xdf, 0x7f, 0x18, 0xdb, 0x4b, 0xf2, 0xf7, 0xef, 0xc3, 0xbf,
0x02, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x52, 0xdd, 0xfe, 0x50, 0x0a, 0x00, 0x00,
}
func (this *AccessTypeParam) Equal(that interface{}) bool {

View File

@@ -7,20 +7,27 @@ option go_package = "github.com/CosmWasm/wasmd/x/wasmd/internal/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;
// AccessType permission types
enum AccessType {
option (gogoproto.goproto_enum_prefix) = false;
option (gogoproto.goproto_enum_stringer) = false;
UNDEFINED = 0 [(gogoproto.enumvalue_customname) = "AccessTypeUndefined"];
NOBODY = 1 [(gogoproto.enumvalue_customname) = "AccessTypeNobody"];
ONLY_ADDRESS = 2 [(gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress"];
EVERYBODY = 3 [(gogoproto.enumvalue_customname) = "AccessTypeEverybody"];
// AccessTypeUnspecified placeholder for empty value
ACCESS_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "AccessTypeUnspecified"];
// AccessTypeNobody forbidden
ACCESS_TYPE_NOBODY = 1 [(gogoproto.enumvalue_customname) = "AccessTypeNobody"];
// AccessTypeOnlyAddress restricted to an address
ACCESS_TYPE_ONLY_ADDRESS = 2 [(gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress"];
// AccessTypeEverybody unrestricted
ACCESS_TYPE_EVERYBODY = 3 [(gogoproto.enumvalue_customname) = "AccessTypeEverybody"];
}
// AccessTypeParam
message AccessTypeParam {
option (gogoproto.goproto_stringer) = true;
AccessType value = 1 [(gogoproto.moretags) = "yaml:\"value\""];
}
// AccessConfig access control type.
message AccessConfig {
option (gogoproto.goproto_stringer) = true;
AccessType permission = 1 [(gogoproto.moretags) = "yaml:\"permission\""];
@@ -37,40 +44,57 @@ message Params {
// CodeInfo is data for the uploaded contract WASM code
message CodeInfo {
// CodeHash is the unique CodeID
bytes code_hash = 1;
// Creator address who initially stored the code
bytes creator = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Source is a valid absolute HTTPS URI to the contract's source code, optional
string source = 3;
// Builder is a valid docker image name with tag, optional
string builder = 4;
// InstantiateConfig access control to apply on contract creation, optional
AccessConfig instantiate_config = 5 [(gogoproto.nullable) = false];
}
// ContractInfo stores a WASM contract instance
message ContractInfo {
// CodeID is the reference to the stored Wasm code
uint64 code_id = 1 [(gogoproto.customname) = "CodeID"];
// Creator address who initially instantiated the contract
bytes creator = 2 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Admin is an optional address that can execute migrations
bytes admin = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];
// Label is optional metadata to be stored with a contract instance.
string label = 4;
// never show this in query results, just use for sorting
// (Note: when using json tag "-" amino refused to serialize it...)
// Created Tx position when the contract was instantiated.
// This data should kept internal and not be exposed via query results. Just use for sorting
AbsoluteTxPosition created = 5;
}
// ContractCodeHistoryOperationType actions that caused a code change
enum ContractCodeHistoryOperationType {
option (gogoproto.goproto_enum_prefix) = false;
Undefined = 0;
Init = 1 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryTypeInit"];
Migrate = 2 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryTypeMigrate"];
Genesis = 3 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryTypeGenesis"];
// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value
CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryOperationTypeUnspecified"];
// ContractCodeHistoryOperationTypeInit on chain contract instantiation
CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryOperationTypeInit"];
// ContractCodeHistoryOperationTypeMigrate code migration
CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryOperationTypeMigrate"];
// ContractCodeHistoryOperationTypeGenesis based on genesis data
CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 [(gogoproto.enumvalue_customname) = "ContractCodeHistoryOperationTypeGenesis"];
}
// ContractHistory contains a sorted list of code updates to a contract
message ContractHistory {
repeated ContractCodeHistoryEntry code_history_entries = 1 [(gogoproto.nullable) = false];
}
// ContractCodeHistoryEntry stores code updates to a contract.
// ContractCodeHistoryEntry metadata to a contract.
message ContractCodeHistoryEntry {
ContractCodeHistoryOperationType operation = 1;
// CodeID is the reference to the stored WASM code
uint64 code_id = 2 [(gogoproto.customname) = "CodeID"];
// Updated Tx position when the operation was executed.
AbsoluteTxPosition updated = 3;
bytes msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"];
@@ -87,7 +111,7 @@ message AbsoluteTxPosition {
// Model is a struct that holds a KV pair
message Model {
// hex-encode key to read it better (this is often ascii)
bytes Key = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"];
bytes key = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"];
// base64-encode raw value
bytes Value = 2;
bytes value = 2;
}