Skip to main content
Version: Next

assert

module error

failwith: <a, b>(_: a) => b

Cause the testing framework to fail.

assert: (_: bool) => unit

The call assert(cond) terminates the execution with the string "failed assertion" if, and only if, the boolean condition cond is false. The failure is handled by LIGO's testing framework and not by Michelson's interpreter.

some: <a>(_: option<a>) => unit

The call some(opt) terminates the execution with the string "failed assert some" if, and only if, opt is ["None" as "None"]. The failure is handled by LIGO's testing framework and not by Michelson's interpreter.

none: <a>(_: option<a>) => unit

The call none(opt) terminates the execution with the string "failed assert none" if, and only if, opt is not ["None" as "None"]. The failure is handled by LIGO's testing framework and not by Michelson's interpreter.