Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robert/update protogen #1455

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ docs:
@echo "=========== Generate Complete ============"
@echo

protoVer=v0.2
protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=osmosis-proto-gen-$(protoVer)
containerProtoFmt=osmosis-proto-fmt-$(protoVer)
Expand Down
8 changes: 8 additions & 0 deletions proto/buf.gen.gogo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true
24 changes: 24 additions & 0 deletions proto/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: cosmos
repository: cosmos-proto
branch: main
commit: 1935555c206d4afb9e94615dfd0fad31
digest: b1-TNqW6xj2Pjha5Uoj9a-5uOeRo4mwswKfyqMcN3I_gZ0=
create_time: 2021-12-02T22:04:00.31049Z
- remote: buf.build
owner: cosmos
repository: gogo-proto
branch: main
commit: bee5511075b7499da6178d9e4aaa628b
digest: b1-rrBIustouD-S80cVoZ_rM0qJsmei9AgbXy9GPQu6vxg=
create_time: 2021-12-02T20:01:17.069307Z
- remote: buf.build
owner: googleapis
repository: googleapis
branch: main
commit: 40f07f5b563941f2b20b991a7aedd53d
digest: b1-Iv8fTR4AKXwNW80Ey6K5tY8cP053y_95sB5fro9IWZo=
create_time: 2021-12-02T15:07:41.896892Z
3 changes: 3 additions & 0 deletions proto/buf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Protobufs

This is the public protocol buffers API for the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk).
27 changes: 27 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
# remove this comment when you're finished.
#
# This module represents the "proto" root found in
# the previous configuration.
version: v1
name: buf.build/cosmos/cosmos-sdk
deps:
- buf.build/cosmos/cosmos-proto
- buf.build/cosmos/gogo-proto
- buf.build/googleapis/googleapis
breaking:
use:
- FILE
lint:
use:
- DEFAULT
- COMMENTS
- FILE_LOWER_SNAKE_CASE
except:
- UNARY_RPC
- COMMENT_FIELD
- SERVICE_SUFFIX
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_STANDARD_NAME
ignore:
- tendermint
158 changes: 158 additions & 0 deletions proto/cosmos/base/abci/v1beta1/abci.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
syntax = "proto3";
package cosmos.base.abci.v1beta1;

import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;

// TxResponse defines a structure containing relevant tx data and metadata. The
// tags are stringified and the log is JSON decoded.
message TxResponse {
option (gogoproto.goproto_getters) = false;
// The block height
int64 height = 1;
// The transaction hash.
string txhash = 2 [(gogoproto.customname) = "TxHash"];
// Namespace for the Code
string codespace = 3;
// Response code.
uint32 code = 4;
// Result bytes, if any.
string data = 5;
// The output of the application's logger (raw string). May be
// non-deterministic.
string raw_log = 6;
// The output of the application's logger (typed). May be non-deterministic.
repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false];
// Additional information. May be non-deterministic.
string info = 8;
// Amount of gas requested for transaction.
int64 gas_wanted = 9;
// Amount of gas consumed by transaction.
int64 gas_used = 10;
// The request transaction bytes.
google.protobuf.Any tx = 11;
// Time of the previous block. For heights > 1, it's the weighted median of
// the timestamps of the valid votes in the block.LastCommit. For height == 1,
// it's genesis time.
string timestamp = 12;
// Events defines all the events emitted by processing a transaction. Note,
// these events include those emitted by processing all the messages and those
// emitted from the ante handler. Whereas Logs contains the events, with
// additional metadata, emitted only by processing the messages.
//
// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false];
}

// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
message ABCIMessageLog {
option (gogoproto.stringer) = true;

uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"];
string log = 2;

// Events contains a slice of Event objects that were emitted during some
// execution.
repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false];
}

// StringEvent defines en Event object wrapper where all the attributes
// contain key/value pairs that are strings instead of raw bytes.
message StringEvent {
option (gogoproto.stringer) = true;

string type = 1;
repeated Attribute attributes = 2 [(gogoproto.nullable) = false];
}

// Attribute defines an attribute wrapper where the key and value are
// strings instead of raw bytes.
message Attribute {
string key = 1;
string value = 2;
}

// GasInfo defines tx execution gas context.
message GasInfo {
// GasWanted is the maximum units of work we allow this tx to perform.
uint64 gas_wanted = 1;

// GasUsed is the amount of gas actually consumed.
uint64 gas_used = 2;
}

// Result is the union of ResponseFormat and ResponseCheckTx.
message Result {
option (gogoproto.goproto_getters) = false;

// Data is any data returned from message or handler execution. It MUST be
// length prefixed in order to separate data from multiple message executions.
// Deprecated. This field is still populated, but prefer msg_response instead
// because it also contains the Msg response typeURL.
bytes data = 1 [deprecated = true];

// Log contains the log information from message or handler execution.
string log = 2;

// Events contains a slice of Event objects that were emitted during message
// or handler execution.
repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false];

