-
Notifications
You must be signed in to change notification settings - Fork 38.7k
wallet, rpc: add label to listsinceblock
#25934
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
wallet, rpc: add label to listsinceblock
#25934
Conversation
bfb8464 to
cf00489
Compare
w0xlt
left a comment
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.
ACK cf00489
CI error is not related
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
aureleoules
left a comment
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.
Concept ACK
I think this change can be useful for accountability.
2097d20 to
cd444f4
Compare
cd444f4 to
1c373dd
Compare
1c373dd to
2ddf967
Compare
2ddf967 to
ee284ff
Compare
aureleoules
left a comment
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.
ACK ee284ff3a57d6785a780ecc2c8a7ec936dc761f3
jonatack
left a comment
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.
Concept ACK. If I understand correctly, it looks like the PR title and description should describe this functionality as filtering the results by those having the label.
src/wallet/rpc/transactions.cpp
Outdated
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.
Seems this can be shorter and on one line
| {"label", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "If set, should be a valid label name to return only incoming transactions\n" | |
| {"label", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "Return only incoming transactions\n" |
and s/with/having/
Unlike listtransactions, I wasn't able to get an invalid label error with listsinceblock. Maybe test for that like the one in test/functional/wallet_listtransactions.py::L282, if the label can be invalid in listsinceblock.
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.
Perfect, you're right. Gonna update it.
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.
I'm working on this in #26186.
I didn't think it would fit the scope of this PR.
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.
That PR doesn't seem to touch/fix the invalidity check for listsinceblock. Should it be done here while adding the arg, or do you plan to update that pull after this one?
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.
Unlike listtransactions, I wasn't able to get an invalid label error with listsinceblock
I think in listtransactions label parameter is the first one, so you pass a value like "*" or a real name and if you try it with an empty label it throws an error. In this case, label is the last parameter, you can pass a label or leave it empty to fetch all, there is no need to adopt the same pattern as listtransactions.
ee284ff to
2a86921
Compare
aureleoules
left a comment
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.
re-ACK 2a86921ba3b9d6b8e269f5aa8b7c5f0c4ba90eb0 - minor changes and documentation improvements since my last review.
src/wallet/rpc/transactions.cpp
Outdated
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.
That PR doesn't seem to touch/fix the invalidity check for listsinceblock. Should it be done here while adding the arg, or do you plan to update that pull after this one?
jonatack
left a comment
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.
Not sure, but should the PR title and description describe this functionality as filtering the results by those having the label?
c15c9b5 to
0ff870f
Compare
Just updated the description. |
jonatack
left a comment
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.
ACK 0ff870fd03ade761a4f2c158af88ec8463d49a72
aureleoules
left a comment
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.
reACK 0ff870fd03ade761a4f2c158af88ec8463d49a72 - minor changes and documentation improvements since my last review.
219b7f0 to
c9b60d3
Compare
|
Force-pushed rebasing and addressing @jonatack's suggestion for the test. |
jonatack
left a comment
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.
ACK c9b60d335954ecad67a70072881f8094657c5a74
|
@brunoerg it might be good to un-resolve the discussion from #25934 (comment) as it needs to be addressed (if I'm not confused). |
aureleoules
left a comment
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.
reACK c9b60d335954ecad67a70072881f8094657c5a74
c9b60d3 to
4e362c2
Compare
|
Force-pushed rebasing. |
w0xlt
left a comment
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.
ACK 4e362c2
aureleoules
left a comment
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.
ACK 4e362c2
|
ACK 4e362c2 |
4e362c2 doc: add release note for 25934 (brunoerg) fe488b4 test: add coverage for `label` in `listsinceblock` (brunoerg) 722e9a4 wallet, rpc: add `label` to `listsinceblock` (brunoerg) 852891f refactor, wallet: use optional for `label` in `ListTransactions` (brunoerg) Pull request description: This PR adds `label` parameter to `listsinceblock` to be able to fetch all incoming transactions having the specified label since a specific block. It's possible to use it in `listtransactions`, however, it's only possible to set the number of transactions to return, not a specific block to fetch from. `getreceivedbylabel` only returns the total amount received, not the txs info. `listreceivedbylabel` doesn't list all the informations about the transactions and it's not possible to fetch since a block. ACKs for top commit: achow101: ACK 4e362c2 w0xlt: ACK bitcoin@4e362c2 aureleoules: ACK 4e362c2 Tree-SHA512: fbde5db8cebf7a27804154fa61997b5155ad512e978cebb78c17acab9efcb624ea5f39d649899d12e5e675f80d4d0064cae8132b864de0d93a8d1e6fbcb9a737
This PR adds
labelparameter tolistsinceblockto be able to fetch all incoming transactions having the specified label since a specific block.It's possible to use it in
listtransactions, however, it's only possible to set the number of transactions to return, not a specific block to fetch from.getreceivedbylabelonly returns the total amount received, not the txs info.listreceivedbylabeldoesn't list all the informations about the transactions and it's not possible to fetch since a block.