# Assert Condition

# check

  • function check(condition: boolean, message: string): void

    This function verifies that the condition is true. If false, the entire transaction will abort, reverting all actions and table storage changes.


    import { check } from "proton-tsc"
    doAction(): void {
      // Will abort
      check(1 != 1, "invalid math!")
      // Will not execute past this point, since last check aborted