From a489b1f9184087a0abc47b3acc372eaf86d3fd97 Mon Sep 17 00:00:00 2001 From: darwintree <17946284+darwintree@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:13:30 +0800 Subject: [PATCH] fix(tests): local test account issue --- tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0435065..c4f4c9d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -49,11 +49,11 @@ def secret_key(node: LocalNode, worker_index: int, use_testnet: bool) -> Union[s Returns: str: secret key with enough balance """ + if not use_testnet: + return node.secrets[0] try: return node.secrets[worker_index] - except IndexError as e: - if not use_testnet: # faucet_account is enabled - raise e + except IndexError: w3 = Web3(Web3.HTTPProvider(node.url)) acct = w3.cfx.account.create() w3.wallet.add_account(acct)