plutus-contract-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Trace.Emulator.ContractInstance

Synopsis

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.

data EmulatorRuntimeError Source #

Instances

Instances details
Eq EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Show EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Generic EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Associated Types

type Rep EmulatorRuntimeError :: Type -> Type Source #

ToJSON EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

FromJSON EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Pretty EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

type Rep EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

runInstance :: forall w s e effs. (ContractConstraints s, Member (Error EmulatorRuntimeError) effs, Show e, ToJSON e, ToJSON w, Monoid w) => 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.

Constructors

ContractInstanceState 

Fields

Instances

Instances details
Generic (ContractInstanceState w s e a) Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Associated Types

type Rep (ContractInstanceState w s e a) :: Type -> Type Source #

(ToJSON e, ToJSON a, ToJSON w) => ToJSON (ContractInstanceState w s e a) Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

(FromJSON e, FromJSON a, FromJSON w) => FromJSON (ContractInstanceState w s e a) Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

type Rep (ContractInstanceState w s e a) Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

type Rep (ContractInstanceState w s e a) = D1 ('MetaData "ContractInstanceState" "Plutus.Trace.Emulator.Types" "plutus-contract-0.1.0.0-2DbvKQdtEvHK4UkDq1ndDW" 'False) (C1 ('MetaCons "ContractInstanceState" 'PrefixI 'True) (S1 ('MetaSel ('Just "instContractState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ResumableResult w e PABResp PABReq a)) :*: (S1 ('MetaSel ('Just "instEvents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (Response PABResp))) :*: S1 ('MetaSel ('Just "instHandlersHistory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq [Request PABReq])))))

emptyInstanceState :: forall w (s :: Row *) e a. Monoid w => Contract w s e a -> 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

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