Page MenuHomePhabricator

[electrum] move-only: move helper functions to avoid libsecp dependency
ClosedPublic

Authored by PiRK on Oct 1 2024, 15:05.

Details

Summary

This moves helper classes and helper functions to other modules to avoid introducing a dependency on cryptography code for the get_merkle_root.py script. This means we can continue using the script without unnecessarily compiling libsecp256k1.

Now interface.py no longer depends on libsecp, and a helper function was moved from network.py to networks.py because the latter also does not depend on libsecp.

Test Plan
python test_runner.py

With libsecp256k1.so.0 missing:

scripts/get_merkle_root.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
electrum_interface_imports
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30449
Build 60417: Build Diffelectrum-tests
Build 60416: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Oct 1 2024, 15:05
electrum/electrumabc/json_util.py
57

All this stuff is only used in interface.py so I moved it there

electrum/electrumabc/networks.py
220

I moved parse_servers here because it uses a constant from this module, so it makes sense. Alternatively it can be moved to util.py, but then util will depend on networks.py which could cause circular imports, so maybe it would need its own network_util.py module.

This revision is now accepted and ready to land.Oct 1 2024, 20:44