Skip to content

Commit

Permalink
🐞 fix: Quirk: prestate account nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
raxhvl committed Nov 4, 2024
1 parent 49abf54 commit ff2e56b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/cli/gentest/test_context_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,18 @@ def _get_environment(self) -> Environment:

def _get_pre_state(self) -> Dict[str, Account]:
assert self.state is not None
assert self.transaction is not None

pre_state: Dict[str, Account] = {}
for address, account in self.state.items():
pre_state[str(address)] = Account(**account)
for address, account_data in self.state.items():

# TODO: Check if this is required. Ideally,
# the pre-state tracer should have the correct
# values without requiring any additional modifications.
if address == self.transaction.sender:
account_data["nonce"] = self.transaction.nonce

pre_state[address] = Account(**account_data)
return pre_state

def _get_transaction(self) -> Transaction:
Expand Down

0 comments on commit ff2e56b

Please sign in to comment.