kadena-io / pact-5

The New Pact
BSD 3-Clause "New" or "Revised" License
8 stars 7 forks source link

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

Closed CryptoPascal31 closed 1 month ago

CryptoPascal31 commented 8 months ago

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:

jmcardon commented 8 months ago

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

jmcardon commented 1 month ago

This was completed by #114 in March.