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

[DDW-427] Handle new transaction fee calculation error messages #1111

Merged

Conversation

nikolaglumac
Copy link
Contributor

@nikolaglumac nikolaglumac commented Oct 4, 2018

This PR introduces more granular error messages for transaction-fee-calculation Api endpoint:

Amount + fees exceeds walletBalance:
- error.diagnostic.details.msg === 'Not enough coins to cover fee.'
= show "Not enough Ada for fees. Try sending a smaller amount."
-----
Amount exceeds availableBalance due to pending transactions:
- error.diagnostic.details.msg === 'Not enough available coins to proceed.'
- total walletBalance > error.diagnostic.details.availableBalance
= show "Can not calculate fees while there are pending transactions."
-----
Amount exceeds walletBalance:
- error.diagnostic.details.msg === 'Not enough available coins to proceed.'
- total walletBalance === error.diagnostic.details.availableBalance
= show "Not enough Ada. Try sending a smaller amount."

Todo:

"api.errors.CanNotCalculateTransactionFeesError": "Can not calculate fees while there are pending transactions.",
"api.errors.NotEnoughFundsForTransactionError": "Not enough Ada. Try sending a smaller amount.",

Screenshots:

screen shot 2018-10-10 at 09 27 17
screen shot 2018-10-10 at 09 27 24
screen shot 2018-10-10 at 09 27 07


Review Checklist:

Basics

  • PR is updated to the most recent version of target branch (and there are no conflicts)
  • PR has good description that summarizes all changes and shows some screenshots or animated GIFs of important UI changes
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub
  • Automated tests: All acceptance tests are passing (yarn run test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn run dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn run package / CI builds)
  • There are no flow errors or warnings (yarn run flow:test)
  • There are no lint errors or warnings (yarn run lint)
  • Text changes are proofread and approved (Jane Wild)
  • There are no missing translations (running yarn run manage:translations produces no changes)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn run storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly documented and commented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-rendering
  • Any code that only works in Electron is neatly separated from components

Testing

  • New feature / change is covered by acceptance tests
  • All existing acceptance tests are still up-to-date
  • New feature / change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review:

  • Merge PR
  • Delete source branch
  • Move ticket to done on the Youtrack board

@nikolaglumac nikolaglumac requested a review from KtorZ October 5, 2018 09:59
KtorZ
KtorZ previously approved these changes Oct 8, 2018
Copy link
Contributor

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

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

👍

source/renderer/app/api/api.js Show resolved Hide resolved
source/renderer/app/api/api.js Show resolved Hide resolved
source/renderer/app/i18n/locales/ja-JP.json Show resolved Hide resolved
Copy link
Member

@DominikGuzei DominikGuzei left a comment

Choose a reason for hiding this comment

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

Looks great 👍

@DominikGuzei DominikGuzei merged commit 6cbb9de into develop Oct 10, 2018
@DominikGuzei DominikGuzei deleted the fix/ddw-427-handle-new-transaction-fee-calculation-errors branch October 10, 2018 09:30
This was referenced Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants