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

Add GovInfoEvent and add event testing capabilities to ImpTest #4169

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

Soupstraw
Copy link
Contributor

@Soupstraw Soupstraw commented Mar 6, 2024

Description

This PR adds an event to EPOCH which contains sets with expired and enacted governance actions and a set with all the governance action IDs that are unclaimed.

I also added a way to write tests about events and cleaned up Conway events. The ConwayUtxosEventis necessary because we have to get rid of PPUP events in Conway as we no longer have a PPUP rule.

resolves #4165

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

@Soupstraw Soupstraw force-pushed the jj/newepoch-event branch 12 times, most recently from 7fba68f to 3883f4d Compare March 11, 2024 10:55
@Soupstraw Soupstraw marked this pull request as ready for review March 11, 2024 10:55
@Soupstraw Soupstraw force-pushed the jj/newepoch-event branch 3 times, most recently from 5f0c672 to 6ecc76f Compare March 11, 2024 14:22
@Soupstraw Soupstraw changed the title Add GovInfoEvent Add GovInfoEvent and add event testing capabilities to ImpTest Mar 11, 2024
@Soupstraw Soupstraw force-pushed the jj/newepoch-event branch 4 times, most recently from 6bcdf07 to 9c0dae8 Compare March 12, 2024 11:17
@Soupstraw Soupstraw enabled auto-merge (rebase) March 12, 2024 15:42
@teodanciu
Copy link
Contributor

Will finish reviewing tomorrow, there's a lot here! (some of it above my head)

@Soupstraw Soupstraw force-pushed the jj/newepoch-event branch 7 times, most recently from 72ff7e5 to 04b42c6 Compare March 14, 2024 14:39
Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

I still don't understand what we wouldn't be able to do without the new EraRuleEvent ( I don't even see any type annotations being removed, if anything, we seem to have added more , like going from:
mapM_ (tellEvent . SuccessfulPlutusScriptsEvent) (nonEmpty ps) to mapM_ (tellEvent . injectEvent @"UTXOS" . SuccessfulPlutusScriptsEvent @era) (nonEmpty ps), for example ),
but I can tell it's the technique used for EraRuleFailure, so I'll approve and hope to understand better one day.

@Soupstraw
Copy link
Contributor Author

I still don't understand what we wouldn't be able to do without the new EraRuleEvent ( I don't even see any type annotations being removed, if anything, we seem to have added more , like going from: mapM_ (tellEvent . SuccessfulPlutusScriptsEvent) (nonEmpty ps) to mapM_ (tellEvent . injectEvent @"UTXOS" . SuccessfulPlutusScriptsEvent @era) (nonEmpty ps), for example ), but I can tell it's the technique used for EraRuleFailure, so I'll approve and hope to understand better one day.

The main point for adding EraRuleEvent is to enable using injectEvent. Without it we'd run into the same issue that #4071 was solving, but with events. This injectEvent will be useful for writing tests and also makes it easier to reuse existing rules in future eras. It's a bit of an ugly solution, but we should be able to make it better when we refactor after Conway.

@Soupstraw Soupstraw merged commit 6764449 into master Mar 15, 2024
15 checks passed
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.

Add a NewEpoch event for proposals and their refunds
2 participants