-
Notifications
You must be signed in to change notification settings - Fork 217
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
Add more conditions to CoinSelection.verifySelection
function.
#2972
Merged
iohk-bors
merged 12 commits into
master
from
jonathanknowles/adp-1037/test-coin-selection-5
Oct 13, 2021
Merged
Add more conditions to CoinSelection.verifySelection
function.
#2972
iohk-bors
merged 12 commits into
master
from
jonathanknowles/adp-1037/test-coin-selection-5
Oct 13, 2021
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
jonathanknowles
changed the title
Add more checks to
Add more conditions to Oct 13, 2021
CoinSelection.verifySelection
function.CoinSelection.verifySelection
function.
Use this function to simplify `prepareOutputsInternal`.
Use this function to simplify `prepareOutputsInternal`.
This prevents an unfortunate name collision with the constructors of the `SelectionError` data type.
Use this function to simplify: - `verifySelectionOutputSizes` - `verifySelectionOutputTokenQuantities`
jonathanknowles
force-pushed
the
jonathanknowles/adp-1037/test-coin-selection-5
branch
from
October 13, 2021 05:36
a8d1fd1
to
fa73b01
Compare
The `selectionHasValidSurplus` function will mark a selection as invalid if it has a surplus that is greater than the maximum cost, as defined by the by `selectionMaximumCost` function. Therefore, we should include this maximum cost in the error report.
sevanspowell
approved these changes
Oct 13, 2021
bors r+ |
iohk-bors bot
added a commit
that referenced
this pull request
Oct 13, 2021
2972: Add more conditions to `CoinSelection.verifySelection` function. r=jonathanknowles a=jonathanknowles ## Issue Number ADP-1037 ## Summary This PR adds further conditions to the pre-existing `CoinSelection.verifySelection` function. We now verify that every selection output (regardless of whether it is an ordinary output or a generated change output): - does not have an ada quantity below the minimum set by the protocol. - does not have a serialized size that exceeds the limit set by the protocol. - does not have any token quantities that exceed the limit set by the protocol. This PR also adjusts `verifySelection` to report **_all_** errors it encounters, rather than just the first error. ## Example Failure The following example shows multiple verification failures: ![multiple-verification-failures](https://user-images.githubusercontent.com/206319/137082445-9a81a86e-d924-4fcc-96c4-7c67137be01a.png) Co-authored-by: Jonathan Knowles <[email protected]>
Build failed: Saw this very strange error in the log:
I'll see if it's a sporadic error by re-running the failed jobs. EDIT: I re-ran the failed jobs and they all passed. I'll initiate another merge attempt. |
bors r+ |
Build succeeded: |
iohk-bors
bot
deleted the
jonathanknowles/adp-1037/test-coin-selection-5
branch
October 13, 2021 10:38
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue Number
ADP-1037
Summary
This PR adds further conditions to the pre-existing
CoinSelection.verifySelection
function.We now verify that every selection output (regardless of whether it is an ordinary output or a generated change output):
This PR also adjusts
verifySelection
to report all errors it encounters, rather than just the first error.Example Failure
The following example shows multiple verification failures: