Skip to content

Commit

Permalink
Don't format if 'withdrawals' coming back from get_block is null (#2941)
Browse files Browse the repository at this point in the history
* Don't format if 'withdrawals' coming back from get_block is null

* Add newsfragment
  • Loading branch information
kclowes authored May 1, 2023
1 parent 29262c9 commit a87816c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/2941.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add check for null withdrawal field on get_block response
4 changes: 3 additions & 1 deletion web3/_utils/method_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]:
)
),
"transactionsRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
"withdrawals": apply_formatter_to_array(withdrawal_result_formatter),
"withdrawals": apply_formatter_if(
is_not_null, apply_list_to_array_formatter(withdrawal_result_formatter)
),
"withdrawalsRoot": apply_formatter_if(is_not_null, to_hexbytes(32)),
}

Expand Down

0 comments on commit a87816c

Please sign in to comment.