Page MenuHomePhabricator

[electrum] remove more bytes <--> hex conversions in bitcoin.py
ClosedPublic

Authored by PiRK on Sep 11 2023, 08:02.

Details

Summary

This fixes all the code using bfh (bytes.fromhex) to expect bytes and return bytes. These are all low-level functions that should not deal with data encoding and decoding, so let's make it the responsibility of higher-level code to pass the correct type.

Note that there are still remaining functions using bh2u (binascii.hexlify(x).decode("ascii")). I'm leaving these untouched for the moment, to keep this diff manageable.

Depends on D14463

Test Plan

python test_runner.py

Run the application, open, close and reopen an encrypted wallet to test the encrypt_message function.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
int_to_hex
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24985
Build 49558: Build Diffelectrum-tests
Build 49557: arc lint + arc unit