cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.Log

Description

This module exposes primitives required to log internal pieces of information during a mockchain run. This includes, in particular, all the adjustment automatically done by cooked-validators during the transaction processing phase. This effect is typically not available to users, and should solely be used to track internal events. To trace additional elements from a user's perspective, use note instead.

Synopsis

Logging events

data MockChainLogEntry Source #

Events logged when processing transaction skeletons

Constructors

MCLogSubmittedTxSkel TxSkel

Logging a Skeleton as it is submitted by the user.

MCLogAdjustedTxSkel TxSkel Fee (Maybe Collaterals)

Logging a Skeleton as it has been adjusted by the balancing mechanism, alongside fee, and possible collateral utxos and return collateral user.

MCLogNewTx TxId Integer

Logging the successful validation of a new transaction, with its id and number of produced outputs.

MCLogDiscardedUtxos Integer String

Logging the fact that utxos provided by the user for balancing have to be discarded for a specific reason.

MCLogUnusedCollaterals (Either Peer CollateralIns)

Logging the fact that utxos provided as collaterals will not be used because the transaction does not involve scripts. There are 2 cases, depending on whether the user has provided an explicit user or a set of utxos to be used as collaterals.

MCLogAddedReferenceScript TxSkelRedeemer TxOutRef ScriptHash

Logging the automatic addition of a reference script

MCLogAutoFilledWithdrawalAmount Credential Lovelace

Logging the automatic addition of a withdrawal amount

MCLogAutoFilledConstitution ScriptHash

Logging the automatic addition of the constitution script

MCLogAdjustedTxSkelOut TxSkelOut Lovelace

Logging the automatic adjustment of a min ada amount

Logging effect

data MockChainLog :: Effect Source #

An effect to allow logging of mockchain events

Instances

Instances details
RunnableMockChain FullEffs Source # 
Instance details

Defined in Cooked.MockChain.Instances

runMockChainLog :: Member (Writer j) effs => (MockChainLogEntry -> j) -> Sem (MockChainLog : effs) a -> Sem effs a Source #

Interpreting a MockChainLog in terms of a writer of [MockChainLogEntry]

Logging primitive

logEvent :: Member MockChainLog effs => MockChainLogEntry -> Sem effs () Source #

Logs an internal event occurring while processing a transaction skeleton