Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- contractThread :: forall w s e effs. (Member (State EmulatorThreads) effs, Member (Error EmulatorRuntimeError) effs, ContractConstraints s, Show e, ToJSON e, ToJSON w, Monoid w) => ContractHandle w s e -> Eff (EmulatorAgentThreadEffs effs) ()
- getThread :: forall effs. (Member (State EmulatorThreads) effs, Member (Error EmulatorRuntimeError) effs) => ContractInstanceId -> Eff effs ThreadId
- data EmulatorRuntimeError
- runInstance :: forall w s e effs. (ContractConstraints s, Member (Error EmulatorRuntimeError) effs, Show e, ToJSON e, ToJSON w, Monoid w) => NetworkId -> Contract w s e () -> Maybe EmulatorMessage -> Eff (ContractInstanceThreadEffs w s e effs) ()
- data ContractInstanceState w (s :: Row *) e a = ContractInstanceState {
- instContractState :: ResumableResult w e PABResp PABReq a
- instEvents :: Seq (Response PABResp)
- instHandlersHistory :: Seq [Request PABReq]
- emptyInstanceState :: forall w (s :: Row *) e a. Monoid w => Contract w s e a -> ContractInstanceStateInternal w s e a
- addEventInstanceState :: forall w s e a. Monoid w => Response PABResp -> ContractInstanceStateInternal w s e a -> Maybe (ContractInstanceStateInternal w s e a)
- data IndexedBlock = IndexedBlock {
- ibUtxoSpent :: Map TxIn ChainIndexTx
- ibUtxoProduced :: Map CardanoAddress (NonEmpty ChainIndexTx)
- indexBlock :: [ChainIndexTx] -> IndexedBlock
- getHooks :: forall w s e effs. Member (State (ContractInstanceStateInternal w s e ())) effs => Eff effs [Request PABReq]
- addResponse :: forall w s e effs. (Member (State (ContractInstanceStateInternal w s e ())) effs, Member (LogMsg ContractInstanceMsg) effs, Monoid w) => Response PABResp -> Eff effs ()
Documentation
contractThread :: forall w s e effs. (Member (State EmulatorThreads) effs, Member (Error EmulatorRuntimeError) effs, ContractConstraints s, Show e, ToJSON e, ToJSON w, Monoid w) => ContractHandle w s e -> Eff (EmulatorAgentThreadEffs effs) () Source #
Start a new thread for a contract. Most of the work happens in
runInstance
.
getThread :: forall effs. (Member (State EmulatorThreads) effs, Member (Error EmulatorRuntimeError) effs) => ContractInstanceId -> Eff effs ThreadId Source #
data EmulatorRuntimeError Source #
Instances
runInstance :: forall w s e effs. (ContractConstraints s, Member (Error EmulatorRuntimeError) effs, Show e, ToJSON e, ToJSON w, Monoid w) => NetworkId -> Contract w s e () -> Maybe EmulatorMessage -> Eff (ContractInstanceThreadEffs w s e effs) () Source #
Run an instance of a contract
Instance state
data ContractInstanceState w (s :: Row *) e a Source #
The state of a running contract instance with schema s
and error type e
Serialisable to JSON.
ContractInstanceState | |
|
Instances
emptyInstanceState :: forall w (s :: Row *) e a. Monoid w => Contract w s e a -> ContractInstanceStateInternal w s e a Source #
addEventInstanceState :: forall w s e a. Monoid w => Response PABResp -> ContractInstanceStateInternal w s e a -> Maybe (ContractInstanceStateInternal w s e a) Source #
Indexed block
data IndexedBlock Source #
A block of transactions, indexed by tx outputs spent and by addresses on which new outputs are produced
IndexedBlock | |
|
Instances
Semigroup IndexedBlock Source # | |
Defined in Plutus.Trace.Emulator.ContractInstance (<>) :: IndexedBlock -> IndexedBlock -> IndexedBlock Source # sconcat :: NonEmpty IndexedBlock -> IndexedBlock Source # stimes :: Integral b => b -> IndexedBlock -> IndexedBlock Source # | |
Monoid IndexedBlock Source # | |
Defined in Plutus.Trace.Emulator.ContractInstance mempty :: IndexedBlock Source # mappend :: IndexedBlock -> IndexedBlock -> IndexedBlock Source # mconcat :: [IndexedBlock] -> IndexedBlock Source # |
indexBlock :: [ChainIndexTx] -> IndexedBlock Source #
Internals
getHooks :: forall w s e effs. Member (State (ContractInstanceStateInternal w s e ())) effs => Eff effs [Request PABReq] Source #
addResponse :: forall w s e effs. (Member (State (ContractInstanceStateInternal w s e ())) effs, Member (LogMsg ContractInstanceMsg) effs, Monoid w) => Response PABResp -> Eff effs () Source #
Add a Response
to the contract instance state