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

Utxow Predicate failure tests #4213

Merged
merged 8 commits into from
May 23, 2024
Merged

Utxow Predicate failure tests #4213

merged 8 commits into from
May 23, 2024

Conversation

teodanciu
Copy link
Contributor

@teodanciu teodanciu commented Mar 22, 2024

Description

Tests for UTXOW Predicate failures, part of #4185

InvalidWitnessesUTXOW
MissingVKeyWitnessesUTXOW
MissingScriptWitnessesUTXOW
ScriptWitnessNotValidatingUTXOW
MissingTxBodyMetadataHash
MissingTxMetadata
ConflictingMetadataHash
InvalidMetadata
ExtraneousScriptWitnessesUTXOW
MissingRedeemers
MissingRequiredDatums
NotAllowedSupplementalDatums
PPViewHashesDontMatch
UnspendableUTxONoDatumHash
ExtraRedeemers
MalformedScriptWitnesses
MalformedReferenceScripts

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • 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)
  • 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)
  • 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

@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch 3 times, most recently from 214b4af to 7d4e35b Compare March 26, 2024 17:02
@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch 9 times, most recently from 97d0664 to 20ff045 Compare April 12, 2024 08:17
@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch 2 times, most recently from edcdac2 to f7487be Compare April 15, 2024 13:25
@teodanciu teodanciu marked this pull request as ready for review April 15, 2024 13:30
@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch 2 times, most recently from 91ec8ae to 9b06a3e Compare April 15, 2024 16:19
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.

This is really great work. There are a bunch of comments, but I think they all can improve the PR even more than it already is.

@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch from 9b06a3e to f0b3f9a Compare May 21, 2024 16:37
@teodanciu
Copy link
Contributor Author

I have rewritten most of these tests to make more use of postFixup. In the initial version, I was trying to produce the exact list of failures, and for that, the fixing up was more complicated and less comprehensible.
I have now switched to checking that the predicate failure under test is included in all failures, which allowed me an easier fixup.
Also, moved things around in order to run more tests, thanks to the new EraTxAuxData and EraScript instances.

If you wanted to have another look @lehins when you have time. Also, @neilmayhew - hope this isn't too much interfering with the work on your other (related) PR.

@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch from f0b3f9a to 68c10ef Compare May 21, 2024 16:45
@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch from 68c10ef to 7b6b3dd Compare May 21, 2024 23:10
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.

Ok, I do have a problem with submitFailingTxWithSubset. There is a proposed solution on how to solve this in the review.
Also the PredicteFailrues that do not roundtrip as expected can be tested for that as well.

Other than that this PR is looking much better than before 😉 thanks to all of the work you've done in other PRs.

@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch 6 times, most recently from b550f3d to 0bf021b Compare May 22, 2024 20:16
@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch from 0bf021b to e4311d0 Compare May 23, 2024 14:40
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.

Beautiful! Thank you!

@teodanciu teodanciu force-pushed the td/utxow-predfailures-tests branch from e4311d0 to e0ff234 Compare May 23, 2024 20:15
@teodanciu teodanciu enabled auto-merge May 23, 2024 20:15
@teodanciu teodanciu merged commit dcf9280 into master May 23, 2024
124 of 125 checks passed
@teodanciu teodanciu deleted the td/utxow-predfailures-tests branch May 23, 2024 21:52
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.

3 participants