diff --git a/README.md b/README.md index 7026d25..0c791f5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This plugin supports the following ecosystems: - Polygon - Arbitrum - Optimism +- Linea ## Dependencies diff --git a/ape_infura/__init__.py b/ape_infura/__init__.py index 327dfa3..aeb69f7 100644 --- a/ape_infura/__init__.py +++ b/ape_infura/__init__.py @@ -20,6 +20,10 @@ "mainnet", "mumbai", ], + "linea": [ + "mainnet", + "goerli", + ], } diff --git a/ape_infura/provider.py b/ape_infura/provider.py index 6f81e96..341c951 100644 --- a/ape_infura/provider.py +++ b/ape_infura/provider.py @@ -59,8 +59,9 @@ def connect(self): ethereum_goerli = 5 optimism = (10, 420) polygon = (137, 80001) + linea = (59144, 59140) - if self._web3.eth.chain_id in (ethereum_goerli, *optimism, *polygon): + if self._web3.eth.chain_id in (ethereum_goerli, *optimism, *polygon, *linea): self._web3.middleware_onion.inject(geth_poa_middleware, layer=0) self._web3.eth.set_gas_price_strategy(rpc_gas_price_strategy) diff --git a/setup.py b/setup.py index 40e8f8f..489cd4d 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ "ape-arbitrum", "ape-optimism", "ape-polygon", + "ape-linea", ], "lint": [ "black>=23.3.0,<24", # auto-formatter and linter diff --git a/tests/test_provider.py b/tests/test_provider.py index 8bc6e59..06f5cfd 100644 --- a/tests/test_provider.py +++ b/tests/test_provider.py @@ -17,6 +17,8 @@ ("optimism", "goerli"), ("polygon", "mainnet"), ("polygon", "mumbai"), + ("linea", "mainnet"), + ("linea", "goerli"), ], ) def test_infura(ecosystem, network):