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

Pact should not allow the usage of REPL natives in module code #95

Open
CryptoPascal31 opened this issue Feb 2, 2024 · 1 comment
Open

Comments

@CryptoPascal31
Copy link

CryptoPascal31 commented Feb 2, 2024

Pact legacy was disallowing by default REPL natives in module code.
Preventing developers testing modules that finally aren't deployable on chain.

Pact legacy was providing the convenient API (env-enable-repl-natives ) to however enable them for special cases.

Pact core always allows the usage of REPL natives in module code. IMO, it should not.

Since Pact core enables writing top-level functions, I'm not sure that (env-enable-repl-natives ) is still useful.

I suggest the following:

  • Always disable REPL natives in module context
  • But enable REPL natives in top-level functions (and ofc in top-level directly)
  • Do not implement (env-enable-repl-natives ) in Pact core
@jmcardon
Copy link
Member

jmcardon commented Feb 2, 2024

Since Pact core enables writing top-level functions, I'm not sure that (env-enable-repl-natives ) is still useful.

Top-level functions are repl-only. This is purely for convenience. I can disable them in .pact files in the future. They should only be enabled in .repl files.

Always disable REPL natives in module context

I'm ok with making it opt-in like prod. I've already used repl natives numerous times to debug contracts within pact-5 so I don't think I want to remove this capability.

I think we can implement env-enable-repl-natives with relative ease. I was already doing so in a separate branch, but work got halted for more important issues. We'll look into it again

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

No branches or pull requests

2 participants