Page MenuHomePhabricator

[electrum] fix and add tyephints in base58 decoding code
ClosedPublic

Authored by PiRK on Nov 17 2023, 08:02.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCa32e077e7061: [electrum] fix and add tyephints in base58 decoding code
Summary

The return type in serialize_privkey was wrong, it is a Base58 (WIF) encoded string, not bytes.
Also base_decode may return None if the result does not fit in the expected length, and DecodeBase58Check needs to bail out early when this happens instead of trying to slice None.

Test Plan

python test_runner.py

Check that these particular errors are now fixed wrt to mypy:
mypy --ignore-missing-imports | grep "^electrumabc/bitcoin.py

Diff Detail

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