Skip to content

Commit

Permalink
refactor: use fselmos solution
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Oct 27, 2023
1 parent 4948c42 commit 25335c3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ape_test/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def connect(self):
mnemonic=self.config.mnemonic,
num_accounts=self.config.number_of_accounts,
)
endpoints = get_endpoints(chain_id)
endpoints = {**API_ENDPOINTS}
endpoints["eth"] = merge(endpoints["eth"], {"chainId": static_return(chain_id)})
tester = EthereumTesterProvider(ethereum_tester=self._evm_backend, api_endpoints=endpoints)
self._web3 = Web3(tester)

Expand Down Expand Up @@ -277,8 +278,3 @@ def get_virtual_machine_error(self, exception: Exception, **kwargs) -> VirtualMa

else:
return VirtualMachineError(base_err=exception, **kwargs)


def get_endpoints(chain_id: int):
eth_endpoints = merge(API_ENDPOINTS["eth"], {"chainId": static_return(chain_id)})
return merge(API_ENDPOINTS, {"eth": eth_endpoints})

0 comments on commit 25335c3

Please sign in to comment.