Assertion definitions and parameters
An Assertion is a DSL(Domain Specific Language) that contains a set of steps to describe how to fetch and calculate the final data. The DSL itself is code and can be auto-generated to Parachain runtime codes or TypeScript SDK codes.
pros
enabling flexibility, isolation, and abstract module of assertions;
standardizes the data fetch and assertion calculate/validate logic;
it can cover most use cases for the issuer;
improve the verifiability of assertions with trustless auto-generated codes.
cons
has a higher barrier for issuers to organize or write assertions;
has a larger Json file size.
The supported src
, op
and dst
in each Rule
are described as follows:
Data type of
src
anddst
NULL
Boolean
Number: int / long / float / double/decimal
String
Object
Array[Boolean/Number/String/Object]
Operator
op
+(add), -(subtract), *(multiply), /(divide)
%, round()
, >= , <, <= , ==, !=
in, not in
contains, not contains
includes one
size, sum, average
owns
Data type and Operator Binding
Boolean: >, >= , <, <= , ==, !=, in, not in
Number: >, >= , <, <= , ==, !=, in, not in
String: >, >= , <, <= , ==, !=, in, not in
Object: (if comparable) >, >= , <, <= , ==, !=,
Array: ==, !=, in, not in, contains, not contains, includes one, size, sum, average
Last updated