HomePhabricator

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

Description

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

Summary:
These functions all return bytes, so make them work with bytes directly rather than converting integers to strings then converting them to bytes.
It improves code readability and performance.

Depends on D14462

Test Plan:
python test_runner.py

I ensured every single line touched by this diff is covered by tests by introducing errors and making sure it causes failures and errors.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14463

Details

Provenance
PiRKAuthored on Sep 11 2023, 07:01
PiRKPushed on Sep 11 2023, 13:36
Reviewer
Restricted Project
Differential Revision
D14463: [electrum] remove uneccessary hex <--> bytes conversions in bitcoin.py
Parents
rABC815c446f7847: [electrum] remove unnecessary hex conversion when converting int to bytes
Branches
Unknown
Tags
Unknown