Skip to content

Commit

Permalink
list-modules local
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcardon committed Dec 11, 2023
1 parent 495c873 commit b3152c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
18 changes: 9 additions & 9 deletions docs/en/pact-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

Constant denoting the ASCII charset

Constant:
Constant:
  `CHARSET_ASCII:integer = 0`

### CHARSET_LATIN1 {#CHARSET_LATIN1}

Constant denoting the Latin-1 charset ISO-8859-1

Constant:
Constant:
  `CHARSET_LATIN1:integer = 1`

### at {#at}
Expand Down Expand Up @@ -461,7 +461,7 @@ Return ID if called during current pact execution, failing if not.
Obtain current pact build version.
```lisp
pact> (pact-version)
"4.9"
"4.10"
```

Top level only: this function will fail if used in module code.
Expand Down Expand Up @@ -765,7 +765,7 @@ Top level only: this function will fail if used in module code.

Select rows from TABLE using QRY as a predicate with both key and value, and then accumulate results of the query in CONSUMER. Output is sorted by the ordering of keys.
```lisp
(let*
(let*
((qry (lambda (k obj) true)) ;; select all rows
(f (lambda (k obj) [(at 'firstName obj), (at 'b obj)]))
)
Expand Down Expand Up @@ -924,7 +924,7 @@ pact> (add-time (time "2016-07-22T12:00:00Z") 15)
*n* `integer` *→* `decimal`


N days, for use with 'add-time'
N days, for use with 'add-time'
```lisp
pact> (add-time (time "2016-07-22T12:00:00Z") (days 1))
"2016-07-23T12:00:00Z"
Expand Down Expand Up @@ -962,7 +962,7 @@ pact> (format-time "%F" (time "2016-07-22T12:00:00Z"))
*n* `integer` *→* `decimal`


N hours, for use with 'add-time'
N hours, for use with 'add-time'
```lisp
pact> (add-time (time "2016-07-22T12:00:00Z") (hours 1))
"2016-07-22T13:00:00Z"
Expand All @@ -976,7 +976,7 @@ pact> (add-time (time "2016-07-22T12:00:00Z") (hours 1))
*n* `integer` *→* `decimal`


N minutes, for use with 'add-time'.
N minutes, for use with 'add-time'.
```lisp
pact> (add-time (time "2016-07-22T12:00:00Z") (minutes 1))
"2016-07-22T12:01:00Z"
Expand All @@ -1000,7 +1000,7 @@ pact> (parse-time "%F" "2016-09-12")
*utcval* `string` *→* `time`


Construct time from UTCVAL using ISO8601 format (%Y-%m-%dT%H:%M:%SZ).
Construct time from UTCVAL using ISO8601 format (%Y-%m-%dT%H:%M:%SZ).
```lisp
pact> (time "2016-07-22T11:26:35Z")
"2016-07-22T11:26:35Z"
Expand Down Expand Up @@ -1947,7 +1947,7 @@ Retreive any accumulated events and optionally clear event state. Object returne
*→* `[string]`


Queries, or with arguments, sets execution config flags. Valid flags: ["AllowReadInLocal","DisableHistoryInTransactionalMode","DisableInlineMemCheck","DisableModuleInstall","DisableNewTrans","DisablePact40","DisablePact410","DisablePact42","DisablePact43","DisablePact431","DisablePact44","DisablePact45","DisablePact46","DisablePact47","DisablePact48","DisablePact49","DisablePactEvents","DisableRuntimeReturnTypeChecking","EnforceKeyFormats","OldReadOnlyBehavior","PreserveModuleIfacesBug","PreserveModuleNameBug","PreserveNsModuleInstallBug","PreserveShowDefs"]
Queries, or with arguments, sets execution config flags. Valid flags: ["AllowReadInLocal","DisableHistoryInTransactionalMode","DisableInlineMemCheck","DisableModuleInstall","DisableNewTrans","DisablePact40","DisablePact410","DisablePact411","DisablePact42","DisablePact43","DisablePact431","DisablePact44","DisablePact45","DisablePact46","DisablePact47","DisablePact48","DisablePact49","DisablePactEvents","DisableRuntimeReturnTypeChecking","EnforceKeyFormats","OldReadOnlyBehavior","PreserveModuleIfacesBug","PreserveModuleNameBug","PreserveNsModuleInstallBug","PreserveShowDefs"]
```lisp
pact> (env-exec-config ['DisableHistoryInTransactionalMode]) (env-exec-config)
["DisableHistoryInTransactionalMode"]
Expand Down
1 change: 1 addition & 0 deletions src/Pact/Native.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ typeof'' i as = argsError i as

listModules :: RNativeFun e
listModules i _ = do
unlessExecutionFlagSet FlagDisablePact411 $ checkNonLocalAllowed i
mods <- keys (_faInfo i) Modules
return $ toTermList tTyString $ map asString mods

Expand Down
2 changes: 2 additions & 0 deletions src/Pact/Types/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ data ExecutionFlag
| FlagDisablePact49
-- | Disable Pact 4.10 Features
| FlagDisablePact410
-- | Disable Pact 4.11 Features
| FlagDisablePact411
deriving (Eq,Ord,Show,Enum,Bounded)

-- | Flag string representation
Expand Down
2 changes: 1 addition & 1 deletion tests/pact/toplevel.repl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
(begin-tx)

;; ease restrictions requiring namespaced keysets
(env-exec-config ["DisablePact44"])
(env-exec-config ["DisablePact44", "DisablePact410"])
;; define-keyset success case
(define-keyset 'k (sig-keyset))

Expand Down

0 comments on commit b3152c8

Please sign in to comment.