Skip to content

Commit

Permalink
check for low precision (#3388)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator authored Jun 25, 2024
1 parent a138b3c commit d160638
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/tx/src/gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ export async function getGasFeeAmount({

// Check if this balance is not enough or fee amount is too little (not enough precision) to pay the fee, if so skip.
if (
new Dec(feeAmount).gt(new Dec(amount)) ||
new Dec(feeAmount).lte(new Dec(0))
new Int(feeAmount).gt(new Int(amount)) ||
new Int(feeAmount).lte(new Int(1))
)
continue;

Expand Down Expand Up @@ -383,7 +383,7 @@ export async function getGasFeeAmount({

for (const { amount, feeAmount, denom } of spentFees) {
// check for gas price conversion having too little precision
if (new Dec(feeAmount).lte(new Dec(0))) continue;
if (new Int(feeAmount).lte(new Int(1))) continue;

const spentAmount =
coinsSpent.find((coinSpent) => coinSpent.denom === denom)?.amount || "0";
Expand Down

0 comments on commit d160638

Please sign in to comment.