bitcoin/test/functional/test_framework
MarcoFalke f4328ebef5
Merge bitcoin/bitcoin#22619: test: refactor: use consistent bytes <-> hex-string conversion in functional test framework
5a1bef60a0 test: refactor: remove binascii from test_framework (Zero-1729)

Pull request description:

  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:

  ```
  bytes.hex(data) == binascii.hexlify(data).decode()
  bytes.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

ACKs for top commit:
  theStack:
    Code-review ACK 5a1bef60a0 🔢

Tree-SHA512: 8f28076cf0580a0d02a156f3e1e94c9badd3d41c3fbdfb2b87cd8a761dde2c94faa5f4c448d6747b1ccc9111c3ef1a1d7b42a11c806b241fa0410b7529e2445f
2021-08-05 12:15:01 +02:00
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py test: refactor: remove hex_str_to_bytes helper 2021-08-01 19:26:51 +02:00
authproxy.py test: retry when write to a socket fails on macOS 2020-06-25 17:26:20 +07:00
bdb.py test: refactor: remove binascii from test_framework 2021-08-04 19:59:13 +01:00
bip340_test_vectors.csv tests: add BIP340 Schnorr signature support to test framework 2020-10-12 17:18:47 -07:00
blocktools.py Merge bitcoin/bitcoin#22619: test: refactor: use consistent bytes <-> hex-string conversion in functional test framework 2021-08-05 12:15:01 +02:00
coverage.py test: add type annotations to util.get_rpc_proxy 2021-07-27 11:26:14 +08:00
descriptors.py Output a descriptor in createmultisig and addmultisigaddress 2020-01-30 23:55:36 -05:00
key.py test: remove unused function xor_bytes 2021-02-09 17:58:21 +01:00
messages.py Merge bitcoin/bitcoin#16333: test: Set BIP34Height = 2 for regtest 2021-08-03 10:10:43 +02:00
muhash.py test: Change MuHash Python implementation to match cpp version again 2020-12-22 01:48:34 +01:00
netutil.py test: refactor: remove binascii from test_framework 2021-08-04 19:59:13 +01:00
p2p.py [net_processing] Defer initializing m_addr_known 2021-07-29 17:40:21 -07:00
script.py Correction for VerifyTaprootCommitment comments 2021-03-01 09:01:48 -05:00
script_util.py test: refactor: remove hex_str_to_bytes helper 2021-08-01 19:26:51 +02:00
segwit_addr.py Use Bech32m encoding for v1+ segwit addresses 2021-03-16 10:48:36 -07:00
siphash.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
socks5.py scripted-diff: Update copyright in ./test 2019-03-02 10:58:35 -05:00
test_framework.py test: Disable automatic connections by default 2021-07-26 19:11:13 +02:00
test_node.py test: add type annotations to util.get_rpc_proxy 2021-07-27 11:26:14 +08:00
test_shell.py TestShell: Return self from setup() 2019-11-05 12:55:52 +01:00
util.py test: refactor: remove hex_str_to_bytes helper 2021-08-01 19:26:51 +02:00
wallet.py test: refactor: remove hex_str_to_bytes helper 2021-08-01 19:26:51 +02:00
wallet_util.py test: refactor: remove hex_str_to_bytes helper 2021-08-01 19:26:51 +02:00