Skip to main content
Version: 2.4.0

assert

function assert(stmt: boolean | Bool, message?: string): asserts stmt

Defined in: lib/provable/gadgets/common.ts:46

Assert that a statement is true. If the statement is false, throws an error with the given message. Can be used in provable code.

Parameters

stmt

boolean | Bool

message?

string

Returns

asserts stmt