Skip to content

Commit

Permalink
fix: target different blocks for live/dev network
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed May 4, 2024
1 parent d281b6c commit beae4c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion brownie/network/middlewares/geth_poa.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
class GethPOAMiddleware(BrownieMiddlewareABC):
@classmethod
def get_layer(cls, w3: Web3, network_type: str) -> Optional[int]:
block_ident = "latest" if network_type == "live" else 0
try:
w3.eth.get_block(0)
w3.eth.get_block(block_ident)
return None
except ExtraDataLengthError:
return -1
Expand Down

0 comments on commit beae4c5

Please sign in to comment.