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

strip ALL pact value infos, recursively as well, add tests #1287

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

jmcardon
Copy link
Member

See #1284 for sample output

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • Documentation has been updated if new natives or FV properties have been added. To generate new documentation, issue cabal run tests. If they pass locally, docs are generated.
  • Any changes that could be relevant to users have been recorded in the changelog
  • In case of changes to the Pact trace output (pact -t), make sure pact-lsp is in sync.

Additionally, please justify why you should or should not do the following:

  • Confirm replay/back compat
  • Benchmark regressions
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact

@@ -129,6 +130,14 @@ stripPactValueInfo = \case
PGuard gu -> PGuard gu
PModRef mr -> PModRef mr{_modRefInfo = def }

stripAllPactValueInfo :: PactValue -> PactValue
stripAllPactValueInfo = \case
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: stripPactValueInfo above isn't even enough, the author of that code did not cover PGuard which can recursively contain pact values, the tests in this PR in hash.repl have a case with a user guard which does indeed fail if not stripped recursively.

@@ -25,27 +31,39 @@
; pre fork module hashing
(insert-hash "a" (hash my-mod))
(insert-hash "b" (hash my-mod))
(insert-hash "c" (hash [my-mod, {'a:my-mod}, (create-user-guard (f my-mod))]))
Copy link
Member Author

Choose a reason for hiding this comment

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

this covers all cases recursively for my-mod.

PactValues are:

  • lists
  • objects
  • guards (can contain them recursively too)
  • literals
  • modrefs

Literals cannot contain any pactvalues, so it's just the other 3 cases we must check.

@jmcardon jmcardon merged commit 75a3c9f into master Aug 21, 2023
@jmcardon jmcardon deleted the jose/infos-recursive branch May 10, 2024 16:24
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