Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type PlaygroundTrace a = Eff '[RunContractPlayground, Error EmulatorRuntimeError, Waiting, EmulatedWalletAPI] a
- waitUntilSlot :: forall effs. Member Waiting effs => Slot -> Eff effs Slot
- waitNSlots :: forall effs. Member Waiting effs => Natural -> Eff effs Slot
- nextSlot :: Member Waiting effs => Eff effs Slot
- payToWallet :: forall effs. Member EmulatedWalletAPI effs => Wallet -> Wallet -> Value -> Eff effs TxId
- callEndpoint :: forall effs. Member RunContractPlayground effs => Wallet -> String -> Value -> Eff effs ()
- data EmulatorConfig = EmulatorConfig {}
- initialChainState :: Lens' EmulatorConfig InitialChainState
- 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)
- interpretPlaygroundTrace :: 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 () -> [Wallet] -> PlaygroundTrace a -> Eff effs (Maybe a)
- walletInstanceTag :: Wallet -> ContractInstanceTag
Documentation
type PlaygroundTrace a = Eff '[RunContractPlayground, Error EmulatorRuntimeError, Waiting, EmulatedWalletAPI] a Source #
Constructing traces
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 #
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 |
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 #
:: 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]