Skip to content

Commit 8352a33

Browse files
committed
Don't format if 'withdrawals' coming back from get_block is null
1 parent 29262c9 commit 8352a33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

web3/_utils/method_formatters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]:
297297
)
298298
),
299299
"transactionsRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
300-
"withdrawals": apply_formatter_to_array(withdrawal_result_formatter),
300+
"withdrawals": apply_formatter_if(
301+
is_not_null, apply_list_to_array_formatter(withdrawal_result_formatter)
302+
),
301303
"withdrawalsRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
302304
}
303305

0 commit comments

Comments
 (0)