-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2848: Move important UTxO state transition functions to the top-level and test them r=jonathanknowles a=sevanspowell This work is intended to allow future modifications to the UTxO state transition function (i.e. collateral) to be tested in isolation, at the unit level. My changes are primarily to the nested function "applyTx". I have tried to keep my changes minimal: - Use more verbose variable names in that function to make the purpose of each variable clear. - More clearly delineate between transaction outputs that are unspent and transaction outputs "we know about" but may possibly be spent. - Make some effort to separate the ideas of "knowledge of a UTxO" from "ownership of a UTxO" to make testing easier. - Extract out the core state transition function from the existing "do lots" "applyTx" function and move it to the top-level. - Move other useful functions to the top-level for the same reason. - Test important functions in wallet model spec. - Re-implement hasKnownInput/hasKnownOutput to make their implementations a little more clear and symmetric. ### Comments These changes make testing collateral much easier, we can just test the "applyTxToUTxO" function at the unit level, and adjust existing model tests as necessary. ### Issue Number ADP-1092 Co-authored-by: Samuel Evans-Powell <[email protected]> Co-authored-by: Jonathan Knowles <[email protected]>
- Loading branch information
Showing
8 changed files
with
555 additions
and
100 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.