Skip to content

Commit

Permalink
feat(wasm): apply upstream wasmd version v0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongwoo Lee authored Jul 20, 2021
2 parents e6047cb + 577c2c0 commit 53f2410
Show file tree
Hide file tree
Showing 131 changed files with 5,181 additions and 2,446 deletions.
27 changes: 21 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,70 @@ require (
github.com/confio/ics23/go v0.6.6
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ledger-cosmos-go v0.11.1
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de
github.com/dgraph-io/ristretto v0.0.3
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25
github.com/go-kit/kit v0.11.0
github.com/go-lintpack/lintpack v0.5.2 // indirect
github.com/gogo/gateway v1.1.0
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.4.4
github.com/golang/protobuf v1.5.2
github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 // indirect
github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 // indirect
github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee // indirect
github.com/golangci/golangci-lint v1.41.1 // indirect
github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc // indirect
github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 // indirect
github.com/google/gofuzz v1.2.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5 // indirect
github.com/klauspost/cpuid v1.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/line/iavl/v2 v2.0.0-init.1.0.20210602045707-fddfe1f85001
github.com/line/ostracon v0.34.9-0.20210610071151-a52812ac9add
github.com/line/tm-db/v2 v2.0.0-init.1.0.20210413083915-5bb60e117524
github.com/line/wasmvm v0.14.0-0.5.0
github.com/line/wasmvm v0.14.0-0.6.1
github.com/magiconair/properties v1.8.5
github.com/mailru/easyjson v0.7.7
github.com/mattn/go-isatty v0.0.12
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.15.0 // indirect
github.com/onsi/gomega v1.10.5 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/onsi/ginkgo v1.16.1 // indirect
github.com/onsi/gomega v1.11.0 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.29.0
github.com/rakyll/statik v0.1.7
github.com/regen-network/cosmos-proto v0.3.1
github.com/rs/zerolog v1.23.0
github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada // indirect
github.com/spf13/afero v1.3.4 // indirect
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v1.1.3
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
github.com/tendermint/btcd v0.1.1
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
github.com/tendermint/go-amino v0.16.0
github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa // indirect
github.com/ugorji/go v1.1.4 // indirect
golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
google.golang.org/grpc v1.39.0
google.golang.org/protobuf v1.27.1
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.4.0
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 // indirect
)

replace (
Expand Down
420 changes: 408 additions & 12 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ syntax = "proto3";
package cosmwasm.wasm.v1beta1;

import "gogoproto/gogo.proto";
import "types.proto";
import "tx.proto";
import "cosmwasm/wasm/v1beta1/types.proto";
import "cosmwasm/wasm/v1beta1/tx.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";

// GenesisState - genesis state of x/wasm
message GenesisState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cosmwasm.wasm.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;

// MsgIBCSend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cosmwasm.wasm.v1beta1;

import "gogoproto/gogo.proto";
import "lfb/base/v1beta1/coin.proto";
import "types.proto";
import "cosmwasm/wasm/v1beta1/types.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;
Expand Down Expand Up @@ -43,7 +43,7 @@ message InstantiateContractProposal {
// 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"];
bytes init_msg = 7;
// Funds coins that are transferred to the contract on instantiation
repeated lfb.base.v1beta1.Coin funds = 8
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lfb-sdk/types.Coins"];
Expand All @@ -62,7 +62,7 @@ message MigrateContractProposal {
// 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"];
bytes migrate_msg = 6;
}

// UpdateAdminProposal gov proposal content type to set an admin for a contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ syntax = "proto3";
package cosmwasm.wasm.v1beta1;

import "gogoproto/gogo.proto";
import "types.proto";
import "cosmwasm/wasm/v1beta1/types.proto";
import "google/api/annotations.proto";
import "lfb/base/query/v1beta1/pagination.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = false;

Expand Down Expand Up @@ -57,7 +57,7 @@ message QueryContractInfoResponse {

// address is the address of the contract
string address = 1;
ContractInfo contract_info = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
ContractInfo contract_info = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.jsontag) = ""];
}

