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

Improve test coverage of applyOurTxToUTxO. #3042

Conversation

jonathanknowles
Copy link
Contributor

@jonathanknowles jonathanknowles commented Dec 1, 2021

Issue Number

ADP-1039

Summary

This PR improves test coverage of the applyOurTxToUTxO function.

Background

The existing property prop_applyOurTxToUTxO_allOurs tests applyOurTxToUTxO in a context where all addresses and reward accounts are identified as "ours". In this context, we can assert that applyOurTxToUTxO returns a an updated UTxO set that is identical to applyTxToUTxO.

Details

This PR adds a new property prop_applyOurTxToUTxO_someOurs that is similar to the above property, except that only some Address and RewardAccount values are marked as "ours". In this context we can no longer assert any equivalence between applyOurTxToUTxO and applyTxToUTxO, but we can assert that applyOurTxToUTxO only returns a result when isOurTx returns True.

@jonathanknowles jonathanknowles force-pushed the jonathanknowles/adp-1039/increase-testability-of-wallet-state-transition-functions-2 branch from 451e124 to 82f54c5 Compare December 1, 2021 07:38
@jonathanknowles jonathanknowles self-assigned this Dec 1, 2021
@jonathanknowles jonathanknowles changed the title Improve test coverage of isOurTx and applyOurTxToUTxO. Improve test coverage of applyOurTxToUTxO. Dec 1, 2021
Base automatically changed from jonathanknowles/adp-1039/increase-testability-of-wallet-state-transition-functions to master December 1, 2021 08:20
This type encapsulates a pair of filter conditions for matching entities
with `IsOurs`, useful in contexts where it's necessary to match two
different types of entity.
This change relocates the `AllOurs` type so that it is together with
other mock implementations of `IsOurs`.
@jonathanknowles jonathanknowles force-pushed the jonathanknowles/adp-1039/increase-testability-of-wallet-state-transition-functions-2 branch from 6f8f247 to ab0f1a2 Compare December 1, 2021 08:38
@jonathanknowles
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Dec 2, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit 45301f5 into master Dec 2, 2021
@iohk-bors iohk-bors bot deleted the jonathanknowles/adp-1039/increase-testability-of-wallet-state-transition-functions-2 branch December 2, 2021 04:10
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