Skip to content

Instantly share code, notes, and snippets.

@aserranoni
Created February 6, 2024 23:36
Show Gist options
  • Save aserranoni/eacf235e953e59c7374de255e7e67ffc to your computer and use it in GitHub Desktop.
Save aserranoni/eacf235e953e59c7374de255e7e67ffc to your computer and use it in GitHub Desktop.
Simple repl example showing bad interaction between typechecking/ formal verification with where function
(begin-tx "module")
(env-data
{ 'ns-admin-keyset: ["admin"]
, 'ns-operate-keyset: ["operate"]
, 'ns-genesis-keyset: { "keys": [], "pred": "="}
, 'ns: "la"
, 'upgrade:false})
(env-keys ["admin", "operate"])
(define-namespace 'la (read-keyset 'ns-admin-keyset) (read-keyset 'ns-genesis-keyset))
(namespace (read-msg 'ns))
(module fv-test GOV
(defcap GOV () true)
(defschema my-schema
prop:string)
(deftable my-table:{my-schema})
(defun get-prop-rows (prop-val:string)
(let (
(entries (filter (where 'prop (= prop-val)) my-table))
)
entries
)
)
)
(commit-tx)
(begin-tx "la")
(typecheck "la.fv-test")
(commit-tx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment