ligo/src/test/contracts/match.religo
John David Pressman 71989876db Fix a bug, test added:
A never accounted message was not adding anything to the map
2020-01-08 20:58:26 +00:00

20 lines
307 B
Plaintext

type storage = int;
type param =
| Add(int)
| Sub(int);
let main2 = ((p: param), storage) => {
let storage =
storage
+ (
switch (p) {
| Add(n) => n
| Sub(n) => 0 - n
}
);
(([]: list(operation)), storage);
};
let main = (x: (param, storage)) => main2(x[0],x[1]);