Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions evm/vm/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class VM(object):
_block_class = None

def __init__(self, header, db):
if db is None:
if self.db is None:
raise ValueError("VM classes must have a `db`")

self.db = db
self._db = db

block_class = self.get_block_class()
self.block = block_class.from_header(header=header, db=db)
Expand Down Expand Up @@ -69,6 +69,13 @@ def state_db(self, read_only=False):
self.logger.debug("Updating block's state_root to %s", state.root_hash)
self.block.header.state_root = state.root_hash

#
# Db property
#
@property
def db(self):
return self._db

#
# Logging
#
Expand Down