From 690957a47f18f75d104d9ae06af9fa9c1e5544cf Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Fri, 3 Nov 2023 12:09:34 -0500 Subject: [PATCH 1/2] fix: wrong network --- src/ape/api/networks.py | 2 +- tests/functional/test_network_api.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ape/api/networks.py b/src/ape/api/networks.py index 3e61153246..b372de6cde 100644 --- a/src/ape/api/networks.py +++ b/src/ape/api/networks.py @@ -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.") diff --git a/tests/functional/test_network_api.py b/tests/functional/test_network_api.py index 4eb487f744..69bdbc0201 100644 --- a/tests/functional/test_network_api.py +++ b/tests/functional/test_network_api.py @@ -40,3 +40,6 @@ 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 + From b202b44cb783fe03e9b704a473edd3af1de7b1e2 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Fri, 3 Nov 2023 14:13:53 -0500 Subject: [PATCH 2/2] chore: lint --- tests/functional/test_network_api.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functional/test_network_api.py b/tests/functional/test_network_api.py index 69bdbc0201..fbe08a23bc 100644 --- a/tests/functional/test_network_api.py +++ b/tests/functional/test_network_api.py @@ -42,4 +42,3 @@ def test_forked_networks(ethereum): assert mainnet_fork.upstream_chain_id == 1 # Just make sure it doesn't fail when trying to access. assert mainnet_fork.upstream_provider -