kadena-io / pact-5

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

Chore: Separate repl into separate project, fix REPL docs output #277

Closed jmcardon closed 3 weeks ago

jmcardon commented 3 weeks ago

This PR separates the REPL into its own sub-library which helpful for fixing several issues:

Before this PR: image

After this PR: image

PR checklist:

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

jmcardon commented 3 weeks ago

As of my last commit, it also fixes an annoying issue in the pact-5 repl that repl functions were actually going through the gas charging method, which when it actually charges gas, will essentially brick the repl.

The following is now possible:

pact>(env-gasmodel "table")
"Set gas model to table-based cost model"
pact>(env-gaslimit 1)
"Set gas limit to 1"
pact>(env-gas
env-gas             env-gaslimit        env-gaslog          env-gasmodel        env-gasmodel-fixed
pact>(+ "hello" "world")
(interactive):1:0: Gas limit "1"exceeded: 2
 1 | (+ "hello" "world")
   | ^^^^^^^^^^^^^^^^^^^

pact>(env-gas 0)
"Set gas to 0"