Skip to content

Commit 33375bd

Browse files
author
Nikita P
committed
fix: more logging for set balance
1 parent 961a7f0 commit 33375bd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/balance.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ def set_balance_in_wei(address, balance):
66
account = accounts.at(address, force=True)
77
providers = ["evm_setAccountBalance", "hardhat_setBalance", "anvil_setBalance"]
88

9+
log_string = ""
10+
911
for provider in providers:
1012
if account.balance() == balance:
1113
break
1214

1315
try:
14-
web3.provider.make_request(provider, [address, hex(balance)])
16+
resp = web3.provider.make_request(provider, [address, hex(balance)])
1517
except ValueError as e:
18+
log_string += f"ERR1: {provider}: {e.args[0].get('message')}, RESP: {resp}"
1619
if e.args[0].get("message") != f"Method {provider} is not supported":
1720
raise e
1821

19-
assert account.balance() == balance, f"FSB: EXP: {balance} ACT: {account.balance()} ADDR: {address}"
22+
assert account.balance() == balance, f"FSB: EXP: {balance} ACT: {account.balance()} ADDR: {address}, ERR: {log_string}"
2023
return account
2124

2225

0 commit comments

Comments
 (0)