Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type EmulatorEventFold a = Fold EmulatorEvent a
- type EmulatorEventFoldM effs a = FoldM (Eff effs) EmulatorEvent a
- data EmulatorFoldErr = InstanceStateJSONDecodingError String (Response Value)
- describeError :: EmulatorFoldErr -> String
- 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))
- instanceRequests :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [Request PABReq]
- instanceResponses :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [Response PABResp]
- instanceOutcome :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs (Outcome e a)
- instanceTransactions :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs [UnbalancedTx]
- data Outcome e a
- instanceLog :: ContractInstanceTag -> EmulatorEventFold [EmulatorTimeEvent ContractInstanceLog]
- instanceAccumState :: forall w s e a effs. (Member (Error EmulatorFoldErr) effs, Monoid w) => Contract w s e a -> ContractInstanceTag -> EmulatorEventFoldM effs w
- chainEvents :: EmulatorEventFold [ChainEvent]
- failedTransactions :: Maybe ValidationPhase -> EmulatorEventFold [(CardanoTx, ValidationError, Value)]
- validatedTransactions :: EmulatorEventFold [(OnChainTx, RedeemerReport)]
- utxoAtAddress :: CardanoAddress -> EmulatorEventFold UtxoMap
- valueAtAddress :: CardanoAddress -> EmulatorEventFold Value
- walletFunds :: Wallet -> EmulatorEventFold Value
- walletFees :: Wallet -> EmulatorEventFold Lovelace
- walletTxBalanceEvents :: EmulatorEventFold [UnbalancedTx]
- walletsAdjustedTxEvents :: EmulatorEventFold [Lovelace]
- annotatedBlockchain :: EmulatorEventFold [[AnnotatedTx]]
- blockchain :: EmulatorEventFold [Block]
- emulatorLog :: EmulatorEventFold [EmulatorEvent]
- userLog :: EmulatorEventFold [EmulatorTimeEvent UserThreadMsg]
- renderLines :: forall a. Pretty a => Fold a Text
- preMapMaybeM :: Monad m => (a -> m (Maybe b)) -> FoldM m b r -> FoldM m a r
- preMapMaybe :: (a -> Maybe b) -> Fold b r -> Fold a r
- postMapM :: Monad m => (b -> m c) -> FoldM m a b -> FoldM m a c
- mkTxLogs :: EmulatorEventFold [MkTxLog]
Documentation
type EmulatorEventFold a = Fold EmulatorEvent a Source #
type EmulatorEventFoldM effs a = FoldM (Eff effs) EmulatorEvent a Source #
A fold over emulator events that can fail with EmulatorFoldErr
data EmulatorFoldErr Source #
Instances
Eq EmulatorFoldErr Source # | |
Defined in Wallet.Emulator.Folds (==) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # (/=) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # | |
Ord EmulatorFoldErr Source # | |
Defined in Wallet.Emulator.Folds compare :: EmulatorFoldErr -> EmulatorFoldErr -> Ordering Source # (<) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # (<=) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # (>) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # (>=) :: EmulatorFoldErr -> EmulatorFoldErr -> Bool Source # max :: EmulatorFoldErr -> EmulatorFoldErr -> EmulatorFoldErr Source # min :: EmulatorFoldErr -> EmulatorFoldErr -> EmulatorFoldErr Source # | |
Show EmulatorFoldErr Source # | |
Defined in Wallet.Emulator.Folds |
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.
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. |
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 txOut
s 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
.