Page MenuHomePhabricator

[electrum] move format_amount* functions from main_window to amount.py
ClosedPublic

Authored by PiRK on Jul 3 2025, 11:33.

Details

Summary

This does not need to be a method associated with a GUI window. Moving it to another module will reduce the dependencies on main_window by subwidgets of the main window.

Another small effort in making main_window less of a God object

Depends on D18316

Test Plan

python test_runner.py unit

Run Electrum ABC, check for no errors and look at some amounts (XEC and fiat), double-click on a transaction and on an address to open the modified dialogs

Diff Detail

Repository
rABC Bitcoin ABC
Branch
refactor_amin_window
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33744
Build 66966: Build Diffelectrum-tests · electrum-functional-tests
Build 66965: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Jul 3 2025, 11:33
PiRK planned changes to this revision.Jul 3 2025, 11:36

i'm missing someting in transaction_dialog

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

fix more occurences of subwidgets calling the main_window to format amounts

Fabien added a subscriber: Fabien.
Fabien added inline comments.
electrum/electrumabc_gui/qt/transaction_dialog.py
641

out of scope for this diff, but at some point you might want to wrap all this in to an Amount class (similar to what the node does) that have various format methods. This will make sure that you don't have a type issue (passing value as XEC or sat when the opposite is expected)

This revision is now accepted and ready to land.Jul 3 2025, 13:55