Skip to content

Commit

Permalink
fix(analytics): treat missing denom as balance of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Dec 19, 2024
1 parent 74ad2e2 commit 7e32627
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions apps/indexer/src/monitors/addressBalanceMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export class AddressBalanceMonitor {
const [targetAddress, targetToken] = monitoredValue.target.split("|");
const balance = await this.getBalance(targetAddress, targetToken);

if (balance === null) {
throw new Error("Unable to get balance for " + monitoredValue.target);
}

monitoredValue.value = balance.toString();
monitoredValue.lastUpdateDate = new Date();
await monitoredValue.save();
Expand All @@ -36,7 +32,7 @@ export class AddressBalanceMonitor {
const balance = response.data.balances.find(x => x.denom === (denom || activeChain.udenom));

if (!balance) {
return null;
return 0;
}

return parseInt(balance.amount);
Expand Down

0 comments on commit 7e32627

Please sign in to comment.