Skip to main content
Last updated

Authorization operators

authorized-by

Use authorized-by to check whether the transaction is signed by an authorized keyset guard.

Basic syntax

pact
(authorized-by keyset)
pact
(authorized-by keyset)

Parameters

ParameterTypeDescription
keysetstringSpecifies the keyset string.

Return type

Returns a bool type that indicates whether the specified keyset guard is satisfied by the executing transaction.

Example

pact
(authorized-by "bbccc99ec9eeed17d60159fbb88b09e30ec5e63226c34544e64e750ba424d35e")
pact
(authorized-by "bbccc99ec9eeed17d60159fbb88b09e30ec5e63226c34544e64e750ba424d35e")

Support

Supported in properties only.

row-enforced

Use row-enforced to check whether the keyset in the row is enforced by the function under analysis.

Basic syntax

pact
(row-enforced t c r)
pact
(row-enforced t c r)
  • takes t: a
  • takes c: b
  • takes r: string
  • produces bool
  • where a is of type table or string
  • where b is of type column or string

Support

Supported in properties only.

is-principal

Use is-principal to check whether the specified string conforms to the principal format without proving validity.

Basic syntax

pact
(is-principal s)
pact
(is-principal s)

Parameters

ParameterTypeDescription
sstringSpecifies the string to check the formatting for.

Return type

Returns a bool type that indicates whether the specified string s has the format of a principal.

Support

Supported in either invariants or properties.

typeof-principal

Use typeof-principal to check the protocol type of the specified string s value. If input value is not a principal data type, then the empty string is returned.

Basic syntax

pact
(typeof-principal s)
pact
(typeof-principal s)

Parameters

ParameterTypeDescription
sstringSpecifies the string to check the protocol type of.

Return type

If input value is not a principal data type, then the empty string is returned.

Support

Supported in either invariants or properties.