diff --git a/x/distribution/CHANGELOG.md b/x/distribution/CHANGELOG.md index 0a341876bc94..1bb68fcab69b 100644 --- a/x/distribution/CHANGELOG.md +++ b/x/distribution/CHANGELOG.md @@ -32,6 +32,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [#20790](https://github.com/cosmos/cosmos-sdk/pull/20790) `x/distribution` does not depend on `x/protocolpool` anymore, now `x/distribution` only does token transfers and `x/protocolpool` does the rest. +* [#20219](https://github.com/cosmos/cosmos-sdk/issues/20219#event-14494455201) Mark more queries with module_query_safe. ### API Breaking Changes diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 231a520171a9..3972602a20b3 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19167](https://github.com/cosmos/cosmos-sdk/pull/19167) Add `YesQuorum` parameter specifying a minimum of yes vote in the total proposal voting power for the proposal to pass. * [#18445](https://github.com/cosmos/cosmos-sdk/pull/18445) Extend gov config. * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Repurpose `govcliutils.NormalizeProposalType` to work for gov v1 proposal types. +* [#20219](https://github.com/cosmos/cosmos-sdk/issues/20219#event-14494455201) Mark more queries with module_query_safe. ### State Machine Breaking diff --git a/x/gov/proto/cosmos/gov/v1beta1/query.proto b/x/gov/proto/cosmos/gov/v1beta1/query.proto index c0229af7ca54..616be2841133 100644 --- a/x/gov/proto/cosmos/gov/v1beta1/query.proto +++ b/x/gov/proto/cosmos/gov/v1beta1/query.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; import "amino/amino.proto"; option go_package = "cosmossdk.io/x/gov/types/v1beta1"; @@ -14,42 +15,50 @@ option go_package = "cosmossdk.io/x/gov/types/v1beta1"; service Query { // Proposal queries proposal details based on ProposalID. rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; } // Proposals queries all proposals based on given status. rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; } // Vote queries voted information based on proposalID, voterAddr. // Due to how we handle state, this query would error for proposals that has already been finished. rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; } // Votes queries votes of a given proposal. rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; } // Params queries all parameters of the gov module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; } // Deposit queries single deposit information based on proposalID, depositor address. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; } // Deposits queries all deposits of a single proposal. rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; } // TallyResult queries the tally of a proposal vote. rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; } }