Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/live 15542 aptos send receive fix send funds simulation failed when amount to send is slightly above max spendable amount #8766

Open
wants to merge 3 commits into
base: feat/integrate-aptos
Choose a base branch
from

Conversation

may01
Copy link

@may01 may01 commented Dec 24, 2024

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

During simulation of transaction, if the tx amount is lower then account balance, but we don't have enough founds to cover fees, then we get the "Abort" error from the network.
To avoid additional message during this errors the amount check is added for the unprocessed errors.

❓ Context

  • JIRA or GitHub link:

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@may01 may01 requested review from a team as code owners December 24, 2024 17:50
Copy link

vercel bot commented Dec 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-tools ❌ Failed (Inspect) Dec 27, 2024 7:12pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 7:12pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 7:12pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 7:12pm

@live-github-bot live-github-bot bot added desktop Has changes in LLD mobile Has changes in LLM common Has changes in live-common ui Has changes in the design system library ledgerjs Has changes in the ledgerjs open source libs tools Has changes in tools translations Translation files have been touched cli labels Dec 24, 2024
@may01 may01 changed the base branch from develop to feat/integrate-aptos December 24, 2024 17:57
Comment on lines 74 to 76
const expectedGas = BigNumber(gasLimit * gasPrice);
if (transaction.amount.plus(expectedGas).isGreaterThan(account.spendableBalance)) {
break;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to move this check to an early exit before line 54 const simulation = await aptosClient.simulateTransaction(publicKeyEd, tx);?
It seems like it to me, and that would result in tidier code (not a fan of test inside default cases)

…eceive-fix-send-funds-simulation-failed-when-amount-to-send-is-slightly-above-max-spendable-amount
@live-github-bot live-github-bot bot removed desktop Has changes in LLD mobile Has changes in LLM ui Has changes in the design system library ledgerjs Has changes in the ledgerjs open source libs tools Has changes in tools translations Translation files have been touched cli labels Dec 27, 2024
@live-github-bot
Copy link
Contributor

live-github-bot bot commented Dec 27, 2024

Desktop Bundle Checks

Comparing aab02c5 against 0e6ee7d.

⚠️ main bundle size significantly increased: 1.8mb -> 2mb. Please check if this is expected.
⚠️ renderer bundle size significantly increased: 36.7mb -> 38.1mb. Please check if this is expected.
⚠️ @opentelemetry/semantic-conventions library is now duplicated in main (regression)
⚠️ @opentelemetry/core library is now duplicated in main (regression)
⚠️ ms library is now duplicated in main (regression)
⚠️ debug library is now duplicated in main (regression)
⚠️ ajv library is now duplicated in main (regression)
⚠️ @celo/base/lib/address library is now duplicated in renderer (regression)
⚠️ @celo/base/lib/signatureUtils library is now duplicated in renderer (regression)
⚠️ @celo/utils/lib/address library is now duplicated in renderer (regression)
⚠️ @celo/utils/lib/solidity library is now duplicated in renderer (regression)
⚠️ @celo/utils/lib/signatureUtils library is now duplicated in renderer (regression)

Mobile Bundle Checks

Comparing aab02c5 against 0e6ee7d.

⚠️ main.ios.jsbundle bundle size significantly increased: 60.2mb -> 61.9mb. Please check if this is expected.
⚠️ main.android.jsbundle bundle size significantly increased: 60.3mb -> 61.9mb. Please check if this is expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants