HomePhabricator

[electrum] define and annotate Interface attributes in __init__.py

Description

[electrum] define and annotate Interface attributes in __init__.py

Summary:
Monkey-patching the Interface instances in network.py with new attributes makes it hard to inspect the code and know what the attributes are. Declare them in Interface.__init__ and initialize the ones that were previously initialized immediately after instantiating the Interface

Depends on D14950

Test Plan:

python test_runner.py
pytest electrumabc/tests/regtest

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
PiRKAuthored on Dec 8 2023, 09:02
PiRKPushed on Dec 8 2023, 13:15
Reviewer
Restricted Project
Differential Revision
D14951: [electrum] define and annotate Interface attributes in __init__.py
Parents
rABC78b72d91cb4a: [electrum] typehints and minor cleanup in blockchain.py
Branches
Unknown
Tags
Unknown