Skip to content

Commit

Permalink
Fix Empty Withdrawals Root (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz authored Dec 13, 2022
1 parent 78b9734 commit 64db0a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/evm_transition_tool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def calc_withdrawals_root(self, withdrawals: Any, fork: str) -> str:
"""
Calculate the state root for the given `alloc`.
"""
if type(withdrawals) is list and len(withdrawals) == 0:
# Optimize returning the empty root immediately
return "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" # noqa: E501

env: Dict[str, Any] = {
"currentCoinbase": "0x0000000000000000000000000000000000000000",
"currentDifficulty": "0x0",
Expand Down

0 comments on commit 64db0a2

Please sign in to comment.