// msg_responses contains the Msg handler responses type packed in Anys.
//
// Since: cosmos-sdk 0.46
repeated google.protobuf.Any msg_responses = 4;
}

// SimulationResponse defines the response generated when a transaction is
// successfully simulated.
message SimulationResponse {
GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
Result result = 2;
}

// MsgData defines the data returned in a Result object during message
// execution.
message MsgData {
option deprecated = true;
option (gogoproto.stringer) = true;

string msg_type = 1;
bytes data = 2;
}

// TxMsgData defines a list of MsgData. A transaction will have a MsgData object
// for each message.
message TxMsgData {
option (gogoproto.stringer) = true;

// data field is deprecated and not populated.
repeated MsgData data = 1 [deprecated = true];

// msg_responses contains the Msg handler responses packed into Anys.
//
// Since: cosmos-sdk 0.46
repeated google.protobuf.Any msg_responses = 2;
}

// SearchTxsResult defines a structure for querying txs pageable
message SearchTxsResult {
option (gogoproto.stringer) = true;

// Count of all txs
uint64 total_count = 1;
// Count of txs in current page
uint64 count = 2;
// Index of current page, start from 1
uint64 page_number = 3;
// Count of total pages
uint64 page_total = 4;
// Max count txs per page
uint64 limit = 5;
// List of txs in current page
repeated TxResponse txs = 6;
}
17 changes: 17 additions & 0 deletions proto/cosmos/base/kv/v1beta1/kv.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package cosmos.base.kv.v1beta1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types/kv";

// Pairs defines a repeated slice of Pair objects.
message Pairs {
repeated Pair pairs = 1 [(gogoproto.nullable) = false];
}

// Pair defines a key/value bytes tuple.
message Pair {
bytes key = 1;
bytes value = 2;
}
56 changes: 56 additions & 0 deletions proto/cosmos/base/query/v1beta1/pagination.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
syntax = "proto3";
package cosmos.base.query.v1beta1;

option go_package = "github.com/cosmos/cosmos-sdk/types/query";

// PageRequest is to be embedded in gRPC request messages for efficient
// pagination. Ex:
//
// message SomeRequest {
// Foo some_parameter = 1;
// PageRequest pagination = 2;
// }
message PageRequest {
// key is a value returned in PageResponse.next_key to begin
// querying the next page most efficiently. Only one of offset or key
// should be set.
bytes key = 1;

// offset is a numeric offset that can be used when key is unavailable.
// It is less efficient than using key. Only one of offset or key should
// be set.
uint64 offset = 2;

// limit is the total number of results to be returned in the result page.
// If left empty it will default to a value to be set by each app.
uint64 limit = 3;

// count_total is set to true to indicate that the result set should include
// a count of the total number of items available for pagination in UIs.
// count_total is only respected when offset is used. It is ignored when key
// is set.
bool count_total = 4;

// reverse is set to true if results are to be returned in the descending order.
//
// Since: cosmos-sdk 0.43
bool reverse = 5;
}

// PageResponse is to be embedded in gRPC response messages where the
// corresponding request message has used PageRequest.
//
// message SomeResponse {
// repeated Bar results = 1;
// PageResponse page = 2;
// }
message PageResponse {
// next_key is the key to be passed to PageRequest.key to
// query the next page most efficiently. It will be empty if
// there are no more results.
bytes next_key = 1;

// total is total number of results available if PageRequest.count_total
// was set, its value is undefined otherwise
uint64 total = 2;
}
44 changes: 44 additions & 0 deletions proto/cosmos/base/reflection/v1beta1/reflection.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";
package cosmos.base.reflection.v1beta1;

import "google/api/annotations.proto";

option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection";

// ReflectionService defines a service for interface reflection.
service ReflectionService {
// ListAllInterfaces lists all the interfaces registered in the interface
// registry.
rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces";
};

// ListImplementations list all the concrete types that implement a given
// interface.
rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/"
"{interface_name}/implementations";
};
}

// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC.
message ListAllInterfacesRequest {}

// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC.
message ListAllInterfacesResponse {
// interface_names is an array of all the registered interfaces.
repeated string interface_names = 1;
}

// ListImplementationsRequest is the request type of the ListImplementations
// RPC.
message ListImplementationsRequest {
// interface_name defines the interface to query the implementations for.
string interface_name = 1;
}

// ListImplementationsResponse is the response type of the ListImplementations
// RPC.
message ListImplementationsResponse {
repeated string implementation_message_names = 1;
}
Loading