Skip to content

Commit

Permalink
Merge pull request #1769 from eth-brownie/fix-poa-middleware
Browse files Browse the repository at this point in the history
fix: target different blocks for live/dev network
  • Loading branch information
iamdefinitelyahuman authored May 4, 2024
2 parents d281b6c + beae4c5 commit af61b40
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 af61b40

Please sign in to comment.