Skip to content

Commit

Permalink
chore: proto format (#13685)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Oct 28, 2022
1 parent dd78ce9 commit 348734a
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 230 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ proto-swagger-gen:

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
find ./ -name "*.proto" -exec clang-format -i {} \; ; fi


Expand Down
56 changes: 28 additions & 28 deletions client/v2/internal/testpb/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,42 @@ service Query {

message EchoRequest {
// u32 is an uint32
uint32 u32 = 1;
uint64 u64 = 2;
string str = 3;
bytes bz = 4;
google.protobuf.Timestamp timestamp = 5;
google.protobuf.Duration duration = 6;
int32 i32 = 7;
int64 i64 = 10;
bool a_bool = 15;
Enum an_enum = 16;
AMessage a_message = 17;
cosmos.base.v1beta1.Coin a_coin = 18;
uint32 u32 = 1;
uint64 u64 = 2;
string str = 3;
bytes bz = 4;
google.protobuf.Timestamp timestamp = 5;
google.protobuf.Duration duration = 6;
int32 i32 = 7;
int64 i64 = 10;
bool a_bool = 15;
Enum an_enum = 16;
AMessage a_message = 17;
cosmos.base.v1beta1.Coin a_coin = 18;
string an_address = 19 [(cosmos_proto.scalar) = "cosmos.AddressString"];
cosmos.base.query.v1beta1.PageRequest page = 20;
repeated bool bools = 21;
repeated uint32 uints = 22;
repeated string strings = 23;
repeated Enum enums = 24;
repeated google.protobuf.Duration durations = 25;
repeated AMessage some_messages = 26;

int32 positional1 = 27;
string positional2 = 28;
cosmos.base.query.v1beta1.PageRequest page = 20;
repeated bool bools = 21;
repeated uint32 uints = 22;
repeated string strings = 23;
repeated Enum enums = 24;
repeated google.protobuf.Duration durations = 25;
repeated AMessage some_messages = 26;

int32 positional1 = 27;
string positional2 = 28;
repeated cosmos.base.v1beta1.Coin positional3_varargs = 29;

string deprecated_field = 30;
string deprecated_field = 30;
string shorthand_deprecated_field = 31;
bool hidden_bool = 32;
bool hidden_bool = 32;
}

enum Enum {
ENUM_UNSPECIFIED = 0;
ENUM_ONE = 1;
ENUM_TWO = 2;
ENUM_FIVE = 5;
ENUM_NEG_THREE = -3;
ENUM_ONE = 1;
ENUM_TWO = 2;
ENUM_FIVE = 5;
ENUM_NEG_THREE = -3;
}

message AMessage {
Expand Down
23 changes: 11 additions & 12 deletions orm/internal/testpb/bank_query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import "testpb/bank.proto";
// BankQuery queries the state of the tables specified by testpb/bank.proto.
service BankQuery {
// Get queries the Balance table by its primary key.
rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse) {}
rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse) {}
// ListBalance queries the Balance table using prefix and range queries against defined indexes.
rpc ListBalance (ListBalanceRequest) returns (ListBalanceResponse) {}
rpc ListBalance(ListBalanceRequest) returns (ListBalanceResponse) {}
// Get queries the Supply table by its primary key.
rpc GetSupply (GetSupplyRequest) returns (GetSupplyResponse) {}
rpc GetSupply(GetSupplyRequest) returns (GetSupplyResponse) {}
// ListSupply queries the Supply table using prefix and range queries against defined indexes.
rpc ListSupply (ListSupplyRequest) returns (ListSupplyResponse) {}
rpc ListSupply(ListSupplyRequest) returns (ListSupplyResponse) {}
}

// GetBalanceRequest is the BankQuery/GetBalanceRequest request type.
Expand Down Expand Up @@ -42,7 +42,7 @@ message ListBalanceRequest {
// denom specifies the value of the Denom index key to use in the query.
Denom denom = 2;
}

message AddressDenom {
// address is the value of the address field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
Expand All @@ -51,14 +51,14 @@ message ListBalanceRequest {
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 2;
}

message Denom {
// denom is the value of the denom field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 1;
}
}

// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
Expand All @@ -68,7 +68,7 @@ message ListBalanceRequest {
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;

// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
Expand Down Expand Up @@ -110,14 +110,14 @@ message ListSupplyRequest {
// denom specifies the value of the Denom index key to use in the query.
Denom denom = 1;
}

message Denom {
// denom is the value of the denom field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 1;
}
}

// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
Expand All @@ -127,7 +127,7 @@ message ListSupplyRequest {
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;

// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
Expand All @@ -147,4 +147,3 @@ message ListSupplyResponse {
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

Loading

0 comments on commit 348734a

Please sign in to comment.