Skip to content

Commit

Permalink
fix(tests): local test account issue
Browse files Browse the repository at this point in the history
  • Loading branch information
darwintree committed Dec 17, 2024
1 parent 71d4621 commit a489b1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a489b1f

Please sign in to comment.