Skip to main content

REPL-only functions

REPL-only functions are used to control environment settings and expected behavior when testing module code in the Pact REPL.

FunctionDescription
begin‑txBegin a new transaction with an optional name.
commit‑txCommit the current transaction.
continue‑pactContinue a previously-initiated multi-step transaction.
env‑chain‑dataDefine chain information for transactions in the testing environment.
env‑dataSet transaction data for the testing environment
env‑enable‑repl‑nativesControl whether REPL native functions are allowed in module code.
env‑eventsRetrieve any accumulated events.
env‑exec‑configQuery or set execution configuration information for the testing environment.
env‑gasQuery the current gas state or set it to a specific value.
env‑gaslimitSet the environment gas limit to a specific value.
env‑gaslogEnable gas logging for a block of code.
env‑gasmodelQuery or update the current gas model.
env‑hashSet the current transaction hash.
env‑keysSet the transaction signer keys (deprecated).
env‑milligasQuery the current gas state in units of one one thousandth of a gas unit.
env‑module‑adminAcquire the module administrative rights for any module loaded in the REPL.
env‑namespace‑policyInstall a managed namespace policy.
env‑set‑debug‑flagSet the Pact interpreter debug flags.
env‑set‑milligasSet the current gas state to a specific value in units of one one thousandth of a gas unit.
env‑sigsSet signature keys for signing transactions and granting capabilities.
env‑verifiersSet transaction verifier names and capabilities.
expect‑failureEvaluate an expression and succeed only if the expressions results in an error.
expect‑thatEvaluate an expression and succeed if the resulting value passes a predicate function.
expectEvaluate an expression and verify that the result equals an expected value.
loadLoad and evaluate a specified .pact or .repl file.
pact‑stateInspect state from most recent defpact execution.
printConvert a value into a string and print it to the REPL output.
rollback‑txRoll back the current transaction.
sig-keysetBuild a keyset guard from keys present in message signatures.
test‑capabilityAcquire or install the capability specified.
typecheckRun the Pact static type checker on a module.