Safe Haskell | None |
---|---|
Language | Haskell2010 |
Running emulator actions that produce streams of events
Synopsis
- data EmulatorConfig = EmulatorConfig {}
- data EmulatorErr
- = WalletErr WalletAPIError
- | ChainIndexErr ChainIndexError
- | AssertionErr AssertionError
- | InstanceErr EmulatorRuntimeError
- | ExitWasNeverCalled
- type InitialChainState = Either InitialDistribution [CardanoTx]
- initialChainState :: Lens' EmulatorConfig InitialChainState
- initialDist :: EmulatorConfig -> InitialDistribution
- initialState :: EmulatorConfig -> EmulatorState
- params :: Lens' EmulatorConfig Params
- runTraceStream :: forall effs a. EmulatorConfig -> Eff '[State EmulatorState, LogMsg EmulatorEvent', MultiAgentEffect, MultiAgentControlEffect, ChainEffect, ChainControlEffect, Error EmulatorRuntimeError] (Maybe a) -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) (Either EmulatorErr a, EmulatorState)
- takeUntilSlot :: forall effs a. Slot -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) ()
- filterLogLevel :: forall effs a. LogLevel -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a
- foldStreamM :: forall m a b c. Monad m => FoldM m a b -> Stream (Of a) m c -> m (Of b c)
- foldEmulatorStreamM :: forall effs a b. FoldM (Eff effs) EmulatorEvent b -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Eff effs (Of b a)
Emulator streams
data EmulatorConfig Source #
EmulatorConfig | |
|
Instances
Eq EmulatorConfig Source # | |
Defined in Wallet.Emulator.Stream (==) :: EmulatorConfig -> EmulatorConfig -> Bool Source # (/=) :: EmulatorConfig -> EmulatorConfig -> Bool Source # | |
Show EmulatorConfig Source # | |
Defined in Wallet.Emulator.Stream | |
Default EmulatorConfig Source # | |
Defined in Wallet.Emulator.Stream |
data EmulatorErr Source #
WalletErr WalletAPIError | |
ChainIndexErr ChainIndexError | |
AssertionErr AssertionError | |
InstanceErr EmulatorRuntimeError | |
ExitWasNeverCalled |
Instances
Show EmulatorErr Source # | |
Defined in Wallet.Emulator.Stream |
type InitialChainState = Either InitialDistribution [CardanoTx] Source #
initialDist :: EmulatorConfig -> InitialDistribution Source #
The wallets' initial funds
params :: Lens' EmulatorConfig Params Source #
runTraceStream :: forall effs a. EmulatorConfig -> Eff '[State EmulatorState, LogMsg EmulatorEvent', MultiAgentEffect, MultiAgentControlEffect, ChainEffect, ChainControlEffect, Error EmulatorRuntimeError] (Maybe a) -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) (Either EmulatorErr a, EmulatorState) Source #
Turn an emulator action into a Stream
of emulator log messages, returning
the final state of the emulator.
Stream manipulation
takeUntilSlot :: forall effs a. Slot -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) () Source #
Finish the stream at the end of the given slot.
filterLogLevel :: forall effs a. LogLevel -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a Source #
Remove from the stream all log messages whose log level is lower than the the given level.
Consuming streams
foldStreamM :: forall m a b c. Monad m => FoldM m a b -> Stream (Of a) m c -> m (Of b c) Source #
Apply a fold to an effectful stream of events.
foldEmulatorStreamM :: forall effs a b. FoldM (Eff effs) EmulatorEvent b -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) a -> Eff effs (Of b a) Source #
Consume an emulator event stream.