Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 857bef4

Browse files
veoxcarver
andcommitted
ABC: add stub AccountDatabaseAPI.lock_changes().
SQUASHED: lint/mypy,ABC: silence error in an AccountDatabaseAPI lacking a stub. The error is: eth/vm/state.py:180: error: "AccountDatabaseAPI" has no attribute "lock_changes" The stub comment is copied over from AccountDatabaseStorageAPI, removing the reference to "storage". ABC: improve AccountDatabaseAPI.lock_changes() heredoc. Co-authored-by: Jason Carver <[email protected]>
1 parent c1fc7b7 commit 857bef4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

eth/abc.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,22 @@ def commit(self, checkpoint: JournalDBCheckpoint) -> None:
19451945
"""
19461946
...
19471947

1948+
@abstractmethod
1949+
def lock_changes(self) -> None:
1950+
"""
1951+
Locks in changes across all accounts' storage databases.
1952+
1953+
This is typically used at the end of a transaction, to make sure that
1954+
a revert doesn't roll back through the previous transaction, and to
1955+
be able to look up the "original" value of any account storage, where
1956+
"original" is the beginning of a transaction (instead of the beginning
1957+
of a block).
1958+
1959+
See :meth:`eth.abc.AccountStorageDatabaseAPI.lock_changes` for
1960+
what is called on each account's storage database.
1961+
"""
1962+
...
1963+
19481964
@abstractmethod
19491965
def make_state_root(self) -> Hash32:
19501966
"""

0 commit comments

Comments
 (0)