-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R4R] #2730 add tx search pagination related CLI/REST API parameter #2894
Conversation
cc @fedekunze per discussion: #2927 |
94f253f
to
d0faa4f
Compare
Codecov Report
@@ Coverage Diff @@
## develop #2894 +/- ##
==========================================
- Coverage 55.65% 55.2% -0.45%
==========================================
Files 134 134
Lines 9716 9526 -190
==========================================
- Hits 5407 5259 -148
+ Misses 3965 3936 -29
+ Partials 344 331 -13 |
manually tested rest-server:
command line:
|
ac3c33f
to
81b1219
Compare
cc @fedekunze I think you had thoughts on this. |
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.
Changes so far LGTM. Thanks @ackratos for fixing this ! A few additions are required before merging:
- May I ask you to update the docs by adding the flags on gaiacli.md as well?
- Can you add a small test case on cli_test.go too ?
- Change
perPage
forlimit
according to standards (Source)
thanks for the suggestions. I am working on them |
3d779a9
to
884aab7
Compare
fixed, could you please review this PR again? Thanks |
884aab7
to
7933438
Compare
@ackratos how do I query the second page? Can we add an offset (either # of txns or pages) here so that subsequent pages can be queried? |
This PR added two (missing) parameters to cli and rest api: This is pseudo-implementation because at tendermint tx searching side, it still query all txs meet the tags requirement only return the pagination data. This will help reduce network roundtrips but not saving query CPU time on node. |
Needs merge conflict resolution, then I'd be glad to review (maybe @fedekunze could take a look again too). |
7933438
to
fa1c193
Compare
thanks, done |
fa1c193
to
687a222
Compare
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.
sorry for the delay here. One final check and we should be good to go
baseapp/baseapp.go
Outdated
@@ -86,7 +86,7 @@ var _ abci.Application = (*BaseApp)(nil) | |||
// NewBaseApp returns a reference to an initialized BaseApp. | |||
// | |||
// NOTE: The db is used to store the version number for now. | |||
// Accepts a user-defined txDecoder | |||
// Accepts a usemake install_examplesr-defined txDecoder |
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.
typo ?
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.
++
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.
Looks good @ackratos, just a few minor bits of feedback :)
baseapp/baseapp.go
Outdated
@@ -86,7 +86,7 @@ var _ abci.Application = (*BaseApp)(nil) | |||
// NewBaseApp returns a reference to an initialized BaseApp. | |||
// | |||
// NOTE: The db is used to store the version number for now. | |||
// Accepts a user-defined txDecoder | |||
// Accepts a usemake install_examplesr-defined txDecoder |
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.
++
@ackratos Sorry for the long review process, but if you could address this last round of comments we can get this merged. Will you be able to do that this week? |
yes, really sorry I was busy this week... |
@ackratos Totally understand! Thank you for working with us to get this right! |
4172565
to
5898c6f
Compare
5898c6f
to
8777d8c
Compare
# Conflicts: # cmd/gaia/cli_test/cli_test.go
updated this PR, could you please review again? |
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.
Thanks @ackratos -- I think there is still an issue with the use of constants. Also see my comments on parseHTTPArgs
, otherwise, I think we can merge this PR afterwards 👍
x/gov/client/utils/query.go
Outdated
infos, err := tx.SearchTxs(cliCtx, cdc, tags) | ||
// NOTE: SearchTxs is used to facilitate the txs query which does not currently | ||
// support configurable pagination. | ||
infos, err := tx.SearchTxs(cliCtx, cdc, tags, 1, 30) |
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.
Looks like these still need to be constants?
@ackratos agree with @alexanderbez and @alessio. Thanks for updating the tests as well! Glad they are passing. |
c779e59
to
7e5c3b9
Compare
thanks! fixed again:) |
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.
LGTM, thanks @ackratos !
closes #2730
closes #466
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: