cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton

Description

This module provides the description of a transaction skeleton. We have our own representation of a transaction for three main reasons:

  • our transaction skeletons are typed (datums, validators, outputs...)
  • with our own wrapper, we are less affected by plutus updates
  • we can have default or automated behavior for the parts of the transactions that are less relevant to testing, such as collaterals or fees
Synopsis

Documentation

data TxSkel where Source #

Constructors

TxSkel 

Fields

  • :: { txSkelLabel :: Set TxLabel

    Labels do not influence the transaction generation at all; they are pretty-printed whenever cooked-validators prints a transaction, and can therefore make the output more informative (and greppable).

  •    , txSkelOpts :: TxOpts

    Some options that control transaction generation.

  •    , txSkelMints :: TxSkelMints

    Any value minted or burned by the transaction. You'll probably want to use txSkelMintsFromList to construct this.

  •    , txSkelSigners :: [Wallet]

    The wallets signing the transaction. This list must contain at least one element. By default, the first signer will pay for fees and balancing. You can change that with txOptBalanceWallet.

  •    , txSkelValidityRange :: SlotRange
     
  •    , txSkelIns :: Map TxOutRef TxSkelRedeemer

    To each TxOutRef the transaction should consume, add a redeemer specifying how to spend it. You must make sure that

    • On TxOutRefs referencing UTxOs belonging to public keys, you use the emptyTxSkelRedeemer smart constructor.
    • On TxOutRefs referencing UTxOs belonging to scripts, you must make sure that the type of the redeemer is appropriate for the script.
  •    , txSkelInsReference :: Set TxOutRef

    All outputs referenced by the transaction.

  •    , txSkelOuts :: [TxSkelOut]

    The outputs of the transaction. These will occur in exactly this order on the transaction.

  •    , txSkelProposals :: [TxSkelProposal]

    Possible proposals issued in this transaction to be voted on and possible enacted later on.

  •    , txSkelWithdrawals :: TxSkelWithdrawals

    Withdrawals performed by the transaction

  •    } -> TxSkel
     

Instances

Instances details
Show TxSkel Source # 
Instance details

Defined in Cooked.Skeleton

Eq TxSkel Source # 
Instance details

Defined in Cooked.Skeleton

Methods

(==) :: TxSkel -> TxSkel -> Bool #

(/=) :: TxSkel -> TxSkel -> Bool #

MonadBlockChainWithoutValidation m => MonadTweak (Tweak m) Source # 
Instance details

Defined in Cooked.Tweak.Common

txSkelTemplate :: TxSkel Source #

A convenience template of an empty transaction skeleton.

txSkelDataInOutputs :: TxSkel -> [(DatumHash, TxSkelOutDatum)] Source #

Return all data on transaction outputs. This can contain duplicates, which is intended.

txSkelValidatorsInOutputs :: TxSkel -> Map ValidatorHash (Versioned Validator) Source #

All validators which will receive transaction outputs

txSkelKnownTxOutRefs :: TxSkel -> [TxOutRef] Source #

All TxOutRefs known by a given transaction skeleton. This includes TxOutRef`s used as inputs of the skeleton and TxOutRefs used as reference inputs of the skeleton. This does not include additional possible TxOutRefs used for balancing and additional TxOutRefs used as collateral inputs, as they are not part of the skeleton.

txSkelValueInOutputs :: TxSkel -> Value Source #

Returns the full value contained in the skeleton outputs

txSkelReferenceScripts :: TxSkel -> Map ValidatorHash (Versioned Validator) Source #

All validators in the reference script field of transaction outputs

txSkelReferenceTxOutRefs :: TxSkel -> [TxOutRef] Source #

All TxOutRefs in reference inputs