Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions build/ganache.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
#!/usr/bin/python3

import json
import os
import subprocess
import sys
from pprint import pprint

print(sys.argv)
if len(sys.argv) < 2:
print("you must provide accounts file")
exit(1)

# read the accounts (key, balance) and start ganache-cli with those accounts
cmd = ""
args = ["ganache-cli", "--allowUnlimitedContractSize", "--gasLimit", "0xfffffffffff"]
with open(sys.argv[1]) as f:
data = json.load(f)
for account in data['accounts']:
cmd = "{} --account=\"0x{},{}\"".format(cmd, account['key'], account['amount'])
args.append("--account=0x{},{}".format(account['key'], account['amount']))

process = subprocess.call(["ganache-cli --allowUnlimitedContractSize --gasLimit 0xfffffffffff {} > /dev/null".format(cmd)], shell=True)
with open(os.devnull, 'w') as devnull:
process = subprocess.call(args, stdout=devnull)