Skip to content

Commit

Permalink
Merge branch 'master' into npai/validate-running-balance-expected
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai authored May 10, 2024
2 parents 7888501 + ee28415 commit 8487670
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/monitor/Monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,18 @@ export class Monitor {
const chainId = parseInt(chainIdStr);
mrkdwn += `*Destination: ${getNetworkName(chainId)}*\n`;
for (const tokenAddress of Object.keys(amountByToken)) {
const { symbol, decimals } = this.clients.hubPoolClient.getTokenInfoForAddress(tokenAddress, chainId);
let symbol: string;
let unfilledAmount: string;
try {
let decimals: number;
({ symbol, decimals } = this.clients.hubPoolClient.getTokenInfoForAddress(tokenAddress, chainId));
unfilledAmount = convertFromWei(amountByToken[tokenAddress].toString(), decimals);
} catch {
symbol = tokenAddress; // Using the address helps investigation.
unfilledAmount = amountByToken[tokenAddress].toString();
}

// Convert to number of tokens for readability.
const unfilledAmount = convertFromWei(amountByToken[tokenAddress].toString(), decimals);
mrkdwn += `${symbol}: ${unfilledAmount}\n`;
}
}
Expand Down

0 comments on commit 8487670

Please sign in to comment.