-
Notifications
You must be signed in to change notification settings - Fork 312
Add Create Unsigned button to SendConfirmationDialog #441
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 Create Unsigned button to SendConfirmationDialog #441
Conversation
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 agree with the idea behind this PR.
Though I have not completed my test, I have found some corrections here and there in the code that will be great for starters. I shall post my thorough review after completing the testings later.
fe11f65
to
790733e
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.
Code review ACK 790733e. I guess I'm grumpy and left some complaints about the code and use of the word "advanced" in option description. But overall this change looks very good and makes the UI more consistent and understandable while adding a new feature. Please ignore any feedback below that is not helpful!
Would recommend adding release notes to this PR, and maybe including the nice screenshots from shaavan in the PR description.
Instead of having different buttons or changing button behavior for making a PSBT, just have SendConfirmationDialog return whether the user wants a PSBT or a broadcasted transaction. Since this dialog is used by both the bumpFeeAction and the SendCoinsDialog, changes to both to support the different behavior is needed. They will check the return value of the SendConfirmationDialog for whether a PSBT needs to be created instead of checking whether private keys are disabled. Strings used in this dialog are being slightly modified to work with both private keys enabled and disabled wallets.
790733e
to
9d8cf22
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.
There is a small bug second commit (msbt_controls
spelling) but than that 9d8cf22 looks very good, and thanks for the updates!
9d8cf22
to
742918c
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.
Code review ACK 742918c. Just suggested changes since last review. Looks great!
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.
ACK 742918c, tested on Linux Mint 20.2 (Qt 5.12.8).
The following code looks dead now:
gui/src/qt/sendcoinsdialog.cpp
Lines 1052 to 1054 in 742918c
if (confirmButtonText.isEmpty()) { | |
confirmButtonText = yesButton->text(); | |
} |
Maybe break very long lines for better readability?
|
||
private: | ||
QAbstractButton *yesButton; | ||
QAbstractButton *m_psbt_button; |
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.
style nit:
QAbstractButton *m_psbt_button; | |
QAbstractButton* m_psbt_button; |
QString confirmButtonText{tr("Send")}; | ||
bool m_enable_send; | ||
QString m_psbt_button_text{tr("Create Unsigned")}; |
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:
QString confirmButtonText{tr("Send")}; | |
bool m_enable_send; | |
QString m_psbt_button_text{tr("Create Unsigned")}; | |
const QString confirmButtonText{tr("Send")}; | |
const bool m_enable_send; | |
const QString m_psbt_button_text{tr("Create Unsigned")}; |
@@ -523,7 +522,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash) | |||
} | |||
|
|||
// Short-circuit if we are returning a bumped transaction PSBT to clipboard | |||
if (create_psbt) { | |||
if (retval == QMessageBox::Save) { |
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.
As m_psbt_button = button(QMessageBox::Save);
is not near, maybe add a comment which describes that this code actually handles "Create Unsigned" button press?
Is // Short-circuit if we are returning a bumped transaction PSBT to clipboard
comment above still relevant?
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
2efdfb8 gui: restore Send for external signer (Sjors Provoost) 4b5a6cd refactor: helper function signWithExternalSigner() (Sjors Provoost) 026b5b4 move-only: helper function to present PSBT (Sjors Provoost) Pull request description: Fixes #551 For the simplest use case of a wallet with one external signer and "PSBT Controls" disabled in settings (the default), the send dialog will behave the same as when using a wallet with private keys. I.e. there's no "Create Unsigned" button. When PSBT controls are turned on, you can now actually make a PSBT with signing it; before this PR that button would trigger a sign event and would broadcast the transaction. In case a multisig, the Send button will sign on the device, and then fall back to presenting a PSBT (same behavior as before #441). This PR starts with two refactoring commits to move some stuff into a helper function for improved readability in general, and to make the main commit easier to review. ACKs for top commit: jonatack: utACK 2efdfb8 diff review since my last review, code re-review, rebased to current master, verified clean debug build of each commit luke-jr: utACK 2efdfb8 Tree-SHA512: e8731a0ef9e87564b2676c7b022b742d9621bba964c19dba9fd9f6961eb608737a9e1a22c0a3c8b2f2f6d583bba067606ee8392422e82082deefb20ea7b88c7c
Instead of having different buttons or changing button behavior for making a PSBT, just have SendConfirmationDialog return whether the user wants a PSBT or a broadcasted transaction. Since this dialog is used by both the bumpFeeAction and the SendCoinsDialog, changes to both to support the different behavior is needed. They will check the return value of the SendConfirmationDialog for whether a PSBT needs to be created instead of checking whether private keys are disabled.
Strings used in this dialog are being slightly modified to work with both private keys enabled and disabled wallets.
Moved from bitcoin/bitcoin#18789