Skip to content

Commit

Permalink
fix: is_connected
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Feb 4, 2024
1 parent 9653d7b commit ebada18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions brownie/network/web3.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,15 @@ def disconnect(self) -> None:
self._chain_id = None
self._remove_middlewares()

def isConnected(self) -> bool:
def is_connected(self) -> bool:
if not self.provider:
return False
return super().is_connected()

def isConnected(self) -> bool:
# retained to avoid breaking an interface explicitly defined in brownie
return self.is_connected()

@property
def supports_traces(self) -> bool:
if not self.provider:
Expand All @@ -135,7 +139,7 @@ def supports_traces(self) -> bool:
@property
def _mainnet(self) -> _Web3:
# a web3 instance connected to the mainnet
if self.isConnected() and CONFIG.active_network["id"] == "mainnet":
if self.is_connected() and CONFIG.active_network["id"] == "mainnet":
return self
try:
mainnet = CONFIG.networks["mainnet"]
Expand Down

0 comments on commit ebada18

Please sign in to comment.