plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Trace.Playground

Synopsis

Documentation

Constructing traces

waitUntilSlot :: forall effs. Member Waiting effs => Slot -> Eff effs Slot Source #

waitNSlots :: forall effs. Member Waiting effs => Natural -> Eff effs Slot Source #

Wait for a number of slots

nextSlot :: Member Waiting effs => Eff effs Slot Source #

Wait until the beginning of the next slot, returning the new slot number.

payToWallet :: forall effs. Member EmulatedWalletAPI effs => Wallet -> Wallet -> Value -> Eff effs TxId Source #

Make a payment from one wallet to another

callEndpoint :: forall effs. Member RunContractPlayground effs => Wallet -> String -> Value -> Eff effs () Source #

Running traces

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.

runPlaygroundStream :: forall w s e effs a. (ContractConstraints s, Show e, ToJSON e, ToJSON w, Monoid w) => EmulatorConfig -> Contract w s e () -> PlaygroundTrace a -> Stream (Of (LogMessage EmulatorEvent)) (Eff effs) (Either EmulatorErr a, EmulatorState) Source #

Run a 'Trace Playground', streaming the log messages as they arrive

Interpreter

interpretPlaygroundTrace Source #

Arguments

:: forall w s e effs a. (Member MultiAgentEffect effs, Member MultiAgentControlEffect effs, Member (Error EmulatorRuntimeError) effs, Member ChainControlEffect effs, Member (LogMsg EmulatorEvent') effs, ContractConstraints s, Show e, ToJSON e, ToJSON w, Monoid w) 
=> EmulatorConfig 
-> Contract w s e ()

The contract

-> [Wallet]

Wallets that should be simulated in the emulator

-> PlaygroundTrace a 
-> Eff effs (Maybe a) 

walletInstanceTag :: Wallet -> ContractInstanceTag Source #

The ContractInstanceTag for the contract instance of a wallet. See note [Wallet contract instances]