Skip to content

Commit 64db0a2

Browse files
authored
Fix Empty Withdrawals Root (#16)
1 parent 78b9734 commit 64db0a2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/evm_transition_tool/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def calc_withdrawals_root(self, withdrawals: Any, fork: str) -> str:
9393
"""
9494
Calculate the state root for the given `alloc`.
9595
"""
96+
if type(withdrawals) is list and len(withdrawals) == 0:
97+
# Optimize returning the empty root immediately
98+
return "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" # noqa: E501
99+
96100
env: Dict[str, Any] = {
97101
"currentCoinbase": "0x0000000000000000000000000000000000000000",
98102
"currentDifficulty": "0x0",

0 commit comments

Comments
 (0)