From f3bef3b0aa5b145ca65a547e61c6a1735dce1f08 Mon Sep 17 00:00:00 2001 From: pacrob Date: Thu, 26 May 2022 11:44:21 -0600 Subject: [PATCH] format receipt.type to int and log.data to HexBytes --- newsfragments/2482.bugfix.rst | 1 + web3/_utils/method_formatters.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 newsfragments/2482.bugfix.rst 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, }