Skip to content

Commit

Permalink
bankers rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Wozacosta committed Sep 5, 2024
1 parent aa01899 commit 02e4bdd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/ledger-live-mobile/e2e/specs/delegate/cosmos.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ describe("Cosmos delegate flow", () => {
const unit = getAccountUnit(testAccount);

const usableAmount = testAccount.spendableBalance.minus(COSMOS_MIN_SAFE).minus(COSMOS_MIN_FEES);
// Banker's rounding to avoid floating point errors
// NOTE: we could allow for some precision error here to avoid rounding issues

Check failure on line 42 in apps/ledger-live-mobile/e2e/specs/delegate/cosmos.spec.ts

View check run for this annotation

live-github-bot / @Mobile • Test App

prettier/prettier

Delete `·`
const delegatedAmount = usableAmount
.multipliedBy(delegatedPercent)
.div(100)
.integerValue(BigNumber.ROUND_CEIL);
.integerValue(BigNumber.ROUND_HALF_EVEN);
const remainingAmount = usableAmount.minus(delegatedAmount);

await app.stake.selectCurrency(testedCurrency);
Expand Down

0 comments on commit 02e4bdd

Please sign in to comment.