diff --git a/newsfragments/2482.bugfix.rst b/newsfragments/2482.bugfix.rst new file mode 100644 index 0000000000..5841e2001c --- /dev/null +++ b/newsfragments/2482.bugfix.rst @@ -0,0 +1 @@ +format receipt.type to int and log.data to HexBytes diff --git a/web3/_utils/method_formatters.py b/web3/_utils/method_formatters.py index 7a1ff17a7b..5826e2d005 100644 --- a/web3/_utils/method_formatters.py +++ b/web3/_utils/method_formatters.py @@ -180,7 +180,7 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]: 'logIndex': to_integer_if_hex, 'address': to_checksum_address, 'topics': apply_list_to_array_formatter(to_hexbytes(32)), - 'data': to_ascii_if_bytes, + 'data': HexBytes, } @@ -201,6 +201,7 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]: 'from': apply_formatter_if(is_not_null, to_checksum_address), 'to': apply_formatter_if(is_address, to_checksum_address), 'effectiveGasPrice': to_integer_if_hex, + 'type': to_integer_if_hex, }