cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Redeemer

Description

This module exposes the notion of redeemers used whenever a script in invoked in a TxSkel.

Synopsis

Documentation

data TxSkelRedeemer where Source #

A bundle around a redeemer which allows to provide a reference input in which the script associated with the redeemer can be found

Constructors

TxSkelRedeemer 

Fields

Instances

Instances details
Monoid DoubleSatDelta Source # 
Instance details

Defined in Cooked.Attack.DoubleSat

Monoid TxSkelMints Source # 
Instance details

Defined in Cooked.Skeleton.Mint

Semigroup DoubleSatDelta Source # 
Instance details

Defined in Cooked.Attack.DoubleSat

Semigroup TxSkelMints Source #

Combining TxSkelMints in a sensible way. In particular, this means that

Map.fromList [(pol, (red, NEMap.fromList [(tName, 1)]))]

and

Map.fromList [(pol, (red', NEMap.fromList [(tName, -1)]))]

will combine to become the empty TxSkelMints

In every case, if you add mints with a different redeemer for the same policy, the redeemer used in the right argument takes precedence.

Instance details

Defined in Cooked.Skeleton.Mint

Show TxSkelRedeemer Source # 
Instance details

Defined in Cooked.Skeleton.Redeemer

PrettyCookedList TxSkelRedeemer Source #

Prints a list of docs corresponding to an instance of TxSkelRedeemer

Instance details

Defined in Cooked.Pretty.Skeleton

Eq TxSkelRedeemer Source # 
Instance details

Defined in Cooked.Skeleton.Redeemer

type RedeemerConstrs redeemer = (ToData redeemer, FromData redeemer, Show redeemer, PrettyCooked redeemer, Eq redeemer, Typeable redeemer) Source #

These are the constraints that must be satisfied by the inner content of a redeemer, that is the actual data that will be passed to the script as its redeemer during during validation

withReferenceInput :: TxSkelRedeemer -> TxOutRef -> TxSkelRedeemer Source #

Attaches a reference input to a given TxSkelRedeemer. This should usually be of no use if option txOptAutoReferenceScripts is turned on, which is the case by default.

someTxSkelRedeemer :: RedeemerConstrs redeemer => redeemer -> TxSkelRedeemer Source #

Creates a TxSkelRedeemer from an inner content with no reference input

emptyTxSkelRedeemer :: TxSkelRedeemer Source #

Creates a TxSkelRedeemer without an inner content nor a reference input

txSkelRedeemerReferenceInputL :: Lens' TxSkelRedeemer (Maybe TxOutRef) Source #

Sets or gets the reference input from a redeemer

txSkelRedeemerAutoFillL :: Lens' TxSkelRedeemer Bool Source #

Sets or gets the autofill property from a redeemer

txSkelRedeemerTypedAT :: (RedeemerConstrs a, RedeemerConstrs b) => AffineTraversal TxSkelRedeemer TxSkelRedeemer a b Source #

Extracts, or sets, the typed redeemer of a TxSkelRedeemer. This is attempted in two ways: first, we try to simply cast the content, and then, if it fails, we serialise the content and then attempt to deserialise it to the right type. This second case is specifically useful when the current content is an BuiltinData itself directly, but it can also be used in the cornercase when both types have compatible serialized representation.

someTxSkelRedeemerNoAutoFill :: RedeemerConstrs redeemer => redeemer -> TxSkelRedeemer Source #

Creates a TxSkelRedeemer from an inner content with no reference input, while not allowing it to be automatically assigned

emptyTxSkelRedeemerNoAutoFill :: TxSkelRedeemer Source #

Creates a TxSkelRedeemer with no inner content and no reference input, while dissallowing it to be automatically assinged

txSkelRedeemerBuiltinDataL :: Lens' TxSkelRedeemer BuiltinData Source #

Extracts, or sets, the redeemer content as an BuiltinData