Skip to content

Commit

Permalink
Fix proto format (#9279)
Browse files Browse the repository at this point in the history
* makefile: fix proto-format

* reformat all proto files

* regenerating proto

* remove dangling semicolon
  • Loading branch information
robert-zaremba authored May 7, 2021
1 parent 1986104 commit 3e4d81c
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 37 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,9 @@ 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 $(containerProtoImage) \
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {}; fi
@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 \
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; ; fi


proto-lint:
@$(DOCKER_BUF) lint --error-format=json
Expand Down
5 changes: 3 additions & 2 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,8 @@ between a store name and the commit ID.

### StoreKVPair
StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes)
It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and Deletes
It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and
Deletes


| Field | Type | Label | Description |
Expand Down Expand Up @@ -7590,7 +7591,7 @@ TxBody is the body of a transaction that all signers sign over.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | messages is a list of messages to be executed. The required signers of those messages define the number and order of elements in AuthInfo's signer_infos and Tx's signatures. Each required signer address is added to the list only the first time it occurs. By convention, the first required signer (usually from the first message) is referred to as the primary signer and pays the fee for the whole transaction. |
| `memo` | [string](#string) | | memo is any arbitrary note/comment to be added to the transaction. In clients, any public exposing text should not be called as memo, should use `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). |
| `memo` | [string](#string) | | memo is any arbitrary note/comment to be added to the transaction. WARNING: in clients, any publicly exposed text should not be called memo, but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). |
| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain |
| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected |
| `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, they will be ignored |
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
option (gogoproto.goproto_getters_all) = false;

// GenericAuthorization gives the grantee unrestricted permissions to execute
Expand Down
10 changes: 5 additions & 5 deletions proto/cosmos/authz/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "cosmos/base/abci/v1beta1/abci.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
option (gogoproto.goproto_getters_all) = false;

// Msg defines the authz Msg service.
Expand Down Expand Up @@ -45,11 +45,11 @@ message MsgExecResponse {
// authorizations granted to the grantee. Each message should have only
// one signer corresponding to the granter of the authorization.
message MsgExec {
string grantee = 1;
string grantee = 1;
// Authorization Msg requests to execute. Each msg must implement Authorization interface
// The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
// triple and validate it.
repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"];;
repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"];
}

// MsgGrantResponse defines the Msg/MsgGrant response type.
Expand All @@ -58,8 +58,8 @@ message MsgGrantResponse {}
// MsgRevoke revokes any authorization with the provided sdk.Msg type on the
// granter's account with that has been granted to the grantee.
message MsgRevoke {
string granter = 1;
string grantee = 2;
string granter = 1;
string grantee = 2;
string msg_type_url = 3;
}

Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/bank/v1beta1/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ message Output {
message Supply {
option deprecated = true;

option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;

option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/exported.SupplyI";

Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/base/reflection/v1beta1/reflection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ service ReflectionService {
// interface.
rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/"
"{interface_name}/implementations";
"{interface_name}/implementations";
};
}

Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/base/reflection/v2alpha1/reflection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ message CodecDescriptor {
message InterfaceDescriptor {
// fullname is the name of the interface
string fullname = 1;
// interface_accepting_messages contains information regarding the proto messages which contain the interface as google.protobuf.Any field
// interface_accepting_messages contains information regarding the proto messages which contain the interface as
// google.protobuf.Any field
repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2;
// interface_implementers is a list of the descriptors of the interface implementers
repeated InterfaceImplementerDescriptor interface_implementers = 3;
Expand Down Expand Up @@ -188,7 +189,6 @@ message GetTxDescriptorResponse {
TxDescriptor tx = 1;
}


// QueryServicesDescriptor contains the list of cosmos-sdk queriable services
message QueryServicesDescriptor {
// query_services is a list of cosmos-sdk QueryServiceDescriptor
Expand Down
9 changes: 5 additions & 4 deletions proto/cosmos/base/store/v1beta1/listening.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ package cosmos.base.store.v1beta1;
option go_package = "github.com/cosmos/cosmos-sdk/store/types";

// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes)
// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and Deletes
// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and
// Deletes
message StoreKVPair {
string store_key = 1; // the store key for the KVStore this pair originates from
bool delete = 2; // true indicates a delete operation, false indicates a set operation
bytes key = 3;
bytes value = 4;
bool delete = 2; // true indicates a delete operation, false indicates a set operation
bytes key = 3;
bytes value = 4;
}
6 changes: 3 additions & 3 deletions proto/cosmos/crypto/secp256r1/keys.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cosmos.crypto.secp256r1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1";
option (gogoproto.messagename_all) = true;
option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1";
option (gogoproto.messagename_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.goproto_getters_all) = false;

// PubKey defines a secp256r1 ECDSA public key.
message PubKey {
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/feegrant/v1beta1/feegrant.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ message AllowedMsgAllowance {
// Grant is stored in the KVStore to record a grant with full context
message Grant {
// granter is the address of the user granting an allowance of their funds.
string granter = 1;
string granter = 1;

// grantee is the address of the user being granted an allowance of another user's funds.
string grantee = 2;
string grantee = 2;

// allowance can be any of basic and filtered fee allowance.
google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/feegrant/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ service Msg {
// of fees from the account of Granter.
message MsgGrantAllowance {
// granter is the address of the user granting an allowance of their funds.
string granter = 1;
string granter = 1;

// grantee is the address of the user being granted an allowance of another user's funds.
string grantee = 2;
string grantee = 2;

// allowance can be any of basic and filtered fee allowance.
google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/staking/v1beta1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ message Params {
string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""];
// power_reduction is the amount of staking tokens required for 1 unit of consensus-engine power
string power_reduction = 6 [
(gogoproto.moretags) = "yaml:\"power_reduction\"",
(gogoproto.moretags) = "yaml:\"power_reduction\"",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
(gogoproto.nullable) = false
];
}

Expand Down
10 changes: 5 additions & 5 deletions proto/cosmos/tx/v1beta1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "gogoproto/gogo.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option (gogoproto.goproto_registration) = true;
option go_package = "github.com/cosmos/cosmos-sdk/types/tx";
option go_package = "github.com/cosmos/cosmos-sdk/types/tx";

// Service defines a gRPC service for interacting with transactions.
service Service {
Expand Down Expand Up @@ -43,17 +43,17 @@ message GetTxsEventRequest {
repeated string events = 1;
// pagination defines an pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
OrderBy order_by = 3;
OrderBy order_by = 3;
}

// OrderBy defines the sorting order
enum OrderBy {
// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case.
ORDER_BY_UNSPECIFIED = 0;
// ORDER_BY_ASC defines ascending order
ORDER_BY_ASC = 1;
ORDER_BY_ASC = 1;
// ORDER_BY_DESC defines descending order
ORDER_BY_DESC = 2;
ORDER_BY_DESC = 2;
}

// GetTxsEventResponse is the response type for the Service.TxsByEvents
Expand Down Expand Up @@ -102,7 +102,7 @@ message BroadcastTxResponse {
message SimulateRequest {
// tx is the transaction to simulate.
// Deprecated. Send raw tx bytes instead.
cosmos.tx.v1beta1.Tx tx = 1 [deprecated=true];
cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true];
// tx_bytes is the raw transaction.
bytes tx_bytes = 2;
}
Expand Down
3 changes: 2 additions & 1 deletion server/grpc/reflection/v2alpha1/reflection.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion store/types/listening.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions types/tx/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e4d81c

Please sign in to comment.