diff --git a/newsfragments/2117.bugfix.rst b/newsfragments/2117.bugfix.rst new file mode 100644 index 0000000000..fc5cea42c3 --- /dev/null +++ b/newsfragments/2117.bugfix.rst @@ -0,0 +1 @@ +Encode block_count as hex before making eth_feeHistory RPC call \ No newline at end of file diff --git a/web3/_utils/method_formatters.py b/web3/_utils/method_formatters.py index cc4b87ea69..c556960f15 100644 --- a/web3/_utils/method_formatters.py +++ b/web3/_utils/method_formatters.py @@ -392,7 +392,10 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]: PYTHONIC_REQUEST_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = { # Eth - RPC.eth_feeHistory: apply_formatter_at_index(to_hex_if_integer, 1), + RPC.eth_feeHistory: compose( + apply_formatter_at_index(to_hex_if_integer, 0), + apply_formatter_at_index(to_hex_if_integer, 1) + ), RPC.eth_getBalance: apply_formatter_at_index(to_hex_if_integer, 1), RPC.eth_getBlockByNumber: apply_formatter_at_index(to_hex_if_integer, 0), RPC.eth_getBlockTransactionCountByNumber: apply_formatter_at_index(