Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong network when accessing upstream provider [APE-1503] #1724

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ape/api/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ def upstream_provider(self) -> "UpstreamProvider":

config_choice = self._network_config.get("upstream_provider")
if provider_name := config_choice or self.upstream_network.default_provider:
return self.get_provider(provider_name)
return self.upstream_network.get_provider(provider_name)

raise NetworkError(f"Upstream network '{self.upstream_network}' has no providers.")

Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_network_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ def test_forked_networks(ethereum):
mainnet_fork = ethereum.mainnet_fork
assert mainnet_fork.upstream_network.name == "mainnet"
assert mainnet_fork.upstream_chain_id == 1
# Just make sure it doesn't fail when trying to access.
assert mainnet_fork.upstream_provider
Loading