-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add pagination support for listgovproposalvotes
#1635
Conversation
Prevents optional arguments from becoming mandatory if pagination has to be set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will filter current cycle of the proposal which is internal to the proposal. We will need some mechanism to filter by global cycle meaning "get all proposals in the Nth voting round". Have a look at #1627 for a WIP implementation of this filter.
A suggestion was made to call this two filters differently:
- global cycle filter -> batch
- internal cycle -> cycle
UPDATE: This will apply for listgovproposals
filtering, current implementation for listgovproposalvotes
is actually valid.
listgovproposalvotes
listgovproposalvotes
Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com>
* Add cycle filtering to listgovproposals * Fix cycle param description * Remove unused variable retMap * Replace uint with unsigned int to fix windows compile error * Add tests to listgovproposals * Removes trailing whitespaces and unused imports * Fix ForEachCycleProp returning early * Add pagination to listgovproposal * Fix lint * Format src/masternodes/rpc_proposals.cpp * Pagination nesting as in #1635 Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com> * Make pagination rpc consistent * Resolve compiler warning * Update help message Co-authored-by: Keng Ye <40191153+kyleleow@users.noreply.github.com> Co-authored-by: jouzo <jdesclercs@gmail.com> Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com> Co-authored-by: Mihailo Milenkovic <mihailo.milenkovic84@gmail.com> Co-authored-by: Peter John Bushnell <bushsolo@gmail.com> Co-authored-by: Prasanna Loganathar <pvl@prasannavl.com> Co-authored-by: Keng Ye <40191153+kyleleow@users.noreply.github.com>
<!-- Thanks for sending a pull request! --> #### What this PR does / why we need it: - Update listGovProposalVotes arguments as per DeFiCh/ain#1635. This is required to keep compatibility with the next release. Signed-off-by: Shoham Chakraborty <shhmchk@gmail.com>
What kind of PR is this?:
/kind feature
What this PR does / why we need it:
Provides pagination support for the
listgovproposalvotes
RPC.Pagination arguments can be provided via the
pagination
CLI argument.If you do not want to set the RPC's optional arguments, users can pass arguments via an object instead.
$ defi-cli listgovproposalvotes '{"proposalId": "propId", "pagination": {"limit": 2}}'
There are three pagination arguments available:
start
: Index of the first entry to return. Usuallystart + limit
of the previous call.including_start
: To include first entry of the results. This is set tofalse
ifstart
has been set.limit
: Maximum number of entries to return in one RPC call.Successive pagination calls would look like: