1
1
import contextlib
2
2
import logging
3
- import warnings
4
3
from typing import TYPE_CHECKING , Any
5
4
6
5
from eth_typing import URI
7
6
from web3 import AsyncWeb3
8
- from web3 ._utils .fee_utils import async_fee_history_priority_fee
9
7
from web3 .eth import AsyncEth
10
- from web3 .exceptions import MethodUnavailable
11
8
from web3 .middleware import async_geth_poa_middleware
12
9
from web3 .net import AsyncNet
13
10
from web3 .providers .async_rpc import AsyncHTTPProvider
14
- from web3 .types import AsyncMiddleware , RPCEndpoint , RPCResponse , Wei
11
+ from web3 .types import AsyncMiddleware , RPCEndpoint , RPCResponse
15
12
16
13
from sw_utils .decorators import can_be_retried_aiohttp_error , retry_aiohttp_errors
17
14
@@ -111,30 +108,6 @@ def set_retry_timeout(self, retry_timeout: int):
111
108
self .retry_timeout = retry_timeout
112
109
113
110
114
- # pylint: disable=abstract-method
115
- class ExtendedAsyncEth (AsyncEth ):
116
- """
117
- todo: remove when PR gets merged
118
- https://github.com/ethereum/web3.py/pull/3084
119
- """
120
-
121
- @property
122
- async def max_priority_fee (self ) -> Wei :
123
- """
124
- Try to use eth_maxPriorityFeePerGas but, since this is not part
125
- of the spec and is only supported by some clients, fall back to
126
- an eth_feeHistory calculation with min and max caps.
127
- """
128
- try :
129
- return await self ._max_priority_fee ()
130
- except (ValueError , MethodUnavailable ):
131
- warnings .warn (
132
- 'There was an issue with the method eth_maxPriorityFeePerGas. '
133
- 'Calculating using eth_feeHistory.'
134
- )
135
- return await async_fee_history_priority_fee (self )
136
-
137
-
138
111
def get_execution_client (
139
112
endpoints : list [str ], is_poa = False , timeout = 60 , retry_timeout = 0
140
113
) -> AsyncWeb3 :
@@ -143,7 +116,7 @@ def get_execution_client(
143
116
)
144
117
client = AsyncWeb3 (
145
118
provider ,
146
- modules = {'eth' : (ExtendedAsyncEth ,), 'net' : AsyncNet },
119
+ modules = {'eth' : (AsyncEth ,), 'net' : AsyncNet },
147
120
)
148
121
149
122
if is_poa :
0 commit comments