| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Convex.TestingInterface.Trace
Synopsis
- data TestRunTrace = TestRunTrace {
- trtTestId :: !Int
- trtTestName :: !Text
- trtPath :: ![Text]
- trtCategory :: !TestCategory
- trtIterations :: ![IterationTrace]
- data TestCategory
- data IterationTrace = IterationTrace {
- itIndex :: !Int
- itStatus :: !IterationStatus
- itTransitions :: ![Transition]
- itThreatModels :: ![ThreatModelTrace]
- data IterationStatus
- data Transition = Transition {
- trStepIndex :: !Int
- trAction :: !Text
- trStateBefore :: !Value
- trStateAfter :: !Value
- trTransaction :: !(Maybe TxSummary)
- trResult :: !TransitionResult
- data TransitionResult
- data TxSummary = TxSummary {
- txsId :: !(Maybe Text)
- txsInputs :: ![TxInputSummary]
- txsOutputs :: ![TxOutputSummary]
- txsMint :: !(Maybe ValueSummary)
- txsFee :: !Integer
- txsSigners :: ![Text]
- txsValidRange :: !(Maybe Text)
- txsWithdrawals :: ![TxWithdrawalSummary]
- data TxInputSummary = TxInputSummary {
- tisUtxo :: !Text
- tisAddress :: !Text
- tisAddressType :: !AddressType
- tisAddressLabel :: !(Maybe Text)
- tisValue :: ValueSummary
- tisRedeemerRaw :: !(Maybe Text)
- tisRedeemerConstr :: !(Maybe Integer)
- tisRedeemerKind :: !(Maybe Text)
- tisRedeemerPayload :: !(Maybe Value)
- data TxOutputSummary = TxOutputSummary {
- tosUtxo :: !Text
- tosAddress :: !Text
- tosAddressType :: !AddressType
- tosAddressLabel :: !(Maybe Text)
- tosValue :: !ValueSummary
- tosDatum :: !(Maybe Text)
- data TxWithdrawalSummary = TxWithdrawalSummary {
- twsStakeAddress :: !Text
- twsAddressType :: !AddressType
- twsAddressLabel :: !(Maybe Text)
- twsAmount :: !Integer
- twsRedeemerRaw :: !(Maybe Text)
- twsRedeemerConstr :: !(Maybe Integer)
- twsRedeemerKind :: !(Maybe Text)
- twsRedeemerPayload :: !(Maybe Value)
- data ValueSummary = ValueSummary {
- vsLovelace :: !Integer
- vsAssets :: ![AssetSummary]
- data AssetSummary = AssetSummary {
- asPolicyId :: !Text
- asName :: !Text
- asQuantity :: !Integer
- data ThreatModelTrace = ThreatModelTrace {
- tmtName :: !Text
- tmtCategory :: !ThreatModelCategory
- tmtTestId :: !Int
- tmtTargetTxIndex :: !Int
- tmtModifications :: ![Value]
- tmtOriginalTx :: !TxSummary
- tmtModifiedTx :: !(Maybe TxSummary)
- tmtValidation :: !(Maybe ThreatModelValidation)
- tmtOutcome :: !ThreatModelTraceOutcome
- tmtCovered :: ![SrcLocRange]
- data ThreatModelTraceOutcome
- data ThreatModelValidation
- = TMVValid
- | TMVPhase1Invalid ![Text]
- | TMVPhase2Invalid ![Text]
- | TMVRebalanceFailed !Text
- data RedeemerTag = RedeemerTag {}
- newtype RedeemerTagger = RedeemerTagger {}
- data AddressType
- newtype AddressLabeler = AddressLabeler {
- applyAddressLabeler :: Text -> Maybe Text
Test run trace
data TestRunTrace Source #
Complete trace of a test run (one QuickCheck property execution = N iterations).
Links to the Tasty test tree via trtTestId.
Constructors
| TestRunTrace | |
Fields
| |
Instances
data TestCategory Source #
Whether this test run is a positive or negative test property.
Instances
| ToJSON TestCategory Source # | |
Defined in Convex.TestingInterface.Trace Methods toJSON :: TestCategory -> Value Source # toEncoding :: TestCategory -> Encoding Source # toJSONList :: [TestCategory] -> Value Source # toEncodingList :: [TestCategory] -> Encoding Source # omitField :: TestCategory -> Bool Source # | |
| Generic TestCategory Source # | |
Defined in Convex.TestingInterface.Trace Associated Types type Rep TestCategory :: Type -> Type # | |
| Show TestCategory Source # | |
Defined in Convex.TestingInterface.Trace Methods showsPrec :: Int -> TestCategory -> ShowS # show :: TestCategory -> String # showList :: [TestCategory] -> ShowS # | |
| Eq TestCategory Source # | |
Defined in Convex.TestingInterface.Trace | |
| type Rep TestCategory Source # | |
Defined in Convex.TestingInterface.Trace | |
Iteration trace
data IterationTrace Source #
Trace of a single QuickCheck iteration within a test run.
Constructors
| IterationTrace | |
Fields
| |
Instances
data IterationStatus Source #
Outcome of a single iteration.
Constructors
| IterationSuccess | |
| IterationFailure !Text | |
| IterationDiscarded !Text |
Instances
State transitions
data Transition Source #
One step in an iteration: an action was performed, the model state changed, and a transaction was (possibly) submitted.
Constructors
| Transition | |
Fields
| |
Instances
data TransitionResult Source #
Whether the transaction was successfully submitted to the mockchain.
Constructors
| TransitionSuccess !Text | TxId as text |
| TransitionFailure !Text | Error description |
Instances
Transaction summary
Compact representation of a transaction for visualization. Values are structured JSON for full fidelity.
Constructors
| TxSummary | |
Fields
| |
Instances
data TxInputSummary Source #
Summary of a transaction input.
Constructors
| TxInputSummary | |
Fields
| |
Instances
data TxOutputSummary Source #
Summary of a transaction output.
Constructors
| TxOutputSummary | |
Fields
| |
Instances
data TxWithdrawalSummary Source #
Summary of a stake-reward withdrawal. Includes zero-lovelace withdrawals, which are how a script attached to a stake credential can be triggered to run its logic without spending or creating any UTxO (the "withdraw zero trick").
Constructors
| TxWithdrawalSummary | |
Fields
| |
Instances
Value representation
data ValueSummary Source #
Structured representation of a Cardano value for JSON serialization.
Constructors
| ValueSummary | |
Fields
| |
Instances
data AssetSummary Source #
Constructors
| AssetSummary | |
Fields
| |
Instances
Threat model trace
data ThreatModelTrace Source #
What happened when a threat model was applied to a specific transaction in this iteration.
Constructors
| ThreatModelTrace | |
Fields
| |
Instances
data ThreatModelTraceOutcome Source #
Outcome of applying a threat model to a transaction.
Constructors
| TMTOPassed | Modified tx was correctly rejected by the ledger (good!) |
| TMTOFailed !Text | Modified tx was ACCEPTED by the ledger (vulnerability found!) |
| TMTOSkipped !Text | Couldn't test: rebalancing failed or precondition not met |
| TMTOSkippedPhase1 !Text | Skipped: modified tx hit Phase 1 invalidation |
| TMTOError !Text | Unexpected error during threat model execution |
Instances
data ThreatModelValidation Source #
The ledger's verdict on a single modified transaction produced by a Validate call.
Constructors
| TMVValid | Phase 1 and Phase 2 both passed: the ledger accepted the modified tx |
| TMVPhase1Invalid ![Text] | Rejected by Phase 1 ledger rules; scripts never ran. Carries the error messages. |
| TMVPhase2Invalid ![Text] | Phase 1 passed but a script rejected the tx. Carries the script error messages. |
| TMVRebalanceFailed !Text | The modified tx could not be rebalanced and signed, so it was never validated |
Instances
Redeemer tagging (Tier 2)
data RedeemerTag Source #
A human-readable label for a redeemer, produced by a RedeemerTagger
supplied by the implementor (Tier 2). When no tagger matches, both
tisRedeemerKind and tisRedeemerPayload stay Nothing and only Tier 1
(tisRedeemerRaw / tisRedeemerConstr) is streamed.
newtype RedeemerTagger Source #
An opt-in function from a parsed Plutus Data (the redeemer of a script
input) to an optional RedeemerTag. The Monoid instance picks the first
Just result, enabling composition of per-validator taggers.
Constructors
| RedeemerTagger | |
Fields | |
Instances
| Monoid RedeemerTagger Source # | |
Defined in Convex.TestingInterface.Trace Methods mappend :: RedeemerTagger -> RedeemerTagger -> RedeemerTagger # mconcat :: [RedeemerTagger] -> RedeemerTagger # | |
| Semigroup RedeemerTagger Source # | |
Defined in Convex.TestingInterface.Trace Methods (<>) :: RedeemerTagger -> RedeemerTagger -> RedeemerTagger # sconcat :: NonEmpty RedeemerTagger -> RedeemerTagger # stimes :: Integral b => b -> RedeemerTagger -> RedeemerTagger # | |
Address labeling
data AddressType Source #
Whether an address's credential is a public key or a script, so a client doesn't have to parse the address itself to find out.
Instances
| ToJSON AddressType Source # | |
Defined in Convex.TestingInterface.Trace Methods toJSON :: AddressType -> Value Source # toEncoding :: AddressType -> Encoding Source # toJSONList :: [AddressType] -> Value Source # toEncodingList :: [AddressType] -> Encoding Source # omitField :: AddressType -> Bool Source # | |
| Generic AddressType Source # | |
Defined in Convex.TestingInterface.Trace Associated Types type Rep AddressType :: Type -> Type # | |
| Show AddressType Source # | |
Defined in Convex.TestingInterface.Trace Methods showsPrec :: Int -> AddressType -> ShowS # show :: AddressType -> String # showList :: [AddressType] -> ShowS # | |
| Eq AddressType Source # | |
Defined in Convex.TestingInterface.Trace | |
| type Rep AddressType Source # | |
Defined in Convex.TestingInterface.Trace | |
newtype AddressLabeler Source #
An opt-in function from the hex-encoded hash of an address's payment or
stake credential (key hash or script hash) to a human-readable label, so a
client doesn't need to recognise raw hashes to tell wallets and scripts
apart. The TestingInterface default (mockWalletAddressLabeler)
labels the standard mock wallets as "Wallet 1".."Wallet 10"; override or extend it
(via the Monoid instance, which picks the first Just result) to label a
model's own script hashes or additional keys.
Constructors
| AddressLabeler | |
Fields
| |
Instances
| Monoid AddressLabeler Source # | |
Defined in Convex.TestingInterface.Trace Methods mappend :: AddressLabeler -> AddressLabeler -> AddressLabeler # mconcat :: [AddressLabeler] -> AddressLabeler # | |
| Semigroup AddressLabeler Source # | |
Defined in Convex.TestingInterface.Trace Methods (<>) :: AddressLabeler -> AddressLabeler -> AddressLabeler # sconcat :: NonEmpty AddressLabeler -> AddressLabeler # stimes :: Integral b => b -> AddressLabeler -> AddressLabeler # | |