plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.Trace

Description

A trace is a sequence of actions by simulated wallets that can be run on the mockchain. This module contains the functions needed to build traces.

Synopsis

Documentation

data TraceError e Source #

Error produced while running a trace. Either a contract-specific error (of type e), or an AssertionError from the emulator.

Instances

Instances details
Eq e => Eq (TraceError e) Source # 
Instance details

Defined in Plutus.Contract.Trace

Show e => Show (TraceError e) Source # 
Instance details

Defined in Plutus.Contract.Trace

AsAssertionError (TraceError e) Source # 
Instance details

Defined in Plutus.Contract.Trace

AsTraceError (TraceError e) e Source # 
Instance details

Defined in Plutus.Contract.Trace

data EndpointError Source #

Instances

Instances details
Eq EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Show EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Generic EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Associated Types

type Rep EndpointError :: Type -> Type Source #

FromJSON EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Methods

parseJSON :: Value -> Parser EndpointError

parseJSONList :: Value -> Parser [EndpointError]

ToJSON EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Methods

toJSON :: EndpointError -> Value

toEncoding :: EndpointError -> Encoding

toJSONList :: [EndpointError] -> Value

toEncodingList :: [EndpointError] -> Encoding

Pretty EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

Methods

pretty :: EndpointError -> Doc ann

prettyList :: [EndpointError] -> Doc ann

type Rep EndpointError Source # 
Instance details

Defined in Plutus.Contract.Trace

type Rep EndpointError = D1 ('MetaData "EndpointError" "Plutus.Contract.Trace" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "EndpointNotActive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Wallet)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EndpointDescription)))

class AsTraceError r e | r -> e where Source #

Minimal complete definition

_TraceError

Instances

Instances details
AsTraceError (TraceError e) e Source # 
Instance details

Defined in Plutus.Contract.Trace

Handle contract requests

handleAdjustUnbalancedTx :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleSlotNotifications :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleTimeNotifications :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleOwnAddressesQueries :: (Member (LogObserve (LogMessage Text)) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp Source #

handleCurrentNodeClientSlotQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleCurrentChainIndexSlotQueries :: (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs PABReq PABResp Source #

handleCurrentTimeQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleCurrentNodeClientTimeRangeQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleTimeToSlotConversions :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

handleUnbalancedTransactions :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp Source #

handlePendingTransactions :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp Source #

Submit the wallet's pending transactions to the blockchain.

handleChainIndexQueries :: (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs PABReq PABResp Source #

handleOwnInstanceIdQueries :: (Member (LogObserve (LogMessage Text)) effs, Member (Reader ContractInstanceId) effs) => RequestHandler effs PABReq PABResp Source #

handleYieldedUnbalancedTx :: (Member (LogObserve (LogMessage Text)) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp Source #

handleGetParams :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp Source #

Initial distributions of emulated chains

Wallets

data Wallet Source #

A wallet identifier

Instances

Instances details
Eq Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Data Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Wallet -> c Wallet Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Wallet Source #

toConstr :: Wallet -> Constr Source #

dataTypeOf :: Wallet -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Wallet) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Wallet) Source #

gmapT :: (forall b. Data b => b -> b) -> Wallet -> Wallet Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Wallet -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Wallet -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Wallet -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Wallet -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Wallet -> m Wallet Source #

Ord Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Show Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Generic Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Associated Types

type Rep Wallet :: Type -> Type Source #

FromJSON Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

parseJSON :: Value -> Parser Wallet

parseJSONList :: Value -> Parser [Wallet]

ToJSON Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

toJSON :: Wallet -> Value

toEncoding :: Wallet -> Encoding

toJSONList :: [Wallet] -> Value

toEncodingList :: [Wallet] -> Encoding

ToJSONKey Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

toJSONKey :: ToJSONKeyFunction Wallet

toJSONKeyList :: ToJSONKeyFunction [Wallet]

Pretty Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

pretty :: Wallet -> Doc ann

prettyList :: [Wallet] -> Doc ann

FromHttpApiData Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

parseUrlPiece :: Text -> Either Text Wallet

parseHeader :: ByteString -> Either Text Wallet

parseQueryParam :: Text -> Either Text Wallet

ToHttpApiData Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

Methods

toUrlPiece :: Wallet -> Text

toEncodedUrlPiece :: Wallet -> Builder

toHeader :: Wallet -> ByteString

toQueryParam :: Wallet -> Text

type Rep Wallet Source # 
Instance details

Defined in Wallet.Emulator.Wallet

type Rep Wallet = D1 ('MetaData "Wallet" "Wallet.Emulator.Wallet" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "Wallet" 'PrefixI 'True) (S1 ('MetaSel ('Just "prettyWalletName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)) :*: S1 ('MetaSel ('Just "getWalletId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 WalletId)))

mockWalletAddress :: Wallet -> CardanoAddress Source #

Get the cardano address of a mock wallet. (Fails if the wallet is not a mock wallet).

mockWalletPaymentPubKey :: Wallet -> PaymentPubKey Source #

The public key of a mock wallet. (Fails if the wallet is not a mock wallet).

mockWalletPaymentPubKeyHash :: Wallet -> PaymentPubKeyHash Source #

The payment public key hash of a mock wallet. (Fails if the wallet is not a mock wallet).