Skip to content

Commit

Permalink
Merge branch 'chains/cheqd/testnet' into chains/cheqd/mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
filipdjokic committed Jul 16, 2024
2 parents 30e072c + e3e2a6d commit 806c474
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class MsgWithdrawValidatorCommission {

static getWithdrawalAmount(log?: Log) {
const withdrawEvents =
log?.events ?? [].filter((x: { type: string }) => x.type === 'withdraw_commission');
log?.events?.filter((x: { type?: string }) => x.type === 'withdraw_commission') ?? [];
const withdrawAmounts =
withdrawEvents?.[0]?.attributes?.filter((x: { key?: string }) => x.key === 'amount') ?? [];
withdrawEvents[0]?.attributes?.filter((x: { key?: string }) => x.key === 'amount') ?? [];

const amounts = (withdrawAmounts?.[0]?.value ?? '0').split(',').map((x) => {
const amounts = (withdrawAmounts[0]?.value ?? '0').split(',').map((x) => {
const [amount, denom = primaryTokenUnit] = x.match(/[a-z]+|[^a-z]+/gi) ?? [];
return formatToken(amount, denom);
});
Expand Down

0 comments on commit 806c474

Please sign in to comment.