-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added rest api for query the gov params #9979
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9979 +/- ##
=======================================
Coverage 63.80% 63.81%
=======================================
Files 566 566
Lines 53363 53374 +11
=======================================
+ Hits 34047 34058 +11
Misses 17397 17397
Partials 1919 1919
|
The linked issue proposes
which is a solution that I prefer over this one. Wdyt @gsk967 ? |
Thanks for the contribution @gsk967! Do you think you could instead take the approach on changing the |
Okay I will change the params struct for gov module @alexanderbez // Genesis State
message GenesisState {
....
Params params = 5 [(gogoproto.nullable) = false];
}
message Params {
Deposit deposit = 1
Tally tally = 2
Voting voting = 3
}
// GRPC Query
service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos/gov/v1beta1/params";
}
rpc Param(QueryParamRequest) returns (QueryParamResponse){
option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}";
}
}
message QueryParamsRequest {
}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
message QueryParamRequest {
// "voting", "tallying" or "deposit".
string params_type = 1;
}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
oneof Param {
Voting voting = 1 [(gogoproto.nullable) = false];
Deposit deposit = 2 [(gogoproto.nullable) = false];
Tallt tally = 3 [(gogoproto.nullable) = false];
}
} any suggestions @alexanderbez |
Not quite @gsk967. The params need to be "flattened". I.e, we remove |
Okay Understood @alexanderbez // Genesis State
message GenesisState {
....
Params params = 5 [(gogoproto.nullable) = false];
}
message Params {
min_deposit = 1;
max_deposit_period = 2;
voting_period = 3;
quorum = 4;
threshold = 5;
veto_threshold = 6;
}
// GRPC Query
service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos/gov/v1beta1/params";
}
}
message QueryParamsRequest {
}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
} |
I agree with this. But this would be a proto-breaking change. I would make sure to have the green light from @blushi or @cmwaters (or someone else in the gov working group) before moving forward with this. |
Sorry but I didn't understand the command. Please consult the commands documentation 📚. Hey, I reacted but my real name is @Mergifyio |
@marbar3778 Yes , I will migrate gov params to new param design |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
Closes: #9970
Added new rest api for query the
params
of gov module same like other modulesx/module
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change