This PR continues the work started in PR #22593, regarding using the bytes built-in module. In this PR specifically, instances of binascii’s methods hexlify, unhexlify, and a2b_hex have been replaced with the build-in bytes module’s hex and fromhex methods where appropriate to make bytes <-> hex-string conversions consistent across the functional test files and test_framework.
Additionally, certain changes made are based on the following assumption:
0bytes.hex(data) == binascii.hexlify(data).decode()
1bytes.hex(data).encode() == binascii.hexlify(data)
Ran the functional tests to ensure behaviour is still consistent and changes didn’t break existing tests.
closes #22605