Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 313 Bytes

assert.md

File metadata and controls

16 lines (11 loc) · 313 Bytes

Assert

assert rawdata = SomeType

Causes the script to fail if the rawdata doesn't match the structure of datumtype Otherwise, returns a value of SomeType

Primarily for validating input datums / redeemers.

You can unpack (1-match) data in the assertion

assert Some(x) = Option(Int)