Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- scriptFromString :: ReadP ( Script a) -> String -> Either ErrValidateScript ( Script a)
- scriptToText :: Show a => Script a -> Text
- scriptParser :: ReadP ( Script a) -> ReadP ( Script a)
Script Parser
scriptFromString :: ReadP ( Script a) -> String -> Either ErrValidateScript ( Script a) Source #
Run
scriptParser
on string input.
Since: 3.0.0
scriptToText :: Show a => Script a -> Text Source #
Defines canonical string output for script that is
consistent with
scriptFromString
.
Since: 3.10.0
scriptParser :: ReadP ( Script a) -> ReadP ( Script a) Source #
The script embodies combination of signing keys that need to be met to make it valid. We assume here that the script could delivered from standard input. The examples below are self-explanatory:
- requiring signature 3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe
-
any
for signature required any [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, 3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3f1] -
all
signatures required all [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, 3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3f1] -
at_least
1 signature required at_least 1 [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, 3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3f1] - Nested script are supported at_least 1 [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, all [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3f1, 3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3f1]]
- 1 signature required after slot number 120 all [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, active_from 120]
- 1 signature required until slot number 150 all [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, active_until 150]
- 1 signature required in slot interval <145, 150) all [3c07030e36bfffe67e2e2ec09e5293d384637cd2f004356ef320f3fe, active_from 145, active_until 150]
Parser is insensitive to whitespaces.
Since: 3.0.0