This repository has been archived by the owner on Aug 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 632
[CBR-461] Improve diagnostic for NotEnoughMoney
error
#3702
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When computing fees or making a transaction, it could happen that funds are currently "locked" out because selected in a pending transaction. In such case, the UTxO can't be spent until the transaction has been accepted by (at least) a node. The API currently returns a NotEnoughMoney error in such case, whereas the total balance (as returned by /api/v1/wallets/{walletId} endpoint) might show enough funds. This refines a bit the `NotEnoughMoney` error to make the reason of failure clearer without breaking (too much) the existing API.
Integration tests failing as "expected":
Investigating in [CBR-462] |
adinapoli-iohk
approved these changes
Oct 3, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -60,6 +60,7 @@ | |||
|
|||
- The codebase now relies on the package `cryptonite` (instead of `ed25519`) for Ed25519 implementation (CO-325) | |||
|
|||
- **[API BREAKING CHANGE]** Improve diagnostic for `NotEnoughMoney` error (CBR-461) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminds me also of https://iohk.myjetbrains.com/youtrack/issue/CBR-449, heh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -350,7 +350,7 @@ $errors | |||
errors = T.intercalate "\n" rows | |||
rows = | |||
-- 'WalletError' | |||
[ mkRow fmtErr $ NotEnoughMoney 1400 | |||
[ mkRow fmtErr $ NotEnoughMoney (ErrAvailableBalanceIsInsufficient 1400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good lad!
KtorZ
added a commit
that referenced
this pull request
Nov 9, 2018
…ot-enough-money-error [CBR-461] Improve diagnostic for `NotEnoughMoney` error
KtorZ
added a commit
to input-output-hk/cardano-wallet-legacy
that referenced
this pull request
Nov 9, 2018
…hk/KtorZ/CBR-461/improve-not-enough-money-error [CBR-461] Improve diagnostic for `NotEnoughMoney` error
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When computing fees or making a transaction, it could happen that funds
are currently "locked" out because selected in a pending transaction. In
such case, the UTxO can't be spent until the transaction has been
accepted by (at least) a node. The API currently returns a
NotEnoughMoney error in such case, whereas the total balance (as
returned by /api/v1/wallets/{walletId} endpoint) might show enough
funds.
This refines a bit the
NotEnoughMoney
error to make the reasonof failure clearer without breaking (too much) the existing API.
NOTE: There's one "expected" failing integration test which actually shed the light on a newly discovered bug (0 fee transaction).
Linked issue
[CBR-461]
Type of change
Developer checklist
Testing checklist
[ ] All new and existing tests passed.QA Steps
Screenshots (if available)