-
Notifications
You must be signed in to change notification settings - Fork 266
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
Decouple WalletModel from RPCExecutor #841
base: master
Are you sure you want to change the base?
Decouple WalletModel from RPCExecutor #841
Conversation
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. |
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 meh, WalletModel
is coupled to RPCConsole
, why bother with RPCExecutor
?
Thats because the GUI view code and the RPC command parsing and executing functions are entangled right now, but this doesn’t need to remain the case. While the view might require access to the |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
3f34c04
to
770c3a9
Compare
Since the `WalletModel` class is unavailable when compiling without wallet support `(-DENABLE_WALLET=0)`, the RPC executor class should not be coupled to it. This decoupling ensures GUI compatibility with builds that omit wallet support.
770c3a9
to
002b792
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.
tACK 002b792
Tested the rpc console with and without -DENABLE_WALLET
. I think the refactor makes sense as the rpc just needs the wallet name for the related commands.
Out of the scope of this PR, I noticed that the order of the wallets in the combo-boxes corresponds to the settings.json
file and if the user changes the wallet in the main window, when the rpc console is open, the wallet in the console combo doesn't correspond with the one in the main window, which is ok if you want to compare data but I think when the console opens it should have the same. Also perhaps we should show the last used wallet (in ./config/Bitcoin-Qt-*.conf
?) when qt starts (if still in the loaded wallets in settings.json
) instead of showing the first of the list.
@@ -169,7 +169,7 @@ class PeerIdViewDelegate : public QStyledItemDelegate | |||
* @param[out] pstrFilteredOut Command line, filtered to remove any sensitive data |
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.
nit: describe wallet_name as a param[in] (wallet_model wasn't there either)
* @param[out] pstrFilteredOut Command line, filtered to remove any sensitive data | |
* @param[out] pstrFilteredOut Command line, filtered to remove any sensitive data | |
* @param[in] wallet_mame ... |
This surely comes from the fact that the RPC console view is created during initialization. The presentation of the dialog in screen is merely a |
Yeah, neither do I, just mentioning it here since I just passed thru while testing. |
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.
strong concept ack
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.
tACK 002b792
Was able to build successfully on Ubuntu 24.04 with Qt version 5.15.13 with -DENABLE_WALLET=OFF
and -BUILD_GUI=ON
flags and was able to successfully try a couple of RPCs on the GUI RPC console
A more comprehensive fix for the issue described in #837.
Since the
WalletModel
class is unavailable when compiling without wallet support(-DENABLE_WALLET=0)
, the RPC executor class should not be coupled to it.This decoupling ensures GUI compatibility with builds that omit wallet support.
This also drops an extra
#ifdef ENABLE_WALLET
block which is always good.