Page MenuHomePhabricator

[electrum] don't use ecdsa for basic bytes <-> int conversion
ClosedPublic

Authored by PiRK on Fri, Aug 23, 11:52.

Details

Summary

There are python builtin methods for that.

It is also a good opportunity to remove the misleading Python 2 era _to_string terminology when the output is actually bytes.

Partial backport of electrum#5947
https://github.com/spesmilo/electrum/pull/5947/commits/2cf213552822b0feda4775ed94719679bcb1efb4

Depends on D16665

Test Plan

python test_runner.py

Diff Detail

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

Event Timeline

PiRK requested review of this revision.Fri, Aug 23, 11:52
bytesofman added inline comments.
electrum/electrumabc/tests/test_ecc.py
34 ↗(On Diff #49335)

do you think it makes sense to keep this 32 as a defined constant somewhere, e.g. PRIVATE_KEY_BYTECOUNT ?

repeated 4 times in this diff, isn't (widely) intuitive why this should be 32.

electrum/electrumabc/tests/test_ecc.py
34 ↗(On Diff #49335)

You're right, that would improve things quite a bit.

replace the magic 32 number with a constant

This revision is now accepted and ready to land.Tue, Aug 27, 19:08