Skip to content

Commit

Permalink
fix: handle missing total_balance daily ledger stats
Browse files Browse the repository at this point in the history
  • Loading branch information
mistakia committed May 23, 2024
1 parent c1efe5b commit 736677b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/pages/ledger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ const mapStateToProps = createSelector(getLedger, (ledger) => {

// calculate relative supply distribution
const total_supply = base_ranges.reduce((acc, r) => {
return acc + BigInt(d[`${r}_total_balance`])
return acc + BigInt(d[`${r}_total_balance`] || 0)
}, BigInt(0))

base_ranges.forEach((r) => {
const total_balance = BigInt(d[`${r}_total_balance`])
const total_balance = BigInt(d[`${r}_total_balance`] || 0)
const relative_supply = BigNumber(total_balance)
.div(total_supply)
.times(100)
Expand Down

0 comments on commit 736677b

Please sign in to comment.