Safe Haskell | None |
---|---|
Language | Haskell2010 |
If you want to run the node emulator without using the Contract
monad, this module provides a simple MTL-based interface.
Synopsis
- data EmulatorState = EmulatorState !ChainState !AddressMap !(Map DatumHash Datum)
- esChainState :: Lens' EmulatorState ChainState
- esAddressMap :: Lens' EmulatorState AddressMap
- esDatumMap :: Lens' EmulatorState (Map DatumHash Datum)
- data EmulatorError
- = BalancingError !BalancingError
- | ValidationError !ValidationErrorInPhase
- | ToCardanoError !ToCardanoError
- type EmulatorLogs = Seq (LogMessage EmulatorMsg)
- data EmulatorMsg
- = GenericMsg Value
- | ChainEvent ChainEvent
- data LogMessage a = LogMessage {
- _logLevel :: LogLevel
- _logMessageContent :: a
- type MonadEmulator m = (MonadRWS Params EmulatorLogs EmulatorState m, MonadError EmulatorError m)
- type EmulatorT m = ExceptT EmulatorError (RWST Params EmulatorLogs EmulatorState m)
- type EmulatorM = EmulatorT Identity
- handleChain :: MonadEmulator m => Eff [ChainControlEffect, ChainEffect] a -> m a
- processBlock :: MonadEmulator m => m Block
- modifySlot :: MonadEmulator m => (Slot -> Slot) -> m Slot
Types
data EmulatorState Source #
EmulatorState !ChainState !AddressMap !(Map DatumHash Datum) |
Instances
Show EmulatorState Source # | |
Defined in Cardano.Node.Emulator.Internal.API | |
IsRunnable EmulatorM Source # | |
Defined in Cardano.Node.Emulator.Test | |
HasChainIndex EmulatorM Source # | |
type Realized EmulatorM a | |
Defined in Cardano.Node.Emulator.Test type Realized EmulatorM a = a |
esChainState :: Lens' EmulatorState ChainState Source #
esAddressMap :: Lens' EmulatorState AddressMap Source #
esDatumMap :: Lens' EmulatorState (Map DatumHash Datum) Source #
data EmulatorError Source #
BalancingError !BalancingError | |
ValidationError !ValidationErrorInPhase | |
ToCardanoError !ToCardanoError |
Instances
Show EmulatorError Source # | |
Defined in Cardano.Node.Emulator.Internal.API | |
Exception EmulatorError Source # | |
Defined in Cardano.Node.Emulator.Internal.API | |
IsRunnable EmulatorM Source # | |
Defined in Cardano.Node.Emulator.Test | |
HasChainIndex EmulatorM Source # | |
type Realized EmulatorM a | |
Defined in Cardano.Node.Emulator.Test type Realized EmulatorM a = a |
type EmulatorLogs = Seq (LogMessage EmulatorMsg) Source #
data EmulatorMsg Source #
GenericMsg Value | |
ChainEvent ChainEvent |
Instances
data LogMessage a #
LogMessage | |
|
Instances
type MonadEmulator m = (MonadRWS Params EmulatorLogs EmulatorState m, MonadError EmulatorError m) Source #
type EmulatorT m = ExceptT EmulatorError (RWST Params EmulatorLogs EmulatorState m) Source #
Running Eff chain effects in MTL
handleChain :: MonadEmulator m => Eff [ChainControlEffect, ChainEffect] a -> m a Source #
processBlock :: MonadEmulator m => m Block Source #
modifySlot :: MonadEmulator m => (Slot -> Slot) -> m Slot Source #