-
Notifications
You must be signed in to change notification settings - Fork 10
Add More WalletAPIError Types
#141
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
49da0a5
Add `WalletAPIError` Types
MitchyCola 3dc9936
Error message for missing tx-out value
MitchyCola 5a81d08
Apply Formatting
MitchyCola c070f79
Fix from hlint
MitchyCola 07d2597
Move isZero TxOut Check
MitchyCola 39eed0b
Copy Empty TxOut Check
MitchyCola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
I think this check should also be in
buildTx.Additional thing to consider, is that there will be no
calculateMinUtxoin Vasil compliant version, so check here will be no more andbuild-rawinbuildTxwill start to fail.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.
Currently, the check for empty list is redundant because, when we call
calculateMinUtxofromcalculateMinUtxos(present inBalance.hs) there's always some value present in the txOut. But it nevertheless make sense to handle this case, in case anyone tries to callcalculateMinUtxowhere thetxOutValueis not always non-zero. But after vasil compliance of BPI this function would be redundant, and so would be the need to check for iftxOutValueis non-zero.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.
@IAmPara0x
Why does it always have some value there? Because of minimum Ada adjustment?
Uh oh!
There was an error while loading. Please reload this page.
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.
We need to call
calculateMinUtxowhen we want to get minimum amount of lovelace that should be present in aTxOutof aTx, this is required during balancing. But, if there's aTxOutwith zero value then we don't need to consider it as an actual output to a Tx, hence don't need to callcalculateMinUtxo.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.
I do agree that this check should be moved to
buildTx.@IAmPara0x This check was added for the specific case in which a transaction would only contain a zero
Valueas the output. Which would result in an empty list from the changes that I made here: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.
@MitchyCola oh, I get it now. Thanks for pointing it out!.
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.
Since the error is originating from the use of
calculateMinUtxosinside ofbalanceTxLoop(inBalance.hs), the error gets thrown before the use ofbuildTx. Therefore, I decided to move the check intopreBalancedTx.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.
What if just put check in both
calculateMinUtxosandbuildTx? It will keep this commit in working state, and vasil update will just removecalculateMinUtxos.It feels like omitting check that result of
txOutOptscan return[]will shoot one day.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.
Fixed