Page MenuHomePhabricator

[electrum] support coins with only x_pubkeys and no pubkeys defined
ClosedPublic

Authored by PiRK on Sep 18 2023, 10:50.

Details

Summary

The wallet stores them like this. It is easy to compute a pubkey from an xpub + derivation, but let's do it lazily rather than do it in __init__ because it is not cheap and is only really needed when serializing or signing.

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.Sep 18 2023, 10:50
bytesofman added inline comments.
electrum/electrumabc/transaction.py
562 ↗(On Diff #42242)

why is this conversion necessary? then the test case converts again to hex with .hex(),?

This revision is now accepted and ready to land.Sep 18 2023, 13:40
electrum/electrumabc/transaction.py
562 ↗(On Diff #42242)

So here I do the conversion from the legacy format (that is still used in other parts of the software) to new format.
In tests, the conversions are mainly done so that the data is a bit more human-friendly to read and review ("deadbeef" vs b"\xde\xad\xbe\xef"). In the tests I don't care about performance, so using hex strings makes more sense.