| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
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
- data MockChainLogEntry
- = MCLogSubmittedTxSkel TxSkel
- | MCLogAdjustedTxSkel TxSkel Fee (Maybe Collaterals)
- | MCLogNewTx TxId Integer
- | MCLogDiscardedUtxos Integer String
- | MCLogUnusedCollaterals (Either Peer CollateralIns)
- | MCLogAddedReferenceScript TxSkelRedeemer TxOutRef ScriptHash
- | MCLogAutoFilledWithdrawalAmount Credential Lovelace
- | MCLogAutoFilledConstitution ScriptHash
- | MCLogAdjustedTxSkelOut TxSkelOut Lovelace
- data MockChainLog :: Effect
- runMockChainLog :: Member (Writer j) effs => (MockChainLogEntry -> j) -> Sem (MockChainLog : effs) a -> Sem effs a
- logEvent :: Member MockChainLog effs => MockChainLogEntry -> Sem effs ()
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 |
Instances
| Show MockChainLogEntry Source # | |
Defined in Cooked.MockChain.Log Methods showsPrec :: Int -> MockChainLogEntry -> ShowS # show :: MockChainLogEntry -> String # showList :: [MockChainLogEntry] -> ShowS # | |
| PrettyCooked (Contextualized MockChainLogEntry) Source # | This prints a |
Defined in Cooked.Pretty.MockChain | |
| PrettyCooked (Contextualized [MockChainLogEntry]) Source # | |
Defined in Cooked.Pretty.MockChain Methods prettyCookedOpt :: PrettyCookedOpts -> Contextualized [MockChainLogEntry] -> DocCooked Source # prettyCooked :: Contextualized [MockChainLogEntry] -> DocCooked Source # | |
Logging effect
data MockChainLog :: Effect Source #
An effect to allow logging of mockchain events
Instances
| RunnableMockChain FullEffs Source # | |
Defined in Cooked.MockChain.Instances Methods runMockChain :: MockChainState -> Sem FullEffs a -> [RawMockChainReturn a] Source # | |
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