Skip to content

Commit

Permalink
[fix] GethPOAMiddleware on development anvil network
Browse files Browse the repository at this point in the history
  • Loading branch information
kx9x committed Aug 31, 2024
1 parent 428ad1e commit 3dab9ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions brownie/network/middlewares/geth_poa.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
class GethPOAMiddleware(BrownieMiddlewareABC):
@classmethod
def get_layer(cls, w3: Web3, network_type: str) -> Optional[int]:
block_ident = "latest" if network_type == "live" else 0
block_idents = ["latest"] if network_type == "live" else [0, "latest"]
try:
w3.eth.get_block(block_ident)
for block_ident in block_idents:
w3.eth.get_block(block_ident)
return None
except ExtraDataLengthError:
return -1
Expand Down

0 comments on commit 3dab9ff

Please sign in to comment.