Created
September 19, 2017 12:09
-
-
Save simform-solutions/7784d85089082f4333492c120c9e4f8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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