Skip to content

Commit

Permalink
Merge DisablePact411 and DisableVerifiers (#1338)
Browse files Browse the repository at this point in the history
* list-modules local

* test for local-only behavior

* fix libcrypto in cabal.project

* regen docs

* use ghc964 in nix

* all tests pass

* merge DisableVerifiers with DisablePact411

* run docgen

* update nix flake and flake.lock

---------

Co-authored-by: chessai <[email protected]>
  • Loading branch information
jmcardon and chessai authored Feb 16, 2024
1 parent 1779158 commit 31b2b6a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
16 changes: 8 additions & 8 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:
&nbsp;&nbsp;`CHARSET_ASCII:integer = 0`

### CHARSET_LATIN1 {#CHARSET_LATIN1}

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

Constant:
Constant:
&nbsp;&nbsp;`CHARSET_LATIN1:integer = 1`

### at {#at}
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*&nbsp;`integer` *&rarr;*&nbsp;`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*&nbsp;`integer` *&rarr;*&nbsp;`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*&nbsp;`integer` *&rarr;*&nbsp;`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*&nbsp;`string` *&rarr;*&nbsp;`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 @@ -1971,7 +1971,7 @@ Retreive any accumulated events and optionally clear event state. Object returne
*&rarr;*&nbsp;`[string]`


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","DisableVerifiers","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
5 changes: 2 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Kadena's Pact smart contract language";

inputs = {
hs-nix-infra.url = "github:kadena-io/hs-nix-infra/chessai/update-1";
hs-nix-infra.url = "github:kadena-io/hs-nix-infra";
flake-utils.url = "github:numtide/flake-utils";
};

Expand Down
10 changes: 5 additions & 5 deletions src/Pact/Interpreter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ disablePact47Natives = disablePactNatives pact47Natives FlagDisablePact47
disablePact410Natives :: ExecutionConfig -> Endo RefStore
disablePact410Natives = disablePactNatives pact410Natives FlagDisablePact410

disableVerifierNatives :: ExecutionConfig -> Endo RefStore
disableVerifierNatives = disablePactNatives verifierNatives FlagDisableVerifiers
disablePact411Natives :: ExecutionConfig -> Endo RefStore
disablePact411Natives = disablePactNatives pact411Natives FlagDisablePact411

pact40Natives :: [Text]
pact40Natives = ["enumerate" , "distinct" , "emit-event" , "concat" , "str-to-list"]
Expand All @@ -275,8 +275,8 @@ pact47Natives = ["dec"]
pact410Natives :: [Text]
pact410Natives = ["poseidon-hash-hack-a-chain"]

verifierNatives :: [Text]
verifierNatives = ["enforce-verifier", "hyperlane-message-id"]
pact411Natives :: [Text]
pact411Natives = ["enforce-verifier", "hyperlane-message-id"]

initRefStore :: RefStore
initRefStore = RefStore nativeDefs
Expand All @@ -292,7 +292,7 @@ versionedNativesRefStore ec = versionNatives initRefStore
, disablePact46Natives ec
, disablePact47Natives ec
, disablePact410Natives ec
, disableVerifierNatives ec ]
, disablePact411Natives ec ]

mkSQLiteEnv :: Logger -> Bool -> PSL.SQLiteConfig -> Loggers -> IO (PactDbEnv (DbEnv PSL.SQLite))
mkSQLiteEnv initLog deleteOldFile c loggers = do
Expand Down
2 changes: 0 additions & 2 deletions src/Pact/Types/Runtime.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ data ExecutionFlag
| FlagDisablePact410
-- | Disable Pact 4.11 Features
| FlagDisablePact411
-- | Disable verifiers
| FlagDisableVerifiers
deriving (Eq,Ord,Show,Enum,Bounded)

-- | Flag string representation
Expand Down

0 comments on commit 31b2b6a

Please sign in to comment.