Created
June 16, 2020 13:57
-
-
Save mariano-aguero/316d73907daeee128529122f76c63ab7 to your computer and use it in GitHub Desktop.
Sender example
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
type request is record | |
callback : contract(int) | |
end | |
type action is | |
| GetBar of (request) | |
| SetBar of (int) | |
type store is record | |
bar: int; | |
end | |
type return is list (operation) * store | |
function getBar (const r: request; var store: store): return is (list [Tezos.transaction(store.bar, 0mutez, r.callback)], store); | |
function setBar (const value : int ; var store : store) : return is ((nil : list (operation)), store with record [bar = value]); | |
function main (const action: action; var store: store): return is | |
block { | |
skip | |
} with case action of | |
| GetBar(n) -> getBar(n, store) | |
| SetBar(n) -> setBar(n, store) | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment