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

Test that coin selections do not have fees that are excessively high. #2936

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Sep 30, 2021

Issue Number

ADP-1037

Summary

This PR provides a safety mechanism to ensure that selections produced by CoinSelection.Balance do not have fees that are excessively high.

Details

This PR:

  • introduces the selectionMaximumCost function, which is defined in terms of selectionMinimumCost.
  • uses selectionMaximumCost within the selectionHasValidSurplus function, which in turn is used within property tests to verify every single generated selection.

Additionally, this commit uses `selectionMaximumCost` within the
`selectionHasValidSurplus` function, which is used by the property test
suite to verify that every single generated selection is valid.
@jonathanknowles jonathanknowles self-assigned this Sep 30, 2021
@jonathanknowles jonathanknowles changed the title Add function selectionMaximumCost to CoinSelection.Balance. Test that coin selections do not have fees that are excessively high. Sep 30, 2021
@jonathanknowles
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Sep 30, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit e7375f5 into master Sep 30, 2021
@iohk-bors iohk-bors bot deleted the jonathanknowles/adp-1037/selection-maximum-cost branch September 30, 2021 08:31
WilliamKingNoel-Bot pushed a commit that referenced this pull request Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants