Skip to content

Commit

Permalink
chore: Audit x/staking and add "Since" proto comments (#11920)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed May 10, 2022
1 parent 9d8beff commit 6872cae
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 3 deletions.
6 changes: 6 additions & 0 deletions proto/cosmos/auth/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ service Query {
}

// ModuleAccounts returns all the existing module accounts.
//
// Since: cosmos-sdk 0.46
rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) {
option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts";
}
Expand Down Expand Up @@ -85,6 +87,8 @@ message QueryAccountRequest {
}

// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method.
//
// Since: cosmos-sdk 0.46
message QueryModuleAccountsRequest {}

// QueryParamsResponse is the response type for the Query/Params RPC method.
Expand All @@ -103,6 +107,8 @@ message QueryAccountResponse {
message QueryParamsRequest {}

// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method.
//
// Since: cosmos-sdk 0.46
message QueryModuleAccountsResponse {
repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"];
}
Expand Down
12 changes: 12 additions & 0 deletions proto/cosmos/bank/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ service Query {

// SpendableBalances queries the spenable balance of all coins for a single
// account.
//
// Since: cosmos-sdk 0.46
rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}";
}
Expand Down Expand Up @@ -56,6 +58,8 @@ service Query {

// DenomOwners queries for all account addresses that own a particular token
// denomination.
//
// Since: cosmos-sdk 0.46
rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}";
}
Expand Down Expand Up @@ -104,6 +108,8 @@ message QueryAllBalancesResponse {

// QuerySpendableBalancesRequest defines the gRPC request structure for querying
// an account's spendable balances.
//
// Since: cosmos-sdk 0.46
message QuerySpendableBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
Expand All @@ -117,6 +123,8 @@ message QuerySpendableBalancesRequest {

// QuerySpendableBalancesResponse defines the gRPC response structure for querying
// an account's spendable balances.
//
// Since: cosmos-sdk 0.46
message QuerySpendableBalancesResponse {
// balances is the spendable balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1
Expand Down Expand Up @@ -214,6 +222,8 @@ message QueryDenomOwnersRequest {
// DenomOwner defines structure representing an account that owns or holds a
// particular denominated token. It contains the account address and account
// balance of the denominated token.
//
// Since: cosmos-sdk 0.46
message DenomOwner {
// address defines the address that owns a particular denomination.
string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
Expand All @@ -223,6 +233,8 @@ message DenomOwner {
}

// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query.
//
// Since: cosmos-sdk 0.46
message QueryDenomOwnersResponse {
repeated DenomOwner denom_owners = 1;

Expand Down
14 changes: 14 additions & 0 deletions proto/cosmos/base/snapshots/v1beta1/snapshot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ message Metadata {
}

// SnapshotItem is an item contained in a rootmulti.Store snapshot.
//
// Since: cosmos-sdk 0.46
message SnapshotItem {
// item is the specific type of snapshot item.
oneof item {
Expand All @@ -33,11 +35,15 @@ message SnapshotItem {
}

// SnapshotStoreItem contains metadata about a snapshotted store.
//
// Since: cosmos-sdk 0.46
message SnapshotStoreItem {
string name = 1;
}

// SnapshotIAVLItem is an exported IAVL node.
//
// Since: cosmos-sdk 0.46
message SnapshotIAVLItem {
bytes key = 1;
bytes value = 2;
Expand All @@ -48,23 +54,31 @@ message SnapshotIAVLItem {
}

// SnapshotExtensionMeta contains metadata about an external snapshotter.
//
// Since: cosmos-sdk 0.46
message SnapshotExtensionMeta {
string name = 1;
uint32 format = 2;
}

// SnapshotExtensionPayload contains payloads of an external snapshotter.
//
// Since: cosmos-sdk 0.46
message SnapshotExtensionPayload {
bytes payload = 1;
}

// SnapshotKVItem is an exported Key/Value Pair
//
// Since: cosmos-sdk 0.46
message SnapshotKVItem {
bytes key = 1;
bytes value = 2;
}

// SnapshotSchema is an exported schema of smt store
//
// Since: cosmos-sdk 0.46
message SnapshotSchema{
repeated bytes keys = 1;
}
1 change: 1 addition & 0 deletions proto/cosmos/crypto/hd/v1/hd.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.crypto.hd.v1;

Expand Down
1 change: 1 addition & 0 deletions proto/cosmos/crypto/keyring/v1/record.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.crypto.keyring.v1;

Expand Down
7 changes: 6 additions & 1 deletion proto/cosmos/feegrant/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ service Query {
}

// AllowancesByGranter returns all the grants given by an address
// Since v0.46
//
// Since: cosmos-sdk 0.46
rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) {
option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}";
}
Expand Down Expand Up @@ -62,6 +63,8 @@ message QueryAllowancesResponse {
}

// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method.
//
// Since: cosmos-sdk 0.46
message QueryAllowancesByGranterRequest {
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

Expand All @@ -70,6 +73,8 @@ message QueryAllowancesByGranterRequest {
}

// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method.
//
// Since: cosmos-sdk 0.46
message QueryAllowancesByGranterResponse {
// allowances that have been issued by the granter.
repeated cosmos.feegrant.v1beta1.Grant allowances = 1;
Expand Down
8 changes: 8 additions & 0 deletions proto/cosmos/params/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ service Query {
}

// Subspaces queries for all registered subspaces and all keys for a subspace.
//
// Since: cosmos-sdk 0.46
rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) {
option (google.api.http).get = "/cosmos/params/v1beta1/subspaces";
}
Expand All @@ -38,16 +40,22 @@ message QueryParamsResponse {

// QuerySubspacesRequest defines a request type for querying for all registered
// subspaces and all keys for a subspace.
//
// Since: cosmos-sdk 0.46
message QuerySubspacesRequest {}

// QuerySubspacesResponse defines the response types for querying for all
// registered subspaces and all keys for a subspace.
//
// Since: cosmos-sdk 0.46
message QuerySubspacesResponse {
repeated Subspace subspaces = 1;
}

// Subspace defines a parameter subspace name and all the keys that exist for
// the subspace.
//
// Since: cosmos-sdk 0.46
message Subspace {
string subspace = 1;
repeated string keys = 2;
Expand Down
2 changes: 2 additions & 0 deletions proto/cosmos/staking/v1beta1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ message Validator {
// commission defines the commission parameters.
Commission commission = 10 [(gogoproto.nullable) = false];
// min_self_delegation is the validator's self declared minimum self delegation.
//
// Since: cosmos-sdk 0.46
string min_self_delegation = 11 [
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
Expand Down
6 changes: 6 additions & 0 deletions proto/cosmos/staking/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ service Msg {

// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation
// and delegate back to previous validator.
//
// Since: cosmos-sdk 0.46
rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse);
}

Expand Down Expand Up @@ -142,6 +144,8 @@ message MsgUndelegateResponse {
}

// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator
//
// Since: cosmos-sdk 0.46
message MsgCancelUnbondingDelegation{
option (cosmos.msg.v1.signer) = "delegator_address";
option (gogoproto.equal) = false;
Expand All @@ -156,4 +160,6 @@ message MsgCancelUnbondingDelegation{
}

// MsgCancelUnbondingDelegationResponse
//
// Since: cosmos-sdk 0.46
message MsgCancelUnbondingDelegationResponse{}
3 changes: 2 additions & 1 deletion proto/cosmos/upgrade/v1beta1/tx.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.46
syntax = "proto3";
package cosmos.upgrade.v1beta1;

Expand Down Expand Up @@ -52,4 +53,4 @@ message MsgCancelUpgrade {
// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type.
//
// Since: cosmos-sdk 0.46
message MsgCancelUpgradeResponse {}
message MsgCancelUpgradeResponse {}
12 changes: 12 additions & 0 deletions proto/cosmos/vesting/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ service Msg {
rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse);
// CreatePermanentLockedAccount defines a method that enables creating a permanent
// locked account.
//
// Since: cosmos-sdk 0.46
rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse);
// CreatePeriodicVestingAccount defines a method that enables creating a
// periodic vesting account.
//
// Since: cosmos-sdk 0.46
rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse);
}

Expand All @@ -44,6 +48,8 @@ message MsgCreateVestingAccountResponse {}

// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent
// locked account.
//
// Since: cosmos-sdk 0.46
message MsgCreatePermanentLockedAccount {
option (gogoproto.equal) = true;

Expand All @@ -54,10 +60,14 @@ message MsgCreatePermanentLockedAccount {
}

// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type.
//
// Since: cosmos-sdk 0.46
message MsgCreatePermanentLockedAccountResponse {}

// MsgCreateVestingAccount defines a message that enables creating a vesting
// account.
//
// Since: cosmos-sdk 0.46
message MsgCreatePeriodicVestingAccount {
option (cosmos.msg.v1.signer) = "from_address";

Expand All @@ -71,4 +81,6 @@ message MsgCreatePeriodicVestingAccount {

// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount
// response type.
//
// Since: cosmos-sdk 0.46
message MsgCreatePeriodicVestingAccountResponse {}
2 changes: 1 addition & 1 deletion x/staking/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
consensusVersion uint64 = 4
consensusVersion uint64 = 3
)

var (
Expand Down

0 comments on commit 6872cae

Please sign in to comment.