diff options
Diffstat (limited to 'qa/rpc-tests/test_framework/blockstore.py')
-rw-r--r-- | qa/rpc-tests/test_framework/blockstore.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qa/rpc-tests/test_framework/blockstore.py b/qa/rpc-tests/test_framework/blockstore.py index b9775b477c..73d9ffbb2f 100644 --- a/qa/rpc-tests/test_framework/blockstore.py +++ b/qa/rpc-tests/test_framework/blockstore.py @@ -3,8 +3,9 @@ # and for constructing a getheaders message # -from mininode import * +from .mininode import * import dbm +from io import BytesIO class BlockStore(object): def __init__(self, datadir): @@ -21,7 +22,7 @@ class BlockStore(object): serialized_block = self.blockDB[repr(blockhash)] except KeyError: return None - f = cStringIO.StringIO(serialized_block) + f = BytesIO(serialized_block) ret = CBlock() ret.deserialize(f) ret.calc_sha256() @@ -115,7 +116,7 @@ class TxStore(object): serialized_tx = self.txDB[repr(txhash)] except KeyError: return None - f = cStringIO.StringIO(serialized_tx) + f = BytesIO(serialized_tx) ret = CTransaction() ret.deserialize(f) ret.calc_sha256() |