Skip to content

Commit

Permalink
chore: Add "Since:" on proto doc comments (backport #10434) (#10449)
Browse files Browse the repository at this point in the history
* chore: Add "Since:" on proto doc comments (#10434)

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

ref: https://github.com/cosmos/cosmos-sdk/discussions/10406#discussioncomment-1533289

For clients to know whether a protobuf feature is available for a certain SDK version, we decided to use the [`@since` doc comment](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#@since) inside protobuf files.

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

(cherry picked from commit 0a3660d)

# Conflicts:
#	docs/core/proto-docs.md
#	proto/cosmos/bank/v1beta1/bank.proto
#	proto/cosmos/tx/v1beta1/tx.proto
#	types/tx/tx.pb.go
#	x/bank/types/bank.pb.go

* Fix conflicts

Co-authored-by: Amaury <[email protected]>
  • Loading branch information
mergify[bot] and amaury1093 authored Oct 29, 2021
1 parent 7b0b6e0 commit 0ac1f6d
Show file tree
Hide file tree
Showing 40 changed files with 187 additions and 32 deletions.
17 changes: 9 additions & 8 deletions client/grpc/tmservice/query.pb.go

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

90 changes: 67 additions & 23 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,9 @@ pagination. Ex:
| `offset` | [uint64](#uint64) | | 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. |
| `limit` | [uint64](#uint64) | | 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. |
| `count_total` | [bool](#bool) | | 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. |
| `reverse` | [bool](#bool) | | reverse is set to true if results are to be returned in the descending order. |
| `reverse` | [bool](#bool) | | reverse is set to true if results are to be returned in the descending order.

Since: cosmos-sdk 0.43 |



Expand Down Expand Up @@ -798,6 +800,8 @@ QueryAccountResponse is the response type for the Query/Account RPC method.
### QueryAccountsRequest
QueryAccountsRequest is the request type for the Query/Accounts RPC method.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand All @@ -813,6 +817,8 @@ QueryAccountsRequest is the request type for the Query/Accounts RPC method.
### QueryAccountsResponse
QueryAccountsResponse is the response type for the Query/Accounts RPC method.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -862,7 +868,9 @@ Query defines the gRPC querier service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Accounts` | [QueryAccountsRequest](#cosmos.auth.v1beta1.QueryAccountsRequest) | [QueryAccountsResponse](#cosmos.auth.v1beta1.QueryAccountsResponse) | Accounts returns all the existing accounts | GET|/cosmos/auth/v1beta1/accounts|
| `Accounts` | [QueryAccountsRequest](#cosmos.auth.v1beta1.QueryAccountsRequest) | [QueryAccountsResponse](#cosmos.auth.v1beta1.QueryAccountsResponse) | Accounts returns all the existing accounts

Since: cosmos-sdk 0.43 | GET|/cosmos/auth/v1beta1/accounts|
| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}|
| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params|

Expand All @@ -874,7 +882,7 @@ Query defines the gRPC querier service.
<p align="right"><a href="#top">Top</a></p>

## cosmos/authz/v1beta1/authz.proto

Since: cosmos-sdk 0.43


<a name="cosmos.authz.v1beta1.GenericAuthorization"></a>
Expand Down Expand Up @@ -923,7 +931,7 @@ the provide method with expiration time.
<p align="right"><a href="#top">Top</a></p>

## cosmos/authz/v1beta1/event.proto

Since: cosmos-sdk 0.43


<a name="cosmos.authz.v1beta1.EventGrant"></a>
Expand Down Expand Up @@ -973,7 +981,7 @@ EventRevoke is emitted on Msg/Revoke
<p align="right"><a href="#top">Top</a></p>

## cosmos/authz/v1beta1/genesis.proto

Since: cosmos-sdk 0.43


<a name="cosmos.authz.v1beta1.GenesisState"></a>
Expand Down Expand Up @@ -1022,7 +1030,7 @@ GrantAuthorization defines the GenesisState/GrantAuthorization type.
<p align="right"><a href="#top">Top</a></p>

## cosmos/authz/v1beta1/query.proto

Since: cosmos-sdk 0.43


<a name="cosmos.authz.v1beta1.QueryGrantsRequest"></a>
Expand Down Expand Up @@ -1279,7 +1287,7 @@ tags are stringified and the log is JSON decoded.
<p align="right"><a href="#top">Top</a></p>

## cosmos/authz/v1beta1/tx.proto

Since: cosmos-sdk 0.43


<a name="cosmos.authz.v1beta1.MsgExec"></a>
Expand Down Expand Up @@ -1489,6 +1497,8 @@ IntProto defines a Protobuf wrapper around an Int object.
SendAuthorization allows the grantee to spend up to spend_limit coins from
the granter's account.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -1562,8 +1572,12 @@ a basic token.
| `denom_units` | [DenomUnit](#cosmos.bank.v1beta1.DenomUnit) | repeated | denom_units represents the list of DenomUnit's for a given coin |
| `base` | [string](#string) | | base represents the base denom (should be the DenomUnit with exponent = 0). |
| `display` | [string](#string) | | display indicates the suggested denom that should be displayed in clients. |
| `name` | [string](#string) | | name defines the name of the token (eg: Cosmos Atom) |
| `symbol` | [string](#string) | | symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display. |
| `name` | [string](#string) | | name defines the name of the token (eg: Cosmos Atom)

Since: cosmos-sdk 0.43 |
| `symbol` | [string](#string) | | symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display.

Since: cosmos-sdk 0.43 |



Expand Down Expand Up @@ -1894,7 +1908,9 @@ method.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request.

Since: cosmos-sdk 0.43 |



Expand All @@ -1911,7 +1927,9 @@ method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `supply` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | supply is the supply of the coins |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response.

Since: cosmos-sdk 0.43 |



Expand Down Expand Up @@ -2158,7 +2176,7 @@ ReflectionService defines a service for interface reflection.
<p align="right"><a href="#top">Top</a></p>

## cosmos/base/reflection/v2alpha1/reflection.proto

Since: cosmos-sdk 0.43


<a name="cosmos.base.reflection.v2alpha1.AppDescriptor"></a>
Expand Down Expand Up @@ -2698,6 +2716,8 @@ StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and De
It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and
Deletes

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -3015,7 +3035,7 @@ VersionInfo is the type for the GetNodeInfoResponse message.
| `build_tags` | [string](#string) | | |
| `go_version` | [string](#string) | | |
| `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | |
| `cosmos_sdk_version` | [string](#string) | | |
| `cosmos_sdk_version` | [string](#string) | | Since: cosmos-sdk 0.43 |



Expand Down Expand Up @@ -3434,7 +3454,7 @@ This prefix is followed with the x-coordinate.
<p align="right"><a href="#top">Top</a></p>

## cosmos/crypto/secp256r1/keys.proto

Since: cosmos-sdk 0.43


<a name="cosmos.crypto.secp256r1.PrivKey"></a>
Expand Down Expand Up @@ -4545,7 +4565,7 @@ Msg defines the evidence Msg service.
<p align="right"><a href="#top">Top</a></p>

## cosmos/feegrant/v1beta1/feegrant.proto

Since: cosmos-sdk 0.43


<a name="cosmos.feegrant.v1beta1.AllowedMsgAllowance"></a>
Expand Down Expand Up @@ -4631,7 +4651,7 @@ as well as a limit per time period.
<p align="right"><a href="#top">Top</a></p>

## cosmos/feegrant/v1beta1/genesis.proto

Since: cosmos-sdk 0.43


<a name="cosmos.feegrant.v1beta1.GenesisState"></a>
Expand Down Expand Up @@ -4662,7 +4682,7 @@ GenesisState contains a set of fee allowances, persisted from the store
<p align="right"><a href="#top">Top</a></p>

## cosmos/feegrant/v1beta1/query.proto

Since: cosmos-sdk 0.43


<a name="cosmos.feegrant.v1beta1.QueryAllowanceRequest"></a>
Expand Down Expand Up @@ -4752,7 +4772,7 @@ Query defines the gRPC querier service.
<p align="right"><a href="#top">Top</a></p>

## cosmos/feegrant/v1beta1/tx.proto

Since: cosmos-sdk 0.43


<a name="cosmos.feegrant.v1beta1.MsgGrantAllowance"></a>
Expand Down Expand Up @@ -4988,7 +5008,7 @@ A Vote consists of a proposal ID, the voter, and the vote option.
| `proposal_id` | [uint64](#uint64) | | |
| `voter` | [string](#string) | | |
| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. This field is set in queries if and only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to VOTE_OPTION_UNSPECIFIED. |
| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | |
| `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | Since: cosmos-sdk 0.43 |



Expand All @@ -5015,6 +5035,8 @@ VotingParams defines the params for voting on governance proposals.
### WeightedVoteOption
WeightedVoteOption defines a unit of vote for vote split.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -5488,6 +5510,8 @@ MsgVoteResponse defines the Msg/Vote response type.
### MsgVoteWeighted
MsgVoteWeighted defines a message to cast a vote.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand All @@ -5505,6 +5529,8 @@ MsgVoteWeighted defines a message to cast a vote.
### MsgVoteWeightedResponse
MsgVoteWeightedResponse defines the Msg/VoteWeighted response type.

Since: cosmos-sdk 0.43




Expand All @@ -5525,7 +5551,9 @@ Msg defines the bank Msg service.
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | |
| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | |
| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal. | |
| `VoteWeighted` | [MsgVoteWeighted](#cosmos.gov.v1beta1.MsgVoteWeighted) | [MsgVoteWeightedResponse](#cosmos.gov.v1beta1.MsgVoteWeightedResponse) | VoteWeighted defines a method to add a weighted vote on a specific proposal.

Since: cosmos-sdk 0.43 | |
| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | |

<!-- end services -->
Expand Down Expand Up @@ -6149,6 +6177,8 @@ Msg defines the slashing Msg service.
### StakeAuthorization
StakeAuthorization defines authorization for delegate/undelegate/redelegate.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -6184,6 +6214,8 @@ Validators defines list of validator addresses.
### AuthorizationType
AuthorizationType defines the type of staking module authorization type

Since: cosmos-sdk 0.43

| Name | Number | Description |
| ---- | ------ | ----------- |
| AUTHORIZATION_TYPE_UNSPECIFIED | 0 | AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type |
Expand Down Expand Up @@ -7752,7 +7784,9 @@ RPC method.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | **Deprecated.** tx is the transaction to simulate. Deprecated. Send raw tx bytes instead. |
| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction. |
| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction.

Since: cosmos-sdk 0.43 |



Expand Down Expand Up @@ -7854,6 +7888,8 @@ upgrade.
### ModuleVersion
ModuleVersion specifies a module and its consensus version.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -7983,6 +8019,8 @@ method.
QueryModuleVersionsRequest is the request type for the Query/ModuleVersions
RPC method.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand All @@ -7999,6 +8037,8 @@ RPC method.
QueryModuleVersionsResponse is the response type for the Query/ModuleVersions
RPC method.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down Expand Up @@ -8034,7 +8074,7 @@ RPC method.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `upgraded_consensus_state` | [bytes](#bytes) | | |
| `upgraded_consensus_state` | [bytes](#bytes) | | Since: cosmos-sdk 0.43 |



Expand All @@ -8057,7 +8097,9 @@ Query defines the gRPC upgrade querier service.
| `CurrentPlan` | [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) | [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) | CurrentPlan queries the current upgrade plan. | GET|/cosmos/upgrade/v1beta1/current_plan|
| `AppliedPlan` | [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) | [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) | AppliedPlan queries a previously applied upgrade plan by its name. | GET|/cosmos/upgrade/v1beta1/applied_plan/{name}|
| `UpgradedConsensusState` | [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) | [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) | UpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain. UpgradedConsensusState RPC not supported with legacy querier This rpc is deprecated now that IBC has its own replacement (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) | GET|/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}|
| `ModuleVersions` | [QueryModuleVersionsRequest](#cosmos.upgrade.v1beta1.QueryModuleVersionsRequest) | [QueryModuleVersionsResponse](#cosmos.upgrade.v1beta1.QueryModuleVersionsResponse) | ModuleVersions queries the list of module versions from state. | GET|/cosmos/upgrade/v1beta1/module_versions|
| `ModuleVersions` | [QueryModuleVersionsRequest](#cosmos.upgrade.v1beta1.QueryModuleVersionsRequest) | [QueryModuleVersionsResponse](#cosmos.upgrade.v1beta1.QueryModuleVersionsResponse) | ModuleVersions queries the list of module versions from state.

Since: cosmos-sdk 0.43 | GET|/cosmos/upgrade/v1beta1/module_versions|

<!-- end services -->

Expand Down Expand Up @@ -8221,6 +8263,8 @@ PermanentLockedAccount implements the VestingAccount interface. It does
not ever release coins, locking them indefinitely. Coins in this account can
still be used for delegating and for governance votes even while locked.

Since: cosmos-sdk 0.43


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
Expand Down
6 changes: 6 additions & 0 deletions proto/cosmos/auth/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types";
// Query defines the gRPC querier service.
service Query {
// Accounts returns all the existing accounts
//
// Since: cosmos-sdk 0.43
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
option (google.api.http).get = "/cosmos/auth/v1beta1/accounts";
}
Expand All @@ -29,12 +31,16 @@ service Query {
}

// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
//
// Since: cosmos-sdk 0.43
message QueryAccountsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

// QueryAccountsResponse is the response type for the Query/Accounts RPC method.
//
// Since: cosmos-sdk 0.43
message QueryAccountsResponse {
// accounts are the existing accounts
repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"];
Expand Down
1 change: 1 addition & 0 deletions proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.43
syntax = "proto3";
package cosmos.authz.v1beta1;

Expand Down
1 change: 1 addition & 0 deletions proto/cosmos/authz/v1beta1/event.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.43
syntax = "proto3";
package cosmos.authz.v1beta1;

Expand Down
1 change: 1 addition & 0 deletions proto/cosmos/authz/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Since: cosmos-sdk 0.43
syntax = "proto3";
package cosmos.authz.v1beta1;

Expand Down
Loading

0 comments on commit 0ac1f6d

Please sign in to comment.