Page MenuHomePhabricator

[electrum] show a single popup dialog when broadcasting multiple transactions
ClosedPublic

Authored by PiRK on Nov 25 2023, 10:08.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC63dbbee3eacb: [electrum] show a single popup dialog when broadcasting multiple transactions
Summary

Until now, the program used to open one popup per transaction when broadcasting multiple transactions, which can be annoying when broadcasting many transactions.
Fix this by summarizing the result of the broadcast in a single messagebox.

ref T3352

This has also the benefit of no longer using the main_window.broadcast_transaction method, which could have side effects if the user was in the middle of dealing with a payment request before deciding to send broadcast a bunch of unrelated transactions.

Test Plan

Prepare a few signed and non-conflicting signed transactions, save them to file. Load them via "Tools > Load transaction > From multiple files". Click broadcast.

Repeat the test but add a conflicting transaction (spend the same coin to a different address) to trigger the partial success code path.

Create 3 conflicting transactions. Broadcast one of them. Then try to broadcast the other 2 to test the "complete_failure" code path.

Patch the code to raise an error in MultiTransactionsWidget.broadcast_transactions to trigger the on_broadcast_error method.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
broadcast_multi_tx
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 25743
Build 51066: Build Diffelectrum-tests
Build 51065: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Nov 25 2023, 10:08

Screenshot from 2023-11-25 10-48-24.png (183×622 px, 39 KB)

Screenshot from 2023-11-25 10-47-53.png (251×622 px, 51 KB)

With assert False, "Les sanglots longs des violons de l'automne" in broadcast_transactions.

Screenshot from 2023-11-25 10-46-45.png (140×387 px, 10 KB)

PiRK planned changes to this revision.Nov 25 2023, 10:14

the error dialog is untested and buggy

PiRK edited the test plan for this revision. (Show Details)

fix AttributeError: type object 'QMessageBox' has no attribute 'error' and add to the test plan

Screenshot from 2023-11-25 11-20-31.png (149×452 px, 15 KB)

electrum/electrumabc_gui/qt/multi_transactions_dialog.py
232 ↗(On Diff #43271)
>>> statuses = ((True, "that worked"), (False, ":("), (True, "Great success!"))
>>>
>>> successes, msgs = zip(*statuses)
>>>
>>> successes
(True, False, True)
>>> msgs
('that worked', ':(', 'Great success!')
This revision is now accepted and ready to land.Nov 25 2023, 21:22

fix number of successful transactions in succes message