Callcium
API

PolicyValidator

Build-time validation of policy blobs (PV-1 to PV-9).

Git Source

Functions

validate

Validates a policy blob (PV-1 to PV-9).

Reverts with the storage validation error of a blob that fails it. Storage validation runs first, because the descriptor check reads the descriptor before anything is decoded. Reverts with a format overflow error when a group's normal form exceeds a format limit. Issues of PV-1 to PV-7 name a rule where the blob stores it. Issues of PV-8 and PV-9 name the group where the blob stores it. They name a rule by its position in the normal form of the rules left in the group. A rule is left if it raises no PV-2, PV-3, PV-5 or PV-6 issue and no PV-4 issue on a test. PV-8 skips a loop that lost a body test to such an issue.

Git Source

function validate(bytes memory policy) internal pure returns (Issue[] memory);

Parameters

NameTypeDescription
policybytesThe policy blob.

Returns

NameTypeDescription
<none>Issue[]Every issue found, or one issue alone when the descriptor is not valid.

Errors

ValidationError

Thrown when validation reports any issue.

Git Source

error ValidationError(Issue[] issues);

Parameters

NameTypeDescription
issuesIssue[]Every issue found.

On this page