def __init__(self, chaindb, block_header, prev_headers, receipts=[]): self._chaindb = chaindb self.block_header = block_header self.prev_headers = prev_headers self.access_logs = AccessLogs() self.receipts = receipts
def test_exists_and_delete(tracked_db): tracked_db.set(b'1', b'test') assert tracked_db.access_logs.writes.get(b'1') == b'test' # exists tracked_db.access_logs = AccessLogs() # clear _reads # existence is True assert tracked_db.exists(b'1') assert tracked_db.access_logs.reads.get(b'1') == b'test' # existence is False assert not tracked_db.exists(b'2') assert tracked_db.access_logs.reads.get(b'2') is None # delete tracked_db.access_logs.writes = {} # clear _writes tracked_db.delete(b'1') assert b'1' in tracked_db.access_logs.writes assert tracked_db.access_logs.writes.get(b'1') is None
def __init__(self, chaindb, execution_context, state_root, receipts=[]): self._chaindb = chaindb self.execution_context = execution_context self.state_root = state_root self.receipts = receipts self.access_logs = AccessLogs()