| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Transaction.Redeemer
Description
Indexed script arguments and execution budgets. Purpose and zero-based
index identify a redeemer; the index refers to the corresponding body field.
Redeemer Spending 0 (PlutusData.fromData (PlutusData.Integer 42)) (ExUnits 10 20)
assembles an argument and budget without running the script.
Synopsis
- data Purpose
- data Redeemer = Redeemer {
- purpose :: !Purpose
- index :: !Word32
- argument :: !EncodedPlutusData
- executionUnits :: !ExUnits
- encodeCbor :: Redeemer -> ByteString
- decodeCbor :: ByteString -> Either Error Redeemer
- encodeCollectionCbor :: [Redeemer] -> Either Error ByteString
- decodeCollectionCbor :: ByteString -> Either Error [Redeemer]
- mkCollection :: [Redeemer] -> Either Error [Redeemer]
Documentation
Ledger purpose tags zero through six. Guarding requires an era supporting transaction guards; this standalone codec does not establish era acceptance.
Instances
| Bounded Purpose Source # | |
| Enum Purpose Source # | |
| Show Purpose Source # | |
| Eq Purpose Source # | |
| Ord Purpose Source # | |
Defined in Cometa.Transaction.Redeemer | |
Purpose, zero-based body-field index, exact script argument, and memory/CPU budget.
Constructors
| Redeemer | |
Fields
| |
encodeCbor :: Redeemer -> ByteString Source #
Encode the historical four-element standalone redeemer form.
decodeCbor :: ByteString -> Either Error Redeemer Source #
Decode one standalone four-element form, retaining exact argument CBOR.
encodeCollectionCbor :: [Redeemer] -> Either Error ByteString Source #
Encode a Conway-style map, sorted by purpose/index. Duplicate identifiers fail explicitly; no map conversion silently overwrites an argument.
decodeCollectionCbor :: ByteString -> Either Error [Redeemer] Source #
Accept the historical array or Conway map form. Imported collection order normalizes by purpose/index; duplicate identifiers and indices above 2^32-1 fail.