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

Tools for constrained generation of types that need witnessing #4732

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Oct 30, 2024

This is a work in progress. Comment requested to be sure we build a usable set of tools.

When we write generators the TxBody, we need to make sure that some of the types generated can be witnessed.
Most types that need witnessing are hashes, just generating a random hash will not do, since that hash has to be the
hash of an actual object that we can compute, given the hash. Since that usually impossible, we will have do it backwards,
i.e. generate the object, then return the hash, and remember the association for when it comes time to produce the witness.

This is the role of the data WitUniv.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 3 times, most recently from dad09c4 to 79528fb Compare November 5, 2024 04:57
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 5 times, most recently from 97d3a82 to eaf2d94 Compare November 17, 2024 19:30
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 3 times, most recently from 66f5096 to a2b8b53 Compare December 3, 2024 16:59
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 2 times, most recently from 937a10c to 6f4713d Compare December 3, 2024 17:53
@TimSheard TimSheard marked this pull request as ready for review December 3, 2024 19:26
@TimSheard TimSheard requested a review from a team as a code owner December 3, 2024 19:26
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 2 times, most recently from 9451ca0 to 06d0007 Compare December 6, 2024 04:05
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 11 times, most recently from 892eacd to 162907c Compare December 14, 2024 05:27
@TimSheard TimSheard mentioned this pull request Dec 16, 2024
9 tasks
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch from 162907c to 3ca5487 Compare December 17, 2024 16:17
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor suggestions and questions

@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch from 08d0947 to 4a8d9b1 Compare December 17, 2024 22:12
Added the Witness class, and many instances.
Improved Specs to require witnesses where needed.
WitUniv used in DELEG POOL GOVCERT CERT and CERTS conformance rules
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch 2 times, most recently from 479a911 to c0000cb Compare December 17, 2024 23:18
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch from c0000cb to 3a57c95 Compare December 18, 2024 04:01
…ecification is failing. Add some property tests that conformsToSpec and conformsToSpecE report the "same" results.
@TimSheard TimSheard force-pushed the ts-constrained-witnessing branch from 3a57c95 to 928b27c Compare December 18, 2024 11:19
@TimSheard TimSheard merged commit d8b7a8c into master Dec 18, 2024
154 checks passed
@TimSheard TimSheard deleted the ts-constrained-witnessing branch December 18, 2024 15:43
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.

4 participants