plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Wallet.Emulator.Folds

Synopsis

Documentation

type EmulatorEventFoldM effs a = FoldM (Eff effs) EmulatorEvent a Source #

A fold over emulator events that can fail with EmulatorFoldErr

describeError :: EmulatorFoldErr -> String Source #

A human-readable explanation of the error, to be included in the logs.

Folds for contract instances

instanceState :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs (Maybe (ContractInstanceState w s e a)) Source #

The state of a contract instance, recovered from the emulator log.

instanceRequests :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [Request PABReq] Source #

The list of open requests of the contract instance at its latest iteration

instanceResponses :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [Response PABResp] Source #

The reponses received by the contract instance

instanceOutcome :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs (Outcome e a) Source #

The final state of the instance

instanceTransactions :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [UnbalancedTx] Source #

The unbalanced transactions generated by the contract instance.

data Outcome e a Source #

Constructors

Done a

The contract finished without errors and produced a result

NotDone

The contract is waiting for more input.

Failed e

The contract failed with an error.

Instances

Instances details
(Eq a, Eq e) => Eq (Outcome e a) Source # 
Instance details

Defined in Wallet.Emulator.Folds

Methods

(==) :: Outcome e a -> Outcome e a -> Bool Source #

(/=) :: Outcome e a -> Outcome e a -> Bool Source #

(Show a, Show e) => Show (Outcome e a) Source # 
Instance details

Defined in Wallet.Emulator.Folds

Methods

showsPrec :: Int -> Outcome e a -> ShowS Source #

show :: Outcome e a -> String Source #

showList :: [Outcome e a] -> ShowS Source #

instanceLog :: ContractInstanceTag -> EmulatorEventFold [EmulatorTimeEvent ContractInstanceLog] Source #

The log messages produced by the contract instance.

instanceAccumState :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs w Source #

Accumulated state of the contract instance

Folds for transactions and the UTXO set

chainEvents :: EmulatorEventFold [ChainEvent] Source #

All chain events emitted by the node

failedTransactions :: Maybe ValidationPhase -> EmulatorEventFold [(CardanoTx, ValidationError, Value)] Source #

Transactions that failed to validate, in the given validation phase (if specified).

validatedTransactions :: EmulatorEventFold [(OnChainTx, RedeemerReport)] Source #

Transactions that were validated

utxoAtAddress :: CardanoAddress -> EmulatorEventFold UtxoMap Source #

Unspent outputs at an address

valueAtAddress :: CardanoAddress -> EmulatorEventFold Value Source #

The total value of unspent outputs at an address

Folds for individual wallets (emulated agents)

walletFunds :: Wallet -> EmulatorEventFold Value Source #

The funds belonging to a wallet

walletFees :: Wallet -> EmulatorEventFold Lovelace Source #

The fees paid by a wallet

walletTxBalanceEvents :: EmulatorEventFold [UnbalancedTx] Source #

Unbalanced transactions that are sent to the wallet for balancing

walletsAdjustedTxEvents :: EmulatorEventFold [Lovelace] Source #

Min lovelace of txOuts from adjusted unbalanced transactions for all wallets

Folds that are used in the Playground

annotatedBlockchain :: EmulatorEventFold [[AnnotatedTx]] Source #

Annotate the transactions that were validated by the node

blockchain :: EmulatorEventFold [Block] Source #

All transactions that happened during the simulation

emulatorLog :: EmulatorEventFold [EmulatorEvent] Source #

The list of all emulator events

userLog :: EmulatorEventFold [EmulatorTimeEvent UserThreadMsg] Source #

Log and error messages produced by the main (user) thread in the emulator

Etc.

renderLines :: forall a. Pretty a => Fold a Text Source #

Pretty-print each element into a new line.

preMapMaybeM :: Monad m => (a -> m (Maybe b)) -> FoldM m b r -> FoldM m a r Source #

An effectful mapMaybe for FoldM.

preMapMaybe :: (a -> Maybe b) -> Fold b r -> Fold a r Source #

mapMaybe for Fold.

postMapM :: Monad m => (b -> m c) -> FoldM m a b -> FoldM m a c Source #

Effectfully map the result of a FoldM