// QueryContractHistoryRequest is the request type for the Query/ContractHistory RPC method
Expand All @@ -82,16 +82,12 @@ message QueryContractsByCodeRequest {
lfb.base.query.v1beta1.PageRequest pagination = 2;
}

// ContractInfoWithAddress adds the address (key) to the ContractInfo representation
message ContractInfoWithAddress {
option (gogoproto.equal) = true;

string address = 1;
ContractInfo contract_info = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""];
}
// QueryContractsByCodeResponse is the response type for the Query/ContractsByCode RPC method
// QueryContractsByCodeResponse is the response type for the
// Query/ContractsByCode RPC method
message QueryContractsByCodeResponse {
repeated ContractInfoWithAddress contract_infos = 1 [(gogoproto.nullable) = false];
// contracts are a set of contract addresses
repeated string contracts = 1;

// pagination defines the pagination in the response.
lfb.base.query.v1beta1.PageResponse pagination = 2;
}
Expand All @@ -104,35 +100,40 @@ message QueryAllContractStateRequest {
lfb.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryAllContractStateResponse is the response type for the Query/AllContractState RPC method
// QueryAllContractStateResponse is the response type for the
// Query/AllContractState RPC method
message QueryAllContractStateResponse {
repeated Model models = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
lfb.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryRawContractStateRequest is the request type for the Query/RawContractState RPC method
// QueryRawContractStateRequest is the request type for the
// Query/RawContractState RPC method
message QueryRawContractStateRequest {
// address is the address of the contract
string address = 1;
bytes query_data = 2;
}

// QueryRawContractStateResponse is the response type for the Query/RawContractState RPC method
// 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
// QuerySmartContractStateRequest is the request type for the
// Query/SmartContractState RPC method
message QuerySmartContractStateRequest {
// address is the address of the contract
string address = 1;
// QueryData contains the query data passed to the contract
bytes query_data = 2;
}

// QuerySmartContractStateResponse is the response type for the Query/SmartContractState RPC method
// 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"];
Expand All @@ -147,7 +148,8 @@ message QueryCodeRequest {
message CodeInfoResponse {
option (gogoproto.equal) = true;

uint64 code_id = 1 [(gogoproto.customname) = "CodeID", (gogoproto.jsontag) = "id"]; // id for legacy support
uint64 code_id = 1 [(gogoproto.customname) = "CodeID",
(gogoproto.jsontag) = "id"]; // id for legacy support
string creator = 2;
bytes data_hash = 3 [(gogoproto.casttype) = "github.com/line/ostracon/libs/bytes.HexBytes"];
string source = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cosmwasm.wasm.v1beta1;

import "lfb/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
import "types.proto";
import "cosmwasm/wasm/v1beta1/types.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;

// Msg defines the wasm Msg service.
Expand All @@ -14,7 +14,7 @@ service Msg {
rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);
// Instantiate creates a new smart contract instance for the given code id.
rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse);
// Store Wasm code and Instantiate a new contract
// StoreCodeAndInstantiatecontract upload code and instantiate a contract using it.
rpc StoreCodeAndInstantiateContract(MsgStoreCodeAndInstantiateContract)
returns (MsgStoreCodeAndInstantiateContractResponse);
// Execute submits the given message data to a smart contract
Expand All @@ -35,11 +35,13 @@ message MsgStoreCode {
string sender = 1;
// WASMByteCode can be raw or gzip compressed
bytes wasm_byte_code = 2 [(gogoproto.customname) = "WASMByteCode"];
// Source is a valid absolute HTTPS URI to the contract's source code, optional
// 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;
// InstantiatePermission access control to apply on contract creation, optional
// InstantiatePermission access control to apply on contract creation,
// optional
AccessConfig instantiate_permission = 5;
}
// MsgStoreCodeResponse returns store result data.
Expand All @@ -48,7 +50,8 @@ message MsgStoreCodeResponse {
uint64 code_id = 1 [(gogoproto.customname) = "CodeID"];
}

// MsgInstantiateContract create a new smart contract instance for the given code id.
// MsgInstantiateContract create a new smart contract instance for the given
// code id.
message MsgInstantiateContract {
// Sender is the that actor that signed the messages
string sender = 1;
Expand All @@ -59,7 +62,7 @@ message MsgInstantiateContract {
// 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"];
bytes init_msg = 5;
// Funds coins that are transferred to the contract on instantiation
repeated lfb.base.v1beta1.Coin funds = 6
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lfb-sdk/types.Coins"];
Expand Down Expand Up @@ -111,9 +114,9 @@ message MsgExecuteContract {
// Contract is the address of the smart contract
string contract = 2;
// Msg json encoded message to be passed to the contract
bytes msg = 3 [(gogoproto.casttype) = "encoding/json.RawMessage"];
bytes msg = 3;
// Funds coins that are transferred to the contract on execution
repeated lfb.base.v1beta1.Coin funds = 5
repeated lfb.base.v1beta1.Coin funds = 4
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/line/lfb-sdk/types.Coins"];
}

Expand All @@ -132,7 +135,7 @@ message MsgMigrateContract {
// 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"];
bytes migrate_msg = 4;
}

// MsgMigrateContractResponse returns contract migration result data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
syntax = "proto3";
package cosmwasm.wasm.v1beta1;

import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/line/lfb-sdk/x/wasm/internal/types";
option go_package = "github.com/line/lfb-sdk/x/wasm/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

Expand Down Expand Up @@ -67,7 +69,8 @@ message CodeInfo {
bytes code_hash = 1;
// Creator address who initially stored the code
string creator = 2;
// Source is a valid absolute HTTPS URI to the contract's source code, optional
// 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;
Expand All @@ -88,11 +91,15 @@ message ContractInfo {
// Label is optional metadata to be stored with a contract instance.
string label = 4;
// Created Tx position when the contract was instantiated.
// This data should kept internal and not be exposed via query results. Just use for sorting
// This data should kept internal and not be exposed via query results. Just
// use for sorting
AbsoluteTxPosition created = 5;
string ibc_port_id = 6 [(gogoproto.customname) = "IBCPortID"];
// Status is a status of a contract
ContractStatus status = 7;
// Extension is an extension point to store custom metadata within the
// persistence model.
google.protobuf.Any extension = 8 [(cosmos_proto.accepts_interface) = "ContractInfoExtension"];
}

// ContractCodeHistoryOperationType actions that caused a code change
Expand Down Expand Up @@ -122,11 +129,13 @@ message ContractCodeHistoryEntry {
bytes msg = 4 [(gogoproto.casttype) = "encoding/json.RawMessage"];
}

// AbsoluteTxPosition is a unique transaction position that allows for global ordering of transactions.
// AbsoluteTxPosition is a unique transaction position that allows for global
// ordering of transactions.
message AbsoluteTxPosition {
// BlockHeight is the block the contract was created at
uint64 block_height = 1;
// TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed)
// TxIndex is a monotonic counter within the block (actual transaction index,
// or gas consumed)
uint64 tx_index = 2;
}

Expand All @@ -136,4 +145,4 @@ message Model {
bytes key = 1 [(gogoproto.casttype) = "github.com/line/ostracon/libs/bytes.HexBytes"];
// base64-encode raw value
bytes value = 2;
}
}
3 changes: 1 addition & 2 deletions scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ protoc_gen_gocosmos() {

protoc_gen_gocosmos

proto_dirs=$(find ./proto ./x/wasm/internal/types -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
buf protoc \
-I "proto" \
-I "third_party/proto" \
-I "x/wasm/internal/types" \
--gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/line/lfb-sdk/codec/types:. \
--grpc-gateway_out=logtostderr=true:. \
Expand Down
Loading

0 comments on commit 53f2410

Please sign in to comment.