Skip to content

Commit

Permalink
format protobuf files (cosmos#10550)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
  • Loading branch information
cmwaters and tac0turtle authored Nov 16, 2021
1 parent 70a3a90 commit 18eb33f
Show file tree
Hide file tree
Showing 31 changed files with 214 additions and 253 deletions.
21 changes: 9 additions & 12 deletions proto/cosmos/auth/v1beta1/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ message BaseAccount {

option (cosmos_proto.implements_interface) = "AccountI";

string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
google.protobuf.Any pub_key = 2
[(gogoproto.jsontag) = "public_key,omitempty"];
uint64 account_number = 3;
uint64 sequence = 4;
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty"];
uint64 account_number = 3;
uint64 sequence = 4;
}

// ModuleAccount defines an account for modules that holds coins on a pool.
Expand All @@ -40,11 +39,9 @@ message Params {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;

uint64 max_memo_characters = 1;
uint64 tx_sig_limit = 2;
uint64 tx_size_cost_per_byte = 3;
uint64 sig_verify_cost_ed25519 = 4
[(gogoproto.customname) = "SigVerifyCostED25519"];
uint64 sig_verify_cost_secp256k1 = 5
[(gogoproto.customname) = "SigVerifyCostSecp256k1"];
uint64 max_memo_characters = 1;
uint64 tx_sig_limit = 2;
uint64 tx_size_cost_per_byte = 3;
uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"];
uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"];
}
4 changes: 2 additions & 2 deletions proto/cosmos/auth/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ message QueryModuleAccountsResponse {
}

// Bech32PrefixRequest is the request type for Bech32Prefix rpc method
message Bech32PrefixRequest {}
message Bech32PrefixRequest {}

// Bech32PrefixResponse is the response type for Bech32Prefix rpc method
message Bech32PrefixResponse {
message Bech32PrefixResponse {
string bech32_prefix = 1;
}

Expand Down
4 changes: 1 addition & 3 deletions proto/cosmos/authz/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ package cosmos.authz.v1beta1;

import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "cosmos/base/abci/v1beta1/abci.proto";
import "cosmos/authz/v1beta1/authz.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/authz";
Expand Down Expand Up @@ -62,7 +60,7 @@ message MsgGrantResponse {}
// granter's account with that has been granted to the grantee.
message MsgRevoke {
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];;
string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string msg_type_url = 3;
}

Expand Down
13 changes: 7 additions & 6 deletions proto/cosmos/bank/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ service Query {

// QueryBalanceRequest is the request type for the Query/Balance RPC method.
message QueryBalanceRequest {
option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// address is the address to query balances for.
Expand All @@ -75,7 +75,7 @@ message QueryBalanceResponse {

// QueryBalanceRequest is the request type for the Query/AllBalances RPC method.
message QueryAllBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// address is the address to query balances for.
Expand All @@ -90,7 +90,7 @@ message QueryAllBalancesRequest {
message QueryAllBalancesResponse {
// balances is the balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
Expand All @@ -99,7 +99,7 @@ message QueryAllBalancesResponse {
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
// method.
message QueryTotalSupplyRequest {
option (gogoproto.equal) = false;
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// pagination defines an optional pagination for the request.
Expand All @@ -113,7 +113,7 @@ message QueryTotalSupplyRequest {
message QueryTotalSupplyResponse {
// supply is the supply of the coins
repeated cosmos.base.v1beta1.Coin supply = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

// pagination defines the pagination in the response.
//
Expand Down Expand Up @@ -186,7 +186,8 @@ message QueryDenomOwnersRequest {
// balance of the denominated token.
message DenomOwner {
// address defines the address that owns a particular denomination.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];;
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
;

// balance is the balance of the denominated coin for an account.
cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false];
Expand Down
16 changes: 8 additions & 8 deletions proto/cosmos/base/tendermint/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ message GetNodeInfoResponse {

// VersionInfo is the type for the GetNodeInfoResponse message.
message VersionInfo {
string name = 1;
string app_name = 2;
string version = 3;
string git_commit = 4;
string build_tags = 5;
string go_version = 6;
repeated Module build_deps = 7;
string name = 1;
string app_name = 2;
string version = 3;
string git_commit = 4;
string build_tags = 5;
string go_version = 6;
repeated Module build_deps = 7;
// Since: cosmos-sdk 0.43
string cosmos_sdk_version = 8;
string cosmos_sdk_version = 8;
}

// Module is the type for VersionInfo
Expand Down
6 changes: 4 additions & 2 deletions proto/cosmos/base/v1beta1/coin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ message Coin {
option (gogoproto.equal) = true;

string denom = 1;
string amount = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
string amount = 2
[(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false];
}

// DecCoin defines a token with a denomination and a decimal amount.
Expand All @@ -27,7 +28,8 @@ message DecCoin {
option (gogoproto.equal) = true;

string denom = 1;
string amount = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
string amount = 2
[(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false];
}

// IntProto defines a Protobuf wrapper around an Int object.
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/capability/v1beta1/capability.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "gogoproto/gogo.proto";
// provided to a Capability must be globally unique.
message Capability {
option (gogoproto.goproto_stringer) = false;

uint64 index = 1;
}

Expand Down
3 changes: 1 addition & 2 deletions proto/cosmos/crisis/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ import "cosmos/base/v1beta1/coin.proto";
message GenesisState {
// constant_fee is the fee used to verify the invariant in the crisis
// module.
cosmos.base.v1beta1.Coin constant_fee = 3
[(gogoproto.nullable) = false];
cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false];
}
27 changes: 14 additions & 13 deletions proto/cosmos/crypto/hd/v1/hd.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ package cosmos.crypto.hd.v1;

import "gogoproto/gogo.proto";

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

// BIP44Params is used as path field in ledger item in Record.
message BIP44Params {
option (gogoproto.goproto_stringer) = false;
// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation
uint32 purpose = 1;
// coin_type is a constant that improves privacy
uint32 coin_type = 2;
// account splits the key space into independent user identities
uint32 account = 3;
// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal chain.
bool change = 4;
// address_index is used as child index in BIP32 derivation
uint32 address_index = 5;
message BIP44Params {
option (gogoproto.goproto_stringer) = false;
// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation
uint32 purpose = 1;
// coin_type is a constant that improves privacy
uint32 coin_type = 2;
// account splits the key space into independent user identities
uint32 account = 3;
// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal
// chain.
bool change = 4;
// address_index is used as child index in BIP32 derivation
uint32 address_index = 5;
}
18 changes: 9 additions & 9 deletions proto/cosmos/crypto/keyring/v1/record.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@ import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "cosmos/crypto/hd/v1/hd.proto";

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

// Record is used for representing a key in the keyring.
message Record {
// name represents a name of Record
string name = 1;
// pub_key represents a public key in any format
// pub_key represents a public key in any format
google.protobuf.Any pub_key = 2;

// Record contains one of the following items
oneof item {
// local stores the public information about a locally stored key
Local local = 3;
// ledger stores the public information about a Ledger key
Ledger ledger = 4;
Ledger ledger = 4;
// Multi does not store any information.
Multi multi = 5;
// Offline does not store any information.
Offline offline = 6;
Multi multi = 5;
// Offline does not store any information.
Offline offline = 6;
}

// Item is a keyring item stored in a keyring backend.
// Local item
message Local {
google.protobuf.Any priv_key = 1;
string priv_key_type = 2;
google.protobuf.Any priv_key = 1;
string priv_key_type = 2;
}

// Ledger item
// Ledger item
message Ledger {
hd.v1.BIP44Params path = 1;
}
Expand Down
3 changes: 1 addition & 2 deletions proto/cosmos/crypto/multisig/keys.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ message LegacyAminoPubKey {
option (gogoproto.goproto_getters) = false;

uint32 threshold = 1;
repeated google.protobuf.Any public_keys = 2
[(gogoproto.customname) = "PubKeys"];
repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys"];
}
39 changes: 17 additions & 22 deletions proto/cosmos/distribution/v1beta1/distribution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import "cosmos_proto/cosmos.proto";
message Params {
option (gogoproto.goproto_stringer) = false;
string community_tax = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string base_proposer_reward = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string bonus_proposer_reward = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
Expand All @@ -42,10 +42,8 @@ message Params {
// read that record)
// + one per validator for the zeroeth period, set on initialization
message ValidatorHistoricalRewards {
repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
(gogoproto.nullable) = false
];
repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
uint32 reference_count = 2;
}

Expand All @@ -68,10 +66,8 @@ message ValidatorAccumulatedCommission {
// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards
// for a validator inexpensive to track, allows simple sanity checks.
message ValidatorOutstandingRewards {
repeated cosmos.base.v1beta1.DecCoin rewards = 1 [
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins",
(gogoproto.nullable) = false
];
repeated cosmos.base.v1beta1.DecCoin rewards = 1
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
}

// ValidatorSlashEvent represents a validator slash event.
Expand All @@ -80,22 +76,23 @@ message ValidatorOutstandingRewards {
// for delegations which are withdrawn after a slash has occurred.
message ValidatorSlashEvent {
uint64 validator_period = 1;
string fraction = 2 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false];
string fraction = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}

// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages.
message ValidatorSlashEvents {
option (gogoproto.goproto_stringer) = false;
repeated ValidatorSlashEvent validator_slash_events = 1
[(gogoproto.nullable) = false];
repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false];
}

// FeePool is the global fee pool for distribution.
message FeePool {
repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"
];
repeated cosmos.base.v1beta1.DecCoin community_pool = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"];
}

// CommunityPoolSpendProposal details a proposal for use of community funds,
Expand All @@ -122,7 +119,7 @@ message CommunityPoolSpendProposal {
message DelegatorStartingInfo {
uint64 previous_period = 1;
string stake = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
Expand All @@ -135,9 +132,7 @@ message DelegationDelegatorReward {
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = true;

string validator_address = 1 [
(cosmos_proto.scalar) = "cosmos.AddressString"
];
string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

repeated cosmos.base.v1beta1.DecCoin reward = 2
[(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false];
Expand Down
Loading

0 comments on commit 18eb33f

Please sign in to comment.