From 277eaa6528d35c3b64a2e8da4db366197b5524aa Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Mon, 7 Aug 2023 16:30:52 +0300 Subject: [PATCH] Fix median fee calculation (#142) Signed-off-by: cyc60 --- src/common/execution.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/execution.py b/src/common/execution.py index 3c910405..139f7f2d 100644 --- a/src/common/execution.py +++ b/src/common/execution.py @@ -1,7 +1,6 @@ import logging import statistics -from eth_typing import HexStr from web3 import Web3 from web3.exceptions import MethodUnavailable from web3.types import Wei @@ -117,7 +116,7 @@ async def _calculate_median_priority_fee(block_id: str = 'latest') -> Wei: # collect maxPriorityFeePerGas for all transactions in the block priority_fees = [] for tx_hash in block.transactions: - tx = await execution_client.eth.get_transaction(tx_hash)(HexStr(tx_hash)) + tx = await execution_client.eth.get_transaction(tx_hash) if 'maxPriorityFeePerGas' in tx: priority_fees.append(tx.maxPriorityFeePerGas)