ligo/src/test/contracts/match_bis.mligo
2020-03-02 18:01:56 +01:00

18 lines
396 B
Plaintext

type storage = int
type parameter =
Increment of int
| Decrement of int
type return = operation list * storage
let add (a : int) (b : int) : int = a + b
let sub (a : int) (b : int) : int = a - b
let main (action, store : parameter * storage) : return =
let store =
match action with
Increment n -> add store n
| Decrement n -> sub store n
in ([] : operation list), store