Created
June 3, 2019 21:08
-
-
Save mightybyte/f795fd59cb9d1a42fd09bff1d75c2c6c to your computer and use it in GitHub Desktop.
Type error mentioned on Discord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Simplified example of a token implementation. | |
; When I run `(typecheck "my-token")` I get the error: | |
; > Typecheck my-token: Unable to resolve all types | |
(module my-token GOVERNANCE | |
(defschema accounts-schema | |
balance:integer | |
guard:guard | |
) | |
(deftable accounts-table:{accounts-schema}) | |
(defcap GOVERNANCE () | |
true | |
) | |
(defcap NULL_GUARD () | |
"Used as a placeholder when calling with-default-read." | |
false | |
) | |
(defun get-balance:integer (accountId:string) | |
(with-default-read accounts-table accountId | |
{ "balance" : 0, "guard" : NULL_GUARD } | |
{ "balance" := balance } | |
balance | |
) | |
) | |
) | |
(create-table accounts-table) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment