Skip to content

Commit

Permalink
fix: fix error with the genesis report generator
Browse files Browse the repository at this point in the history
  • Loading branch information
mantramatt committed Oct 5, 2024
1 parent 53e0b19 commit d45c6ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions networks/visualize_genesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def main():
balance_data = []
for balance in balances:
address = balance['address']
amount = int(balance['coins'][0]['amount'])
balance_data.append({'address': address, 'amount': amount})
coins = balance.get('coins', [])
if coins: # Check if the coins list is not empty
amount = int(coins[0]['amount'])
balance_data.append({'address': address, 'amount': amount})

# Sort balance data by amount
balance_data.sort(key=lambda x: x['amount'], reverse=True)
Expand Down

0 comments on commit d45c6ed

Please sign in to comment.