Class: Bool
Table of contents
Constructors
Properties
Methods
- and
- assertEquals
- assertFalse
- assertTrue
- equals
- not
- or
- sizeInFields
- toBoolean
- toField
- toFields
- toJSON
- toString
- and
- assertEqual
- check
- count
- equal
- fromJSON
- not
- ofFields
- or
- sizeInFields
- toField
- toFields
- toInput
- toJSON
Constructors
constructor
• new Bool(x
)
Parameters
Name | Type |
---|---|
x | boolean | Bool |
Defined in
Properties
Unsafe
▪ Static
Unsafe: Object
Type declaration
Name | Type |
---|---|
ofField | (x : string | number | boolean | Field ) => Bool |
Defined in
Methods
and
▸ and(y
): Bool
Parameters
Name | Type | Description |
---|---|---|
y | boolean | Bool | A [[Bool ]] to AND with this [[Bool ]]. |
Returns
a new [[Bool
]] that is set to true only if
this [[Bool
]] and y
are also true.
Defined in
assertEquals
▸ assertEquals(y
): void
Proves that this [[Bool
]] is equal to y
.
Parameters
Name | Type | Description |
---|---|---|
y | boolean | Bool | a [[Bool ]]. |
Returns
void
Defined in
assertFalse
▸ assertFalse(): void
Proves that this [[Bool
]] is false
.
Returns
void
Defined in
assertTrue
▸ assertTrue(): void
Proves that this [[Bool
]] is true
.
Returns
void
Defined in
equals
▸ equals(y
): Bool
Returns true if this [[Bool
]] is equal to y
.
Parameters
Name | Type | Description |
---|---|---|
y | boolean | Bool | a [[Bool ]]. |
Returns
Defined in
not
▸ not(): Bool
Returns
a new [[Bool
]] that is the negation of this [[Bool
]].
Defined in
or
▸ or(y
): Bool
Parameters
Name | Type | Description |
---|---|---|
y | boolean | Bool | a [[Bool ]] to OR with this [[Bool ]]. |
Returns
a new [[Bool
]] that is set to true if either
this [[Bool
]] or y
is true.
Defined in
sizeInFields
▸ sizeInFields(): number
Returns
number
Defined in
toBoolean
▸ toBoolean(): boolean
This converts the [[Bool
]] to a javascript boolean.
This can only be called on non-witness values.
Returns
boolean
Defined in
toField
▸ toField(): Field
Converts a [[Bool
]] to a [[Field
]]. false
becomes 0 and true
becomes 1.
Returns
Defined in
toFields
▸ toFields(): Field
[]
Returns
Field
[]
Defined in
toJSON
▸ 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
Defined in
toString
▸ 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
Defined in
and
▸ Static
and(x
, y
): Bool
Parameters
Name | Type |
---|---|
x | boolean | Bool |
y | boolean | Bool |
Returns
Defined in
assertEqual
▸ Static
assertEqual(x
, y
): void
Parameters
Name | Type |
---|---|
x | boolean | Bool |
y | boolean | Bool |
Returns
void
Defined in
check
▸ Static
check(x
): void
Parameters
Name | Type |
---|---|
x | Bool |
Returns
void
Defined in
count
▸ Static
count(x
): Field
Parameters
Name | Type |
---|---|
x | boolean [] | Bool |
Returns
Defined in
equal
▸ Static
equal(x
, y
): Bool
Parameters
Name | Type |
---|---|
x | boolean | Bool |
y | boolean | Bool |
Returns
Defined in
fromJSON
▸ Static
fromJSON(x
): null
| Bool
Parameters
Name | Type |
---|---|
x | JSONValue |
Returns
null
| Bool
Defined in
not
▸ Static
not(x
): Bool
Parameters
Name | Type |
---|---|
x | boolean | Bool |
Returns
Defined in
ofFields
▸ Static
ofFields(fields
): Bool
Parameters
Name | Type |
---|---|
fields | Field [] |
Returns
Defined in
or
▸ Static
or(x
, y
): Bool
Parameters
Name | Type |
---|---|
x | boolean | Bool |
y | boolean | Bool |
Returns
Defined in
sizeInFields
▸ Static
sizeInFields(): number
Returns
number
Defined in
toField
▸ Static
toField(x
): Field
The constant [[Bool
]] that is false
.
Parameters
Name | Type |
---|---|
x | boolean | Bool |
Returns
Defined in
toFields
▸ Static
toFields(x
): Field
[]
Parameters
Name | Type |
---|---|
x | Bool |
Returns
Field
[]
Defined in
toInput
▸ Static
toInput(x
): Object
Parameters
Name | Type |
---|---|
x | Bool |
Returns
Object
Name | Type |
---|---|
packed | [Field , number ][] |
Defined in
toJSON
▸ Static
toJSON(x
): JSONValue
Parameters
Name | Type |
---|---|
x | Bool |
Returns
JSONValue