Skip to content

Commit

Permalink
fix: throw error on missing account
Browse files Browse the repository at this point in the history
  • Loading branch information
mistakia committed Apr 24, 2024
1 parent 8014567 commit c93c7ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/rollup-daily-ledger.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ const rollup_daily_balance_distribution = async ({

// update account_frontiers
daily_account_state_changes.forEach((change) => {
account_frontiers_cache.set(change.account, change)
if (change && change.account) {
account_frontiers_cache.set(change.account, change)
} else {
log('Invalid account state change:', change)
throw new Error('Invalid account state change')
}
})

log(`calculating daily stats for ${account_frontiers_cache.size} accounts`)
Expand Down

0 comments on commit c93c7ba

Please sign in to comment.