HomePhabricator

[electrum] typehints and minor cleanup in interface.py

Description

[electrum] typehints and minor cleanup in interface.py

Summary:
This is a code cleanup to help me better understand the network.py code.

Add typehints where the IDE cannot guees the type.
Use an Enum for interface modes for better type-safety and more helpful IDE assistance.
Remove an unused TCPConnection.protocol attribute.
Use the more modern NamedTuple class definition.

Test Plan:

python test_runner.py
python -m electrumabc.interface
pytest electrumabc/tests/regtest

Run the application, check the network dialog, change the server.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14947

Details

Provenance
PiRKAuthored on Dec 8 2023, 05:47
PiRKPushed on Dec 8 2023, 05:47
Reviewer
Restricted Project
Differential Revision
D14947: [electrum] typehints and minor cleanup in interface.py
Parents
rABCd6301c7a201e: doc: add release note for error handling when VerifyDB dosn't finish…
Branches
Unknown
Tags
Unknown