Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 461 Bytes

File metadata and controls

11 lines (7 loc) · 461 Bytes

assert_eq

The assert_eq function is automatically imported into every program from the prelude. It takes two expressions which are compared and the result is a Boolean. If the value is false then the virtual machine will revert.

Example

Here is a function which asserts that a and b must be equal.

{{#include ../../../code/operations/assertions/src/lib.sw:assert_eq}}