From fe49c06c22228bf19bc0ba1c281044a44d48ab16 Mon Sep 17 00:00:00 2001 From: Jon Ator Date: Tue, 4 Jun 2024 18:19:09 -0500 Subject: [PATCH] feedback --- packages/tx/src/events.ts | 4 ++-- packages/tx/src/gas.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/tx/src/events.ts b/packages/tx/src/events.ts index 54937dd1fe..09d569e3aa 100644 --- a/packages/tx/src/events.ts +++ b/packages/tx/src/events.ts @@ -15,8 +15,8 @@ export function getSumTotalSpenderCoinsSpent( if (type !== "coin_spent") return; if (attributes.length === 0) return; const spendAttribute = attributes.find((attr) => attr.key === "spender"); - if (!spendAttribute) return; - if (spendAttribute.value !== spenderBech32Address) return; + if (!spendAttribute || spendAttribute.value !== spenderBech32Address) + return; // a comma separated list of coins spent const coinsSpentRawAttribute = attributes.find( diff --git a/packages/tx/src/gas.ts b/packages/tx/src/gas.ts index 8614bb0e8e..d6b22a9eb0 100644 --- a/packages/tx/src/gas.ts +++ b/packages/tx/src/gas.ts @@ -300,12 +300,12 @@ export async function getGasFeeAmount({ const feeBalances: { denom: string; amount: string }[] = []; // iterate in order of fee denoms - chainFeeDenoms.forEach((denom) => { + for (const denom of chainFeeDenoms) { const balance = balances.find((balance) => balance.denom === denom); if (balance) { feeBalances.push(balance); } - }); + } if (!feeBalances.length) { throw new InsufficientFeeError(