Skip to content

Commit

Permalink
feat: add linea network support [APE-1170] (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
dawnseeker8 authored Aug 1, 2023
1 parent 3f6e251 commit 249c34d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This plugin supports the following ecosystems:
- Polygon
- Arbitrum
- Optimism
- Linea

## Dependencies

Expand Down
4 changes: 4 additions & 0 deletions ape_infura/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"mainnet",
"mumbai",
],
"linea": [
"mainnet",
"goerli",
],
}


Expand Down
3 changes: 2 additions & 1 deletion ape_infura/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"ape-arbitrum",
"ape-optimism",
"ape-polygon",
"ape-linea",
],
"lint": [
"black>=23.3.0,<24", # auto-formatter and linter
Expand Down
2 changes: 2 additions & 0 deletions tests/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
("optimism", "goerli"),
("polygon", "mainnet"),
("polygon", "mumbai"),
("linea", "mainnet"),
("linea", "goerli"),
],
)
def test_infura(ecosystem, network):
Expand Down

0 comments on commit 249c34d

Please sign in to comment.