Browse Source

Use logging in test_framework/blockstore.py

0.15
John Newbery 8 years ago
parent
commit
ff190739be
  1. 6
      qa/rpc-tests/test_framework/blockstore.py

6
qa/rpc-tests/test_framework/blockstore.py

@ -8,6 +8,8 @@ from .mininode import *
from io import BytesIO from io import BytesIO
import dbm.dumb as dbmd import dbm.dumb as dbmd
logger = logging.getLogger("TestFramework.blockstore")
class BlockStore(object): class BlockStore(object):
"""BlockStore helper class. """BlockStore helper class.
@ -86,7 +88,7 @@ class BlockStore(object):
try: try:
self.blockDB[repr(block.sha256)] = bytes(block.serialize()) self.blockDB[repr(block.sha256)] = bytes(block.serialize())
except TypeError as e: except TypeError as e:
print("Unexpected error: ", sys.exc_info()[0], e.args) logger.exception("Unexpected error")
self.currentBlock = block.sha256 self.currentBlock = block.sha256
self.headers_map[block.sha256] = CBlockHeader(block) self.headers_map[block.sha256] = CBlockHeader(block)
@ -156,7 +158,7 @@ class TxStore(object):
try: try:
self.txDB[repr(tx.sha256)] = bytes(tx.serialize()) self.txDB[repr(tx.sha256)] = bytes(tx.serialize())
except TypeError as e: except TypeError as e:
print("Unexpected error: ", sys.exc_info()[0], e.args) logger.exception("Unexpected error")
def get_transactions(self, inv): def get_transactions(self, inv):
responses = [] responses = []

Loading…
Cancel
Save