plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Wallet.Emulator.Stream

Description

Running emulator actions that produce streams of events

Synopsis

Emulator streams

data EmulatorConfig Source #

Constructors

EmulatorConfig 

Fields

  • _initialChainState :: InitialChainState

    State of the blockchain at the beginning of the simulation. Can be given as a map of funds to wallets, or as a block of transactions.

  • _params :: Params

    Set the protocol parameters, network ID and slot configuration for the emulator.

initialDist :: EmulatorConfig -> InitialDistribution Source #

The wallets' initial funds

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.