Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data TraceError e
- data EndpointError = EndpointNotActive (Maybe Wallet) EndpointDescription
- class AsTraceError r e | r -> e where
- _TraceError :: Prism' r (TraceError e)
- _TraceAssertionError :: Prism' r AssertionError
- _TContractError :: Prism' r e
- _HookError :: Prism' r EndpointError
- toNotifyError :: ContractInstanceId -> EndpointError -> NotificationError
- handleAdjustUnbalancedTx :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleSlotNotifications :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleTimeNotifications :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleOwnAddressesQueries :: (Member (LogObserve (LogMessage Text)) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp
- handleCurrentNodeClientSlotQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleCurrentChainIndexSlotQueries :: (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs PABReq PABResp
- handleCurrentTimeQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleCurrentNodeClientTimeRangeQueries :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleTimeToSlotConversions :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- handleUnbalancedTransactions :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp
- handlePendingTransactions :: (Member (LogObserve (LogMessage Text)) effs, Member (LogMsg RequestHandlerLogMsg) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp
- handleChainIndexQueries :: (Member (LogObserve (LogMessage Text)) effs, Member ChainIndexQueryEffect effs) => RequestHandler effs PABReq PABResp
- handleOwnInstanceIdQueries :: (Member (LogObserve (LogMessage Text)) effs, Member (Reader ContractInstanceId) effs) => RequestHandler effs PABReq PABResp
- handleYieldedUnbalancedTx :: (Member (LogObserve (LogMessage Text)) effs, Member WalletEffect effs) => RequestHandler effs PABReq PABResp
- handleGetParams :: (Member (LogObserve (LogMessage Text)) effs, Member NodeClientEffect effs) => RequestHandler effs PABReq PABResp
- type InitialDistribution = Map Wallet Value
- defaultDist :: InitialDistribution
- defaultDistFor :: [Wallet] -> InitialDistribution
- data Wallet = Wallet {}
- mockWalletAddress :: Wallet -> CardanoAddress
- mockWalletPaymentPubKey :: Wallet -> PaymentPubKey
- mockWalletPaymentPubKeyHash :: Wallet -> PaymentPubKeyHash
- knownWallets :: [Wallet]
- knownWallet :: Integer -> Wallet
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
Eq e => Eq (TraceError e) Source # | |
Defined in Plutus.Contract.Trace (==) :: TraceError e -> TraceError e -> Bool Source # (/=) :: TraceError e -> TraceError e -> Bool Source # | |
Show e => Show (TraceError e) Source # | |
Defined in Plutus.Contract.Trace | |
AsAssertionError (TraceError e) Source # | |
Defined in Plutus.Contract.Trace _AssertionError :: Prism' (TraceError e) AssertionError Source # _GenericAssertion :: Prism' (TraceError e) Text Source # | |
AsTraceError (TraceError e) e Source # | |
Defined in Plutus.Contract.Trace _TraceError :: Prism' (TraceError e) (TraceError e) Source # _TraceAssertionError :: Prism' (TraceError e) AssertionError Source # _TContractError :: Prism' (TraceError e) e Source # _HookError :: Prism' (TraceError e) EndpointError Source # |
data EndpointError Source #
Instances
class AsTraceError r e | r -> e where Source #
_TraceError :: Prism' r (TraceError e) Source #
_TraceAssertionError :: Prism' r AssertionError Source #
_TContractError :: Prism' r e Source #
_HookError :: Prism' r EndpointError Source #
Instances
AsTraceError (TraceError e) e Source # | |
Defined in Plutus.Contract.Trace _TraceError :: Prism' (TraceError e) (TraceError e) Source # _TraceAssertionError :: Prism' (TraceError e) AssertionError Source # _TContractError :: Prism' (TraceError e) e Source # _HookError :: Prism' (TraceError e) EndpointError Source # |
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
type InitialDistribution = Map Wallet Value Source #
defaultDistFor :: [Wallet] -> InitialDistribution Source #
Wallets
A wallet identifier
Instances
Eq Wallet Source # | |
Data Wallet Source # | |
Defined in Wallet.Emulator.Wallet 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 # | |
Defined in Wallet.Emulator.Wallet | |
Show Wallet Source # | |
Generic Wallet Source # | |
FromJSON Wallet Source # | |
Defined in Wallet.Emulator.Wallet parseJSON :: Value -> Parser Wallet parseJSONList :: Value -> Parser [Wallet] | |
ToJSON Wallet Source # | |
Defined in Wallet.Emulator.Wallet toEncoding :: Wallet -> Encoding toJSONList :: [Wallet] -> Value toEncodingList :: [Wallet] -> Encoding | |
ToJSONKey Wallet Source # | |
Defined in Wallet.Emulator.Wallet toJSONKey :: ToJSONKeyFunction Wallet toJSONKeyList :: ToJSONKeyFunction [Wallet] | |
Pretty Wallet Source # | |
Defined in Wallet.Emulator.Wallet prettyList :: [Wallet] -> Doc ann | |
FromHttpApiData Wallet Source # | |
Defined in Wallet.Emulator.Wallet parseUrlPiece :: Text -> Either Text Wallet parseHeader :: ByteString -> Either Text Wallet parseQueryParam :: Text -> Either Text Wallet | |
ToHttpApiData Wallet Source # | |
Defined in Wallet.Emulator.Wallet toUrlPiece :: Wallet -> Text toEncodedUrlPiece :: Wallet -> Builder toHeader :: Wallet -> ByteString toQueryParam :: Wallet -> Text | |
type Rep Wallet Source # | |
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).
knownWallets :: [Wallet] Source #
knownWallet :: Integer -> Wallet Source #