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 warnings to Repl #209

Merged
merged 2 commits into from
Sep 5, 2024
Merged

Add warnings to Repl #209

merged 2 commits into from
Sep 5, 2024

Conversation

jmcardon
Copy link
Member

This PR reintroduces runtime warnings, being optionally togged on or off, as well as a new warning whenever a module reference is used.

pact>(module m g (defcap g () true) (defun some-guard () (create-module-guard "boop")))
Loaded module m, hash OE27e8Ms6lBjXMdlolQQ9NyKJNc_EKEbsa_RjZGkOtY
pact>(some-guard)
Warning: Using deprecated native create-module-guard: Module guards have been deprecated and will be removed in a future release, please switch to capability guards
ModuleGuard {module: m,name: boop}
pact>(enforce-guard (some-guard))
Warning: Using deprecated native create-module-guard: Module guards have been deprecated and will be removed in a future release, please switch to capability guards
Warning: Module guard enforce detected. Module guards are known to be unsafe, and will be removed in a future version of pact
true
pact>

In the repl in particular: Warnings are printed after each expression execution and then cleared.

PR checklist:

  • Test coverage for the proposed changes
  • PR description contains example output from repl interaction or a snippet from unit test output
  • (If Relevant) Documentation has been (manually) updated at https://docs.kadena.io/pact

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

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

@jmcardon jmcardon marked this pull request as ready for review August 30, 2024 00:11
pact/Pact/Core/Info.hs Outdated Show resolved Hide resolved
pact/Pact/Core/Repl/Compile.hs Outdated Show resolved Hide resolved
Copy link
Member

@rsoeldner rsoeldner left a comment

Choose a reason for hiding this comment

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

nice 👍

pact/Pact/Core/Environment/Types.hs Outdated Show resolved Hide resolved
@jmcardon jmcardon merged commit bf7df79 into master Sep 5, 2024
12 checks passed
@jmcardon jmcardon deleted the jose/repl-warnings branch September 5, 2024 16:56
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.

2 participants