Skip to content

Instantly share code, notes, and snippets.

@simform-solutions
Created September 19, 2017 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simform-solutions/7784d85089082f4333492c120c9e4f8c to your computer and use it in GitHub Desktop.
Save simform-solutions/7784d85089082f4333492c120c9e4f8c to your computer and use it in GitHub Desktop.
# Writes the index, address and balance, as well as the checksum of address + seed into the account file
def write_address_data(index, address, balance):
address = address_checksum(address)
for p in address_data:
if p["address"] == address:
p["balance"] = balance
with open(file_name, 'w') as account_data:
json.dump(raw_account_data, account_data)
return
checksum = get_checksum(address)
raw_account_data["account_data"][0]["address_data"].append({
'index': index,
'address': address,
'balance': balance,
'checksum': checksum
})
with open(file_name, 'w') as account_data:
json.dump(raw_account_data, account_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment