cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Pretty.Cooked

Description

This module implements pretty-printing for Cooked structures such as skeletons and chain state.

It contains orphaned instances of PrettyCooked for Cooked datatypes. They cannot be provided in Cooked.Pretty.Class because of dependency cycles and, for ease of maintainability, we chose to centralize all pretty-printing related code in submodules of Cooked.Pretty instead of having PrettyCooked instances scattered around.

Some structure require additional arguments to be pretty-printed and have therefore no instances PrettyCooked (for example TxSkel needs some TxSkelContext).

Synopsis

Documentation

prettyBalancingWallet :: PrettyCookedOpts -> Wallet -> DocCooked Source #

Same as the PrettyCooked instance for Wallet with a suffix mentioning this is the balancing wallet

prettySigners :: PrettyCookedOpts -> TxOpts -> [Wallet] -> [DocCooked] Source #

Prints a list of pubkeys with a flag next to the balancing wallet

prettyMints :: PrettyCookedOpts -> (Versioned MintingPolicy, TxSkelRedeemer, TokenName, Integer) -> DocCooked Source #

Prints a minting specification

Examples without and with redeemer > #abcdef Foo: 500 > #123456 Bar: 1000 - Redeemer: red - Reference script at: txOutRef

mPrettyTxOpts :: PrettyCookedOpts -> TxOpts -> Maybe DocCooked Source #

Pretty-print a list of transaction skeleton options, only printing an option if its value is non-default. If no non-default options are in the list, return nothing.

prettyAddressState :: PrettyCookedOpts -> Address -> UtxoPayloadSet -> DocCooked Source #

Pretty prints the state of an address, that is the list of UTxOs (including value and datum), grouped

prettyPayloadGrouped :: PrettyCookedOpts -> [UtxoPayload] -> Maybe DocCooked Source #

Pretty prints payloads (datum and value corresponding to 1 UTxO) grouped together when they carry same value and datum

Orphan instances

PrettyCooked MockChainError Source # 
Instance details

PrettyCooked MockChainLogEntry Source #

This pretty prints a MockChainLog that usually consists of the list of validated or submitted transactions. In the log, we know a transaction has been validated if the MCLogSubmittedTxSkel is followed by a MCLogNewTx.

Instance details

PrettyCooked UtxoState Source #

Pretty print a UtxoState. Print the known wallets first, then unknown pubkeys, then scripts.

Instance details

PrettyCooked TxSkelOutDatum Source #

The PrettyCooked instance for TxSkelOutDatum prints the datum it contains according to its own PrettyCooked instance.

Instance details

Show a => PrettyCooked (MockChainReturn a UtxoState) Source # 
Instance details

Show a => PrettyCooked (a, UtxoState) Source # 
Instance details