Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

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

Merged
jmcardon merged 2 commits intomasterfrom
jose/infos-recursive
Aug 21, 2023
Merged

strip ALL pact value infos, recursively as well, add tests#1287
jmcardon merged 2 commits intomasterfrom
jose/infos-recursive

Conversation

@jmcardon
Copy link
Copy Markdown
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

PModRef mr -> PModRef mr{_modRefInfo = def }

stripAllPactValueInfo :: PactValue -> PactValue
stripAllPactValueInfo = \case
Copy link
Copy Markdown
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.

; 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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants