Page MenuHomePhabricator

[electrum] use a WaitingDialog to resolve aliases
ClosedPublic

Authored by PiRK on Sep 27 2023, 15:57.

Details

Reviewers
Fabien
bytesofman
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC1e5fcb2579f9: [electrum] use a WaitingDialog to resolve aliases
Summary

This informs the user that something is happening, the same way we do when signing or broadcasting a transaction.

Depends on D14457

ref T3298

Test Plan

./electrum-abc -v --enable-aliases

Try typing a good alias in the Pay To widget (twelvechar12.xec). Check that it is added to the Contacts tab, and the transaction works.
Try a random unregistered alias. Watch the terminal output for the error message.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

only do the actual resolving in the thread and exfiltrate the result with a Qt signal, let the main Qt event loop deal with the results and update various widgets (more thread-safe)

PiRK published this revision for review.Sep 28 2023, 07:31
PiRK added inline comments.
electrum/electrumabc_gui/qt/paytoedit.py
415 ↗(On Diff #42425)

The difference here is that the widget will show "twelvechar12 <ecash:qp...>" rather than "twelvechar12.xec <ecash:qp...>", or "Monero Development <ecash:q....>" rather than "donate.monero.org <ecash:q....>" for an open alias.
I think this is an improvement, and it saves me from passing the key via the signal.

electrum/electrumabc/contacts.py
246 ↗(On Diff #42425)

This makes the error message look prettier in case the alias resolving failed. Previously the error data was a tuple.

Fabien added a subscriber: Fabien.

Nice, actually much less code than I anticipated

This revision is now accepted and ready to land.Sep 28 2023, 09:19

rebase, remove comments that are fixed by this diff