2018-01-16 14:46:53 -08:00
|
|
|
#!/opt/anaconda3/bin/python
|
|
|
|
|
|
|
|
from web3 import Web3
|
2018-03-14 14:47:31 -07:00
|
|
|
from toml import load
|
|
|
|
import sys
|
2018-01-16 14:46:53 -08:00
|
|
|
|
2018-03-14 14:47:31 -07:00
|
|
|
test_env_db = '/home/koal/parity/bridge/test_env_db.toml'
|
|
|
|
try:
|
|
|
|
test_env = load(test_env_db)
|
|
|
|
except:
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
bridge_config = load(test_env['bridge_config'])
|
|
|
|
|
|
|
|
IPC_file = bridge_config['home']['ipc']
|
|
|
|
web3 = Web3(Web3.IPCProvider(IPC_file))
|
2018-01-16 14:46:53 -08:00
|
|
|
|
2018-02-11 15:10:43 -08:00
|
|
|
signer = web3.toChecksumAddress("0x842eb2142c5aa1260954f07aae39ddee1640c3a7")
|
|
|
|
sender = web3.toChecksumAddress("0x37a30534da3d53aa1867adde26e114a3161b2b12")
|
2018-04-11 13:34:56 -07:00
|
|
|
accounts_list = [signer, sender]
|
2018-02-11 15:10:43 -08:00
|
|
|
|
2018-04-11 13:34:56 -07:00
|
|
|
if (len(sys.argv) == 2):
|
|
|
|
if (sys.argv[1] == "--all"):
|
|
|
|
accounts_list = web3.eth.accounts
|
|
|
|
else:
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
for i in accounts_list:
|
2018-01-16 14:46:53 -08:00
|
|
|
balance=web3.eth.getBalance(i)
|
|
|
|
print(i, ":", web3.fromWei(balance, 'ether'))
|