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 many reasons. Here are some of them:

  • our transaction skeletons are typed (datums, validators, outputs...)
  • each transaction skeleton comes with its own set of generation options
  • our transaction skeleton is by default anchored in the latest Cardano era
  • each field in our transaction skeleton comes with a set of helpers and
  • smart constructor to ease the transaction creation
  • 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 type

data TxSkel where Source #

A transaction skeleton. This is cooked-validators's variant of transaction bodies, eventually translated to Cardano TxBody.

Constructors

TxSkel 

Fields

Optics

txSkelLabelsL :: Lens' TxSkel (Set TxSkelLabel) Source #

Focuses on the labels of a TxSkel

txSkelOptsL :: Lens' TxSkel TxSkelOpts Source #

Focuses on the options of a TxSkel

txSkelMintsL :: Lens' TxSkel TxSkelMints Source #

Focuses on the minted value of a TxSkel

txSkelValidityRangeL :: Lens' TxSkel SlotRange Source #

Focuses on the validity range of a TxSkel

txSkelProposalsL :: Lens' TxSkel [TxSkelProposal] Source #

Focuses on the proposals of a TxSkel

txSkelSignatoriesL :: Lens' TxSkel [TxSkelSignatory] Source #

Focuses on the signatories of a TxSkel

txSkelReferenceInputsL :: Lens' TxSkel (Set TxOutRef) Source #

Focuses on the reference inputs of a TxSkel

txSkelOutputsL :: Lens' TxSkel [TxSkelOut] Source #

Focuses on the outputs of a TxSkel

txSkelWithdrawalsL :: Lens' TxSkel TxSkelWithdrawals Source #

Focuses on the withdrawals of a TxSkel

txSkelCertificatesL :: Lens' TxSkel [TxSkelCertificate] Source #

Focuses on the certificates of a TxSkel

txSkelProposingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption) Source #

Returns all the redeemed scripts involved in proposals in this TxSkel

txSkelMintingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption) Source #

Returns all the redeemed scripts involved in minting in this TxSkel

txSkelCertifyingRedeemedUsersT :: forall user. Typeable user => Traversal' TxSkel (User user Redemption) Source #

Returns all the redeemed users involved in certificates in this TxSkel

txSkelWithdrawingRedeemedUsersT :: Traversal' TxSkel (User IsEither Redemption) Source #

Returns all the redeemed users involved in withdrawals in this TxSkel

txSkelSpendingRedeemersT :: Traversal' TxSkel TxSkelRedeemer Source #

A traversal focusing every redeemer involved with the spending purpose in the given TxSkel.

txSkelRedeemersT :: Traversal' TxSkel TxSkelRedeemer Source #

A traversal focusing every TxSkelRedeemer of a TxSkel, in all five positions (spending, minting, proposing, withdrawing and certifying).

txSkelRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption) Source #

A traversal focusing every script redeemed directly within a TxSkel, that is in the minting, proposing, withdrawing and certifying positions. The spending position is excluded, as the scripts spent there are not stored in the skeleton but fetched from the index based on the inputs' references.

txSkelRedeemedPeersT :: Traversal' TxSkel (User IsPubKey Redemption) Source #

A traversal focusing every pubkey used in redemption mode.

txSkelAllocatedPeersT :: Traversal' TxSkel (User IsPubKey Allocation) Source #

A traversal focusing every pubkey used in allocation mode.

txSkelAllocatedScriptsT :: Traversal' TxSkel (User IsScript Allocation) Source #

A traversal focusing every script used in allocation mode.

Smart constructor

txSkelTemplate :: TxSkel Source #

A convenience template of an empty transaction skeleton.

Utilities

txSkelKnownTxOutRefs :: TxSkel -> Set TxOutRef Source #

All TxOutRefs known by a given transaction skeleton. This includes TxOutRefs 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.

txSkelWithdrawnValue :: TxSkel -> Value Source #

Returns the total value withdrawn in this TxSkel

txSkelPaidValue :: TxSkel -> Value Source #

Returns the full value contained in the skeleton outputs

txSkelReferenceInputsInRedeemers :: TxSkel -> Set TxOutRef Source #

All TxOutRefs in reference inputs from redeemers