From 9d89582f22c8ff15cb79f9c794d5f41e3a4a030f Mon Sep 17 00:00:00 2001 From: idobn Date: Fri, 4 Feb 2022 20:13:00 +0200 Subject: [PATCH] Chainging w3.eth.fee_history parameter so that the default is not None It appears that fee_history must receive an array as the third parameter and it's default None value does not work with some json-rpc nodes. --- mev_inspect/fees.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mev_inspect/fees.py b/mev_inspect/fees.py index 2b4d35a..0a2d1f6 100644 --- a/mev_inspect/fees.py +++ b/mev_inspect/fees.py @@ -2,7 +2,7 @@ from web3 import Web3 async def fetch_base_fee_per_gas(w3: Web3, block_number: int) -> int: - base_fees = await w3.eth.fee_history(1, block_number) + base_fees = await w3.eth.fee_history(1, block_number, []) base_fees_per_gas = base_fees["baseFeePerGas"] if len(base_fees_per_gas) == 0: raise RuntimeError("Unexpected error - no fees returned")