Assert
This commit is contained in:
parent
58ee2c39a6
commit
9b027f0051
|
@ -7,4 +7,10 @@ assert rawdata = SomeType
|
||||||
Causes the script to fail if the rawdata doesn't match the structure of datumtype
|
Causes the script to fail if the rawdata doesn't match the structure of datumtype
|
||||||
Otherwise, returns a value of SomeType
|
Otherwise, returns a value of SomeType
|
||||||
|
|
||||||
Primarily for validating input datums / redeemers.
|
Primarily for validating input datums / redeemers.
|
||||||
|
|
||||||
|
You can unpack (1-match) data in the assertion
|
||||||
|
|
||||||
|
```gleam
|
||||||
|
assert Some(x) = Option(Int)
|
||||||
|
```
|
Loading…
Reference in New Issue