| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
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
- module Cooked.Skeleton.Withdrawal
- module Cooked.Skeleton.Value
- module Cooked.Skeleton.ValidityRange
- module Cooked.Skeleton.User
- module Cooked.Skeleton.Signatory
- module Cooked.Skeleton.Redeemer
- module Cooked.Skeleton.Proposal
- module Cooked.Skeleton.Output
- module Cooked.Skeleton.Option
- module Cooked.Skeleton.Mint
- module Cooked.Skeleton.Label
- module Cooked.Skeleton.Datum
- module Cooked.Skeleton.Certificate
- module Cooked.Skeleton.Anchor
- data TxSkel where
- txSkelLabelsL :: Lens' TxSkel (Set TxSkelLabel)
- txSkelOptsL :: Lens' TxSkel TxSkelOpts
- txSkelMintsL :: Lens' TxSkel TxSkelMints
- txSkelValidityRangeL :: Lens' TxSkel SlotRange
- txSkelProposalsL :: Lens' TxSkel [TxSkelProposal]
- txSkelSignatoriesL :: Lens' TxSkel [TxSkelSignatory]
- txSkelInputsL :: Lens' TxSkel (Map TxOutRef TxSkelRedeemer)
- txSkelReferenceInputsL :: Lens' TxSkel (Set TxOutRef)
- txSkelOutputsL :: Lens' TxSkel [TxSkelOut]
- txSkelWithdrawalsL :: Lens' TxSkel TxSkelWithdrawals
- txSkelCertificatesL :: Lens' TxSkel [TxSkelCertificate]
- txSkelProposingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
- txSkelMintingRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
- txSkelCertifyingRedeemedUsersT :: forall user. Typeable user => Traversal' TxSkel (User user Redemption)
- txSkelWithdrawingRedeemedUsersT :: Traversal' TxSkel (User IsEither Redemption)
- txSkelSpendingRedeemersT :: Traversal' TxSkel TxSkelRedeemer
- txSkelRedeemersT :: Traversal' TxSkel TxSkelRedeemer
- txSkelRedeemedScriptsT :: Traversal' TxSkel (User IsScript Redemption)
- txSkelRedeemedPeersT :: Traversal' TxSkel (User IsPubKey Redemption)
- txSkelAllocatedPeersT :: Traversal' TxSkel (User IsPubKey Allocation)
- txSkelAllocatedScriptsT :: Traversal' TxSkel (User IsScript Allocation)
- txSkelTemplate :: TxSkel
- txSkelKnownTxOutRefs :: TxSkel -> Set TxOutRef
- txSkelWithdrawnValue :: TxSkel -> Value
- txSkelPaidValue :: TxSkel -> Value
- txSkelReferenceInputsInRedeemers :: TxSkel -> Set TxOutRef
Documentation
module Cooked.Skeleton.Withdrawal
module Cooked.Skeleton.Value
module Cooked.Skeleton.User
module Cooked.Skeleton.Signatory
module Cooked.Skeleton.Redeemer
module Cooked.Skeleton.Proposal
module Cooked.Skeleton.Output
module Cooked.Skeleton.Option
module Cooked.Skeleton.Mint
module Cooked.Skeleton.Label
module Cooked.Skeleton.Datum
module Cooked.Skeleton.Certificate
module Cooked.Skeleton.Anchor
Data type
A transaction skeleton. This is cooked-validators's variant of transaction
bodies, eventually translated to Cardano TxBody.
Constructors
| TxSkel | |
Fields
| |
Instances
| Show TxSkel Source # | |
| Eq TxSkel Source # | |
| PrettyCookedList (Contextualized TxSkel) Source # | Prints a |
Defined in Cooked.Pretty.Skeleton Methods prettyCookedOptList :: PrettyCookedOpts -> Contextualized TxSkel -> [DocCooked] Source # prettyCookedOptListMaybe :: PrettyCookedOpts -> Contextualized TxSkel -> [Maybe DocCooked] Source # prettyCookedListMaybe :: Contextualized TxSkel -> [Maybe DocCooked] Source # prettyCookedList :: Contextualized TxSkel -> [DocCooked] Source # | |
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
txSkelProposalsL :: Lens' TxSkel [TxSkelProposal] Source #
Focuses on the proposals of a TxSkel
txSkelSignatoriesL :: Lens' TxSkel [TxSkelSignatory] Source #
Focuses on the signatories of a TxSkel
txSkelInputsL :: Lens' TxSkel (Map TxOutRef TxSkelRedeemer) Source #
Focuses on the inputs of a TxSkel
txSkelReferenceInputsL :: Lens' TxSkel (Set TxOutRef) Source #
Focuses on the reference inputs 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.
txSkelPaidValue :: TxSkel -> Value Source #
Returns the full value contained in the skeleton outputs