Skip to content

Commit

Permalink
Fix median fee calculation (#142)
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 authored Aug 7, 2023
1 parent 45cb25e commit 277eaa6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/common/execution.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 277eaa6

Please sign in to comment.