diff --git a/ape_alchemy/provider.py b/ape_alchemy/provider.py index a428ef4..8f1b585 100644 --- a/ape_alchemy/provider.py +++ b/ape_alchemy/provider.py @@ -18,8 +18,7 @@ from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ExtraDataLengthError from web3.gas_strategies.rpc import rpc_gas_price_strategy -from web3.middleware import geth_poa_middleware -from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware +from web3.middleware import ExtraDataToPOAMiddleware from web3.middleware.validation import MAX_EXTRADATA_LENGTH from web3.types import RPCEndpoint @@ -134,7 +133,7 @@ def connect(self): polygon_amoy = 80002 if self._web3.eth.chain_id in (base, optimism, polygon, polygon_amoy): - self._web3.middleware_onion.inject(geth_poa_middleware, layer=0) + self._web3.middleware_onion.inject(ExtraDataToPOAMiddleware, layer=0) is_poa = True self._web3.eth.set_gas_price_strategy(rpc_gas_price_strategy) diff --git a/setup.py b/setup.py index 69027c0..acaea6d 100644 --- a/setup.py +++ b/setup.py @@ -75,11 +75,11 @@ include_package_data=True, install_requires=[ "eth-ape>=0.8.1,<0.9", - "eth-pydantic-types", # Use same version as eth-ape - "ethpm-types", # Use same version as eth-ape - "evm-trace", # Use same version as eth-ape - "web3", # Use same version as eth-ape - "requests", + "eth-pydantic-types>=0.1.3,<0.2", + "ethpm-types>=0.6.19,<0.7", + "evm-trace>=0.2.3,<0.3", + "web3>=7.6.0,<8", + "requests>=2.32.3,<3", ], python_requires=">=3.9,<4", extras_require=extras_require,