Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bool

Hierarchy

  • Bool

Index

Constructors

Properties

Unsafe: { ofField: any }

Type declaration

  • ofField:function
    • ofField(x: string | number | boolean | Field): Bool
    • Converts a Field into a Bool. This is a dangerous operation as it assumes that the field element is either 1 or 0 (which might not be true).

      Parameters

      Returns Bool

Methods

  • assertEquals(y: boolean | Bool): void
  • assertFalse(): void
  • assertTrue(): void
  • sizeInFields(): number
  • toBoolean(): boolean
  • This converts the Bool to a javascript [[boolean]]. This can only be called on non-witness values.

    Returns boolean

  • toJSON(): JSONValue
  • Serialize the Bool to a JSON string. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

    Returns JSONValue

  • toString(): string
  • Serialize the Bool to a string, e.g. for printing. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

    Returns string

  • assertEqual(x: boolean | Bool, y: boolean | Bool): void
  • check(x: Bool): void
  • fromJSON(x: JSONValue): null | Bool
  • sizeInFields(): number
  • toInput(x: Bool): { packed: [Field, number][] }
  • toJSON(x: Bool): JSONValue

Generated using TypeDoc