test: refactor: remove binascii from test_framework

This commit is contained in:
Zero-1729
2021-08-04 19:59:06 +01:00
parent 71797beec5
commit 5a1bef60a0
5 changed files with 10 additions and 14 deletions

View File

@@ -24,7 +24,6 @@ transactions.
`db_dump -da wallet.dat` is useful to see the data in a wallet.dat BDB file
"""
import binascii
import struct
# Important constants
@@ -96,7 +95,7 @@ def dump_meta_page(page):
metadata['key_count'] = key_count
metadata['record_count'] = record_count
metadata['flags'] = flags
metadata['uid'] = binascii.hexlify(uid)
metadata['uid'] = uid.hex().encode()
assert magic == BTREE_MAGIC, 'bdb magic does not match bdb btree magic'
assert pg_type == BTREE_META, 'Metadata page is not a btree metadata page'
@@ -110,8 +109,9 @@ def dump_meta_page(page):
metadata['re_pad'] = re_pad
metadata['root'] = root
metadata['crypto_magic'] = crypto_magic
metadata['iv'] = binascii.hexlify(iv)
metadata['chksum'] = binascii.hexlify(chksum)
metadata['iv'] = iv.hex().encode()
metadata['chksum'] = chksum.hex().encode()
return metadata
# Given the dict from dump_leaf_page, get the key-value pairs and put them into a dict