Page MenuHomePhabricator

[electrum] fix flake8-comprehensions warnings and enable flake8 for electrum
ClosedPublic

Authored by PiRK on Jun 23 2023, 07:51.

Details

Summary

Fixes the warnings listed here: https://github.com/adamchainz/flake8-comprehensions#rules

Also remove two unused imports in dnssec.py to fix flake8 error introduced in D14094 when I deleted the code using these imports.

Depends on D14106

Test Plan
arc lint --everything
cd electrum
python -m electrumabc.tests
python -m electrumabc_plugins.fusion.tests

Run electrum-abc, enable cash fusion.

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Jun 23 2023, 07:51
electrum/electrumabc/paymentrequest.py
273 ↗(On Diff #40939)

here x is a namedtuple TxOutput, defined in transaction.py as:

class TxOutput(NamedTuple):
    type: int
    destination: DestinationType
    # str when the output is set to max: '!'
    value: Union[int, str]

So we can call the value by attribute name rather than tuple index.

electrum/electrumabc_gui/stdio.py
188 ↗(On Diff #40939)

There seems to be an inconsistency in the formatting of the header line, here, but this is out of the scope of this diff. I'm not quite sure how to test this code, it may even be unused.

This revision is now accepted and ready to land.Jun 23 2023, 15:50

You should quickly add the tests to the CI

You should quickly add the tests to the CI

OK, I have this at the top of my todo list.