ligo/src/test/contracts/failwith.ligo

13 lines
309 B
Plaintext
Raw Normal View History

2019-09-22 05:39:06 +04:00
type param is
| Zero of nat
| Pos of nat
function main (const p : param; const s : unit) : list(operation) * unit is
block {
case p of
| Zero (n) -> if n > 0n then failwith("fail") else skip
| Pos (n) -> if n > 0n then skip else failwith("fail")
end
}
with ((nil : list(operation)), s)