plutus-contract-1.2.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.

getThread :: forall effs. (Member (State EmulatorThreads) effs, Member (Error EmulatorRuntimeError) effs) => ContractInstanceId -> Eff effs ThreadId Source #

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 #

FromJSON EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Methods

parseJSON :: Value -> Parser EmulatorRuntimeError

parseJSONList :: Value -> Parser [EmulatorRuntimeError]

ToJSON EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Pretty EmulatorRuntimeError Source # 
Instance details

Defined in Plutus.Trace.Emulator.Types

Methods

pretty :: EmulatorRuntimeError -> Doc ann

prettyList :: [EmulatorRuntimeError] -> Doc ann

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) => 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.

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 #

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

Defined in Plutus.Trace.Emulator.Types

Methods

parseJSON :: Value -> Parser (ContractInstanceState w s e a)

parseJSONList :: Value -> Parser [ContractInstanceState w s e a]

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

Defined in Plutus.Trace.Emulator.Types

Methods

toJSON :: ContractInstanceState w s e a -> Value

toEncoding :: ContractInstanceState w s e a -> Encoding

toJSONList :: [ContractInstanceState w s e a] -> Value

toEncodingList :: [ContractInstanceState w s e a] -> Encoding

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-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" '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

Constructors

IndexedBlock 

Fields

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