Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- hydraHeadV1 :: BuiltinByteString
- hasST :: CurrencySymbol -> Value -> Bool
- mustBurnAllHeadTokens :: Value -> CurrencySymbol -> [Party] -> Bool
- mustNotMintOrBurn :: TxInfo -> Bool
- (===) :: Value -> Value -> Bool
- hashPreSerializedCommits :: [Commit] -> BuiltinByteString
- hashTxOuts :: [TxOut] -> BuiltinByteString
- compareRef :: TxOutRef -> TxOutRef -> Ordering
- data UtilError = MintingOrBurningIsForbidden
- scriptOutputsAt :: ScriptHash -> TxInfo -> [(OutputDatum, Value)]
Documentation
hydraHeadV1 :: BuiltinByteString Source #
hasST :: CurrencySymbol -> Value -> Bool Source #
Checks that the output contains the state token (ST) with the head
CurrencySymbol
and TokenName
of hydraHeadV1
mustBurnAllHeadTokens :: Value -> CurrencySymbol -> [Party] -> Bool Source #
Checks all tokens related to some specific CurrencySymbol
.
This checks both PTs and ST are burnt.
mustNotMintOrBurn :: TxInfo -> Bool Source #
(===) :: Value -> Value -> Bool infix 4 Source #
Checks for exact equality between two serialized values.
Equality on value is very memory intensive as it's defined on associative
lists and AssocMap
equality is implemented. Instead we can be more strict and
require EXACTLY the same value and compare using the serialised bytes.
hashPreSerializedCommits :: [Commit] -> BuiltinByteString Source #
Hash a potentially unordered list of commits by sorting them, concatenating
their preSerializedOutput
bytes and creating a SHA2_256 digest over that.
NOTE: See note from hashTxOuts
.
hashTxOuts :: [TxOut] -> BuiltinByteString Source #
Hash a pre-ordered list of transaction outputs by serializing each
individual TxOut
, concatenating all bytes together and creating a SHA2_256
digest over that.
NOTE: In general, from asserting that `hash(x || y) = hash (x' || y')` it is
not safe to conclude that `(x,y) = (x', y')` as the same hash could be
obtained by moving one or more bytes from the end of x
to the beginning of
y
, but in the context of Hydra validators it seems impossible to exploit
this property without breaking other logic or verification (eg. producing a
valid and meaningful TxOut
).
compareRef :: TxOutRef -> TxOutRef -> Ordering Source #
Errors
scriptOutputsAt :: ScriptHash -> TxInfo -> [(OutputDatum, Value)] Source #
Get the list of TxOut
outputs of the pending transaction at
a given script address.