{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
module Convex.TestingInterface.Trace (
TestRunTrace (..),
TestCategory (..),
IterationTrace (..),
IterationStatus (..),
Transition (..),
TransitionResult (..),
TxSummary (..),
TxInputSummary (..),
TxOutputSummary (..),
TxWithdrawalSummary (..),
ValueSummary (..),
AssetSummary (..),
ThreatModelTrace (..),
ThreatModelTraceOutcome (..),
ThreatModelValidation (..),
RedeemerTag (..),
RedeemerTagger (..),
AddressType (..),
AddressLabeler (..),
) where
import Control.Applicative ((<|>))
import Convex.Tasty.Streaming.SrcLoc (SrcLocRange, groupRanges)
import Convex.Tasty.Streaming.TMSummary (ThreatModelCategory)
import Data.Aeson (ToJSON (..), Value, object, (.=))
import Data.Text (Text)
import GHC.Generics (Generic)
import PlutusTx (Data)
data TestRunTrace = TestRunTrace
{ TestRunTrace -> Int
trtTestId :: !Int
, TestRunTrace -> Text
trtTestName :: !Text
, TestRunTrace -> [Text]
trtPath :: ![Text]
, TestRunTrace -> TestCategory
trtCategory :: !TestCategory
, TestRunTrace -> [IterationTrace]
trtIterations :: ![IterationTrace]
}
deriving (TestRunTrace -> TestRunTrace -> Bool
(TestRunTrace -> TestRunTrace -> Bool)
-> (TestRunTrace -> TestRunTrace -> Bool) -> Eq TestRunTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TestRunTrace -> TestRunTrace -> Bool
== :: TestRunTrace -> TestRunTrace -> Bool
$c/= :: TestRunTrace -> TestRunTrace -> Bool
/= :: TestRunTrace -> TestRunTrace -> Bool
Eq, Int -> TestRunTrace -> ShowS
[TestRunTrace] -> ShowS
TestRunTrace -> String
(Int -> TestRunTrace -> ShowS)
-> (TestRunTrace -> String)
-> ([TestRunTrace] -> ShowS)
-> Show TestRunTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TestRunTrace -> ShowS
showsPrec :: Int -> TestRunTrace -> ShowS
$cshow :: TestRunTrace -> String
show :: TestRunTrace -> String
$cshowList :: [TestRunTrace] -> ShowS
showList :: [TestRunTrace] -> ShowS
Show, (forall x. TestRunTrace -> Rep TestRunTrace x)
-> (forall x. Rep TestRunTrace x -> TestRunTrace)
-> Generic TestRunTrace
forall x. Rep TestRunTrace x -> TestRunTrace
forall x. TestRunTrace -> Rep TestRunTrace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TestRunTrace -> Rep TestRunTrace x
from :: forall x. TestRunTrace -> Rep TestRunTrace x
$cto :: forall x. Rep TestRunTrace x -> TestRunTrace
to :: forall x. Rep TestRunTrace x -> TestRunTrace
Generic)
data TestCategory
= Positive
| Negative
deriving (TestCategory -> TestCategory -> Bool
(TestCategory -> TestCategory -> Bool)
-> (TestCategory -> TestCategory -> Bool) -> Eq TestCategory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TestCategory -> TestCategory -> Bool
== :: TestCategory -> TestCategory -> Bool
$c/= :: TestCategory -> TestCategory -> Bool
/= :: TestCategory -> TestCategory -> Bool
Eq, Int -> TestCategory -> ShowS
[TestCategory] -> ShowS
TestCategory -> String
(Int -> TestCategory -> ShowS)
-> (TestCategory -> String)
-> ([TestCategory] -> ShowS)
-> Show TestCategory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TestCategory -> ShowS
showsPrec :: Int -> TestCategory -> ShowS
$cshow :: TestCategory -> String
show :: TestCategory -> String
$cshowList :: [TestCategory] -> ShowS
showList :: [TestCategory] -> ShowS
Show, (forall x. TestCategory -> Rep TestCategory x)
-> (forall x. Rep TestCategory x -> TestCategory)
-> Generic TestCategory
forall x. Rep TestCategory x -> TestCategory
forall x. TestCategory -> Rep TestCategory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TestCategory -> Rep TestCategory x
from :: forall x. TestCategory -> Rep TestCategory x
$cto :: forall x. Rep TestCategory x -> TestCategory
to :: forall x. Rep TestCategory x -> TestCategory
Generic)
instance ToJSON TestCategory where
toJSON :: TestCategory -> Value
toJSON TestCategory
Positive = Value
"positive"
toJSON TestCategory
Negative = Value
"negative"
data IterationTrace = IterationTrace
{ IterationTrace -> Int
itIndex :: !Int
, IterationTrace -> IterationStatus
itStatus :: !IterationStatus
, IterationTrace -> [Transition]
itTransitions :: ![Transition]
, IterationTrace -> [ThreatModelTrace]
itThreatModels :: ![ThreatModelTrace]
}
deriving (IterationTrace -> IterationTrace -> Bool
(IterationTrace -> IterationTrace -> Bool)
-> (IterationTrace -> IterationTrace -> Bool) -> Eq IterationTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IterationTrace -> IterationTrace -> Bool
== :: IterationTrace -> IterationTrace -> Bool
$c/= :: IterationTrace -> IterationTrace -> Bool
/= :: IterationTrace -> IterationTrace -> Bool
Eq, Int -> IterationTrace -> ShowS
[IterationTrace] -> ShowS
IterationTrace -> String
(Int -> IterationTrace -> ShowS)
-> (IterationTrace -> String)
-> ([IterationTrace] -> ShowS)
-> Show IterationTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IterationTrace -> ShowS
showsPrec :: Int -> IterationTrace -> ShowS
$cshow :: IterationTrace -> String
show :: IterationTrace -> String
$cshowList :: [IterationTrace] -> ShowS
showList :: [IterationTrace] -> ShowS
Show, (forall x. IterationTrace -> Rep IterationTrace x)
-> (forall x. Rep IterationTrace x -> IterationTrace)
-> Generic IterationTrace
forall x. Rep IterationTrace x -> IterationTrace
forall x. IterationTrace -> Rep IterationTrace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IterationTrace -> Rep IterationTrace x
from :: forall x. IterationTrace -> Rep IterationTrace x
$cto :: forall x. Rep IterationTrace x -> IterationTrace
to :: forall x. Rep IterationTrace x -> IterationTrace
Generic)
data IterationStatus
= IterationSuccess
| IterationFailure !Text
| IterationDiscarded !Text
deriving (IterationStatus -> IterationStatus -> Bool
(IterationStatus -> IterationStatus -> Bool)
-> (IterationStatus -> IterationStatus -> Bool)
-> Eq IterationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IterationStatus -> IterationStatus -> Bool
== :: IterationStatus -> IterationStatus -> Bool
$c/= :: IterationStatus -> IterationStatus -> Bool
/= :: IterationStatus -> IterationStatus -> Bool
Eq, Int -> IterationStatus -> ShowS
[IterationStatus] -> ShowS
IterationStatus -> String
(Int -> IterationStatus -> ShowS)
-> (IterationStatus -> String)
-> ([IterationStatus] -> ShowS)
-> Show IterationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IterationStatus -> ShowS
showsPrec :: Int -> IterationStatus -> ShowS
$cshow :: IterationStatus -> String
show :: IterationStatus -> String
$cshowList :: [IterationStatus] -> ShowS
showList :: [IterationStatus] -> ShowS
Show, (forall x. IterationStatus -> Rep IterationStatus x)
-> (forall x. Rep IterationStatus x -> IterationStatus)
-> Generic IterationStatus
forall x. Rep IterationStatus x -> IterationStatus
forall x. IterationStatus -> Rep IterationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IterationStatus -> Rep IterationStatus x
from :: forall x. IterationStatus -> Rep IterationStatus x
$cto :: forall x. Rep IterationStatus x -> IterationStatus
to :: forall x. Rep IterationStatus x -> IterationStatus
Generic)
data Transition = Transition
{ Transition -> Int
trStepIndex :: !Int
, Transition -> Text
trAction :: !Text
, Transition -> Value
trStateBefore :: !Value
, Transition -> Value
trStateAfter :: !Value
, Transition -> Maybe TxSummary
trTransaction :: !(Maybe TxSummary)
, Transition -> TransitionResult
trResult :: !TransitionResult
}
deriving (Transition -> Transition -> Bool
(Transition -> Transition -> Bool)
-> (Transition -> Transition -> Bool) -> Eq Transition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Transition -> Transition -> Bool
== :: Transition -> Transition -> Bool
$c/= :: Transition -> Transition -> Bool
/= :: Transition -> Transition -> Bool
Eq, Int -> Transition -> ShowS
[Transition] -> ShowS
Transition -> String
(Int -> Transition -> ShowS)
-> (Transition -> String)
-> ([Transition] -> ShowS)
-> Show Transition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Transition -> ShowS
showsPrec :: Int -> Transition -> ShowS
$cshow :: Transition -> String
show :: Transition -> String
$cshowList :: [Transition] -> ShowS
showList :: [Transition] -> ShowS
Show, (forall x. Transition -> Rep Transition x)
-> (forall x. Rep Transition x -> Transition) -> Generic Transition
forall x. Rep Transition x -> Transition
forall x. Transition -> Rep Transition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Transition -> Rep Transition x
from :: forall x. Transition -> Rep Transition x
$cto :: forall x. Rep Transition x -> Transition
to :: forall x. Rep Transition x -> Transition
Generic)
data TransitionResult
=
TransitionSuccess !Text
|
TransitionFailure !Text
deriving (TransitionResult -> TransitionResult -> Bool
(TransitionResult -> TransitionResult -> Bool)
-> (TransitionResult -> TransitionResult -> Bool)
-> Eq TransitionResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransitionResult -> TransitionResult -> Bool
== :: TransitionResult -> TransitionResult -> Bool
$c/= :: TransitionResult -> TransitionResult -> Bool
/= :: TransitionResult -> TransitionResult -> Bool
Eq, Int -> TransitionResult -> ShowS
[TransitionResult] -> ShowS
TransitionResult -> String
(Int -> TransitionResult -> ShowS)
-> (TransitionResult -> String)
-> ([TransitionResult] -> ShowS)
-> Show TransitionResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransitionResult -> ShowS
showsPrec :: Int -> TransitionResult -> ShowS
$cshow :: TransitionResult -> String
show :: TransitionResult -> String
$cshowList :: [TransitionResult] -> ShowS
showList :: [TransitionResult] -> ShowS
Show, (forall x. TransitionResult -> Rep TransitionResult x)
-> (forall x. Rep TransitionResult x -> TransitionResult)
-> Generic TransitionResult
forall x. Rep TransitionResult x -> TransitionResult
forall x. TransitionResult -> Rep TransitionResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TransitionResult -> Rep TransitionResult x
from :: forall x. TransitionResult -> Rep TransitionResult x
$cto :: forall x. Rep TransitionResult x -> TransitionResult
to :: forall x. Rep TransitionResult x -> TransitionResult
Generic)
data TxSummary = TxSummary
{ TxSummary -> Maybe Text
txsId :: !(Maybe Text)
, TxSummary -> [TxInputSummary]
txsInputs :: ![TxInputSummary]
, TxSummary -> [TxOutputSummary]
txsOutputs :: ![TxOutputSummary]
, TxSummary -> Maybe ValueSummary
txsMint :: !(Maybe ValueSummary)
, TxSummary -> Integer
txsFee :: !Integer
, TxSummary -> [Text]
txsSigners :: ![Text]
, TxSummary -> Maybe Text
txsValidRange :: !(Maybe Text)
, TxSummary -> [TxWithdrawalSummary]
txsWithdrawals :: ![TxWithdrawalSummary]
}
deriving (TxSummary -> TxSummary -> Bool
(TxSummary -> TxSummary -> Bool)
-> (TxSummary -> TxSummary -> Bool) -> Eq TxSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxSummary -> TxSummary -> Bool
== :: TxSummary -> TxSummary -> Bool
$c/= :: TxSummary -> TxSummary -> Bool
/= :: TxSummary -> TxSummary -> Bool
Eq, Int -> TxSummary -> ShowS
[TxSummary] -> ShowS
TxSummary -> String
(Int -> TxSummary -> ShowS)
-> (TxSummary -> String)
-> ([TxSummary] -> ShowS)
-> Show TxSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxSummary -> ShowS
showsPrec :: Int -> TxSummary -> ShowS
$cshow :: TxSummary -> String
show :: TxSummary -> String
$cshowList :: [TxSummary] -> ShowS
showList :: [TxSummary] -> ShowS
Show, (forall x. TxSummary -> Rep TxSummary x)
-> (forall x. Rep TxSummary x -> TxSummary) -> Generic TxSummary
forall x. Rep TxSummary x -> TxSummary
forall x. TxSummary -> Rep TxSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TxSummary -> Rep TxSummary x
from :: forall x. TxSummary -> Rep TxSummary x
$cto :: forall x. Rep TxSummary x -> TxSummary
to :: forall x. Rep TxSummary x -> TxSummary
Generic)
data TxInputSummary = TxInputSummary
{ TxInputSummary -> Text
tisUtxo :: !Text
, TxInputSummary -> Text
tisAddress :: !Text
, TxInputSummary -> AddressType
tisAddressType :: !AddressType
, TxInputSummary -> Maybe Text
tisAddressLabel :: !(Maybe Text)
, TxInputSummary -> ValueSummary
tisValue :: ValueSummary
, TxInputSummary -> Maybe Text
tisRedeemerRaw :: !(Maybe Text)
, TxInputSummary -> Maybe Integer
tisRedeemerConstr :: !(Maybe Integer)
, TxInputSummary -> Maybe Text
tisRedeemerKind :: !(Maybe Text)
, TxInputSummary -> Maybe Value
tisRedeemerPayload :: !(Maybe Value)
}
deriving (TxInputSummary -> TxInputSummary -> Bool
(TxInputSummary -> TxInputSummary -> Bool)
-> (TxInputSummary -> TxInputSummary -> Bool) -> Eq TxInputSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxInputSummary -> TxInputSummary -> Bool
== :: TxInputSummary -> TxInputSummary -> Bool
$c/= :: TxInputSummary -> TxInputSummary -> Bool
/= :: TxInputSummary -> TxInputSummary -> Bool
Eq, Int -> TxInputSummary -> ShowS
[TxInputSummary] -> ShowS
TxInputSummary -> String
(Int -> TxInputSummary -> ShowS)
-> (TxInputSummary -> String)
-> ([TxInputSummary] -> ShowS)
-> Show TxInputSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxInputSummary -> ShowS
showsPrec :: Int -> TxInputSummary -> ShowS
$cshow :: TxInputSummary -> String
show :: TxInputSummary -> String
$cshowList :: [TxInputSummary] -> ShowS
showList :: [TxInputSummary] -> ShowS
Show, (forall x. TxInputSummary -> Rep TxInputSummary x)
-> (forall x. Rep TxInputSummary x -> TxInputSummary)
-> Generic TxInputSummary
forall x. Rep TxInputSummary x -> TxInputSummary
forall x. TxInputSummary -> Rep TxInputSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TxInputSummary -> Rep TxInputSummary x
from :: forall x. TxInputSummary -> Rep TxInputSummary x
$cto :: forall x. Rep TxInputSummary x -> TxInputSummary
to :: forall x. Rep TxInputSummary x -> TxInputSummary
Generic)
data TxOutputSummary = TxOutputSummary
{ TxOutputSummary -> Text
tosUtxo :: !Text
, TxOutputSummary -> Text
tosAddress :: !Text
, TxOutputSummary -> AddressType
tosAddressType :: !AddressType
, TxOutputSummary -> Maybe Text
tosAddressLabel :: !(Maybe Text)
, TxOutputSummary -> ValueSummary
tosValue :: !ValueSummary
, TxOutputSummary -> Maybe Text
tosDatum :: !(Maybe Text)
}
deriving (TxOutputSummary -> TxOutputSummary -> Bool
(TxOutputSummary -> TxOutputSummary -> Bool)
-> (TxOutputSummary -> TxOutputSummary -> Bool)
-> Eq TxOutputSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxOutputSummary -> TxOutputSummary -> Bool
== :: TxOutputSummary -> TxOutputSummary -> Bool
$c/= :: TxOutputSummary -> TxOutputSummary -> Bool
/= :: TxOutputSummary -> TxOutputSummary -> Bool
Eq, Int -> TxOutputSummary -> ShowS
[TxOutputSummary] -> ShowS
TxOutputSummary -> String
(Int -> TxOutputSummary -> ShowS)
-> (TxOutputSummary -> String)
-> ([TxOutputSummary] -> ShowS)
-> Show TxOutputSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxOutputSummary -> ShowS
showsPrec :: Int -> TxOutputSummary -> ShowS
$cshow :: TxOutputSummary -> String
show :: TxOutputSummary -> String
$cshowList :: [TxOutputSummary] -> ShowS
showList :: [TxOutputSummary] -> ShowS
Show, (forall x. TxOutputSummary -> Rep TxOutputSummary x)
-> (forall x. Rep TxOutputSummary x -> TxOutputSummary)
-> Generic TxOutputSummary
forall x. Rep TxOutputSummary x -> TxOutputSummary
forall x. TxOutputSummary -> Rep TxOutputSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TxOutputSummary -> Rep TxOutputSummary x
from :: forall x. TxOutputSummary -> Rep TxOutputSummary x
$cto :: forall x. Rep TxOutputSummary x -> TxOutputSummary
to :: forall x. Rep TxOutputSummary x -> TxOutputSummary
Generic)
data AddressType
= PublicKey
| Script
deriving (AddressType -> AddressType -> Bool
(AddressType -> AddressType -> Bool)
-> (AddressType -> AddressType -> Bool) -> Eq AddressType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddressType -> AddressType -> Bool
== :: AddressType -> AddressType -> Bool
$c/= :: AddressType -> AddressType -> Bool
/= :: AddressType -> AddressType -> Bool
Eq, Int -> AddressType -> ShowS
[AddressType] -> ShowS
AddressType -> String
(Int -> AddressType -> ShowS)
-> (AddressType -> String)
-> ([AddressType] -> ShowS)
-> Show AddressType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddressType -> ShowS
showsPrec :: Int -> AddressType -> ShowS
$cshow :: AddressType -> String
show :: AddressType -> String
$cshowList :: [AddressType] -> ShowS
showList :: [AddressType] -> ShowS
Show, (forall x. AddressType -> Rep AddressType x)
-> (forall x. Rep AddressType x -> AddressType)
-> Generic AddressType
forall x. Rep AddressType x -> AddressType
forall x. AddressType -> Rep AddressType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AddressType -> Rep AddressType x
from :: forall x. AddressType -> Rep AddressType x
$cto :: forall x. Rep AddressType x -> AddressType
to :: forall x. Rep AddressType x -> AddressType
Generic)
instance ToJSON AddressType where
toJSON :: AddressType -> Value
toJSON AddressType
PublicKey = Value
"public-key"
toJSON AddressType
Script = Value
"script"
data TxWithdrawalSummary = TxWithdrawalSummary
{ TxWithdrawalSummary -> Text
twsStakeAddress :: !Text
, TxWithdrawalSummary -> AddressType
twsAddressType :: !AddressType
, TxWithdrawalSummary -> Maybe Text
twsAddressLabel :: !(Maybe Text)
, TxWithdrawalSummary -> Integer
twsAmount :: !Integer
, TxWithdrawalSummary -> Maybe Text
twsRedeemerRaw :: !(Maybe Text)
, TxWithdrawalSummary -> Maybe Integer
twsRedeemerConstr :: !(Maybe Integer)
, TxWithdrawalSummary -> Maybe Text
twsRedeemerKind :: !(Maybe Text)
, TxWithdrawalSummary -> Maybe Value
twsRedeemerPayload :: !(Maybe Value)
}
deriving (TxWithdrawalSummary -> TxWithdrawalSummary -> Bool
(TxWithdrawalSummary -> TxWithdrawalSummary -> Bool)
-> (TxWithdrawalSummary -> TxWithdrawalSummary -> Bool)
-> Eq TxWithdrawalSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TxWithdrawalSummary -> TxWithdrawalSummary -> Bool
== :: TxWithdrawalSummary -> TxWithdrawalSummary -> Bool
$c/= :: TxWithdrawalSummary -> TxWithdrawalSummary -> Bool
/= :: TxWithdrawalSummary -> TxWithdrawalSummary -> Bool
Eq, Int -> TxWithdrawalSummary -> ShowS
[TxWithdrawalSummary] -> ShowS
TxWithdrawalSummary -> String
(Int -> TxWithdrawalSummary -> ShowS)
-> (TxWithdrawalSummary -> String)
-> ([TxWithdrawalSummary] -> ShowS)
-> Show TxWithdrawalSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TxWithdrawalSummary -> ShowS
showsPrec :: Int -> TxWithdrawalSummary -> ShowS
$cshow :: TxWithdrawalSummary -> String
show :: TxWithdrawalSummary -> String
$cshowList :: [TxWithdrawalSummary] -> ShowS
showList :: [TxWithdrawalSummary] -> ShowS
Show, (forall x. TxWithdrawalSummary -> Rep TxWithdrawalSummary x)
-> (forall x. Rep TxWithdrawalSummary x -> TxWithdrawalSummary)
-> Generic TxWithdrawalSummary
forall x. Rep TxWithdrawalSummary x -> TxWithdrawalSummary
forall x. TxWithdrawalSummary -> Rep TxWithdrawalSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TxWithdrawalSummary -> Rep TxWithdrawalSummary x
from :: forall x. TxWithdrawalSummary -> Rep TxWithdrawalSummary x
$cto :: forall x. Rep TxWithdrawalSummary x -> TxWithdrawalSummary
to :: forall x. Rep TxWithdrawalSummary x -> TxWithdrawalSummary
Generic)
data ValueSummary = ValueSummary
{ ValueSummary -> Integer
vsLovelace :: !Integer
, ValueSummary -> [AssetSummary]
vsAssets :: ![AssetSummary]
}
deriving (ValueSummary -> ValueSummary -> Bool
(ValueSummary -> ValueSummary -> Bool)
-> (ValueSummary -> ValueSummary -> Bool) -> Eq ValueSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ValueSummary -> ValueSummary -> Bool
== :: ValueSummary -> ValueSummary -> Bool
$c/= :: ValueSummary -> ValueSummary -> Bool
/= :: ValueSummary -> ValueSummary -> Bool
Eq, Int -> ValueSummary -> ShowS
[ValueSummary] -> ShowS
ValueSummary -> String
(Int -> ValueSummary -> ShowS)
-> (ValueSummary -> String)
-> ([ValueSummary] -> ShowS)
-> Show ValueSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ValueSummary -> ShowS
showsPrec :: Int -> ValueSummary -> ShowS
$cshow :: ValueSummary -> String
show :: ValueSummary -> String
$cshowList :: [ValueSummary] -> ShowS
showList :: [ValueSummary] -> ShowS
Show, (forall x. ValueSummary -> Rep ValueSummary x)
-> (forall x. Rep ValueSummary x -> ValueSummary)
-> Generic ValueSummary
forall x. Rep ValueSummary x -> ValueSummary
forall x. ValueSummary -> Rep ValueSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ValueSummary -> Rep ValueSummary x
from :: forall x. ValueSummary -> Rep ValueSummary x
$cto :: forall x. Rep ValueSummary x -> ValueSummary
to :: forall x. Rep ValueSummary x -> ValueSummary
Generic)
data AssetSummary = AssetSummary
{ AssetSummary -> Text
asPolicyId :: !Text
, AssetSummary -> Text
asName :: !Text
, AssetSummary -> Integer
asQuantity :: !Integer
}
deriving (AssetSummary -> AssetSummary -> Bool
(AssetSummary -> AssetSummary -> Bool)
-> (AssetSummary -> AssetSummary -> Bool) -> Eq AssetSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AssetSummary -> AssetSummary -> Bool
== :: AssetSummary -> AssetSummary -> Bool
$c/= :: AssetSummary -> AssetSummary -> Bool
/= :: AssetSummary -> AssetSummary -> Bool
Eq, Int -> AssetSummary -> ShowS
[AssetSummary] -> ShowS
AssetSummary -> String
(Int -> AssetSummary -> ShowS)
-> (AssetSummary -> String)
-> ([AssetSummary] -> ShowS)
-> Show AssetSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AssetSummary -> ShowS
showsPrec :: Int -> AssetSummary -> ShowS
$cshow :: AssetSummary -> String
show :: AssetSummary -> String
$cshowList :: [AssetSummary] -> ShowS
showList :: [AssetSummary] -> ShowS
Show, (forall x. AssetSummary -> Rep AssetSummary x)
-> (forall x. Rep AssetSummary x -> AssetSummary)
-> Generic AssetSummary
forall x. Rep AssetSummary x -> AssetSummary
forall x. AssetSummary -> Rep AssetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AssetSummary -> Rep AssetSummary x
from :: forall x. AssetSummary -> Rep AssetSummary x
$cto :: forall x. Rep AssetSummary x -> AssetSummary
to :: forall x. Rep AssetSummary x -> AssetSummary
Generic)
data RedeemerTag = RedeemerTag
{ RedeemerTag -> Text
rtKind :: !Text
, RedeemerTag -> Maybe Value
rtPayload :: !(Maybe Value)
}
newtype RedeemerTagger = RedeemerTagger
{ RedeemerTagger -> Data -> Maybe RedeemerTag
applyRedeemerTagger :: Data -> Maybe RedeemerTag
}
instance Semigroup RedeemerTagger where
RedeemerTagger Data -> Maybe RedeemerTag
f <> :: RedeemerTagger -> RedeemerTagger -> RedeemerTagger
<> RedeemerTagger Data -> Maybe RedeemerTag
g =
(Data -> Maybe RedeemerTag) -> RedeemerTagger
RedeemerTagger (\Data
d -> Data -> Maybe RedeemerTag
f Data
d Maybe RedeemerTag -> Maybe RedeemerTag -> Maybe RedeemerTag
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Data -> Maybe RedeemerTag
g Data
d)
instance Monoid RedeemerTagger where
mempty :: RedeemerTagger
mempty = (Data -> Maybe RedeemerTag) -> RedeemerTagger
RedeemerTagger (Maybe RedeemerTag -> Data -> Maybe RedeemerTag
forall a b. a -> b -> a
const Maybe RedeemerTag
forall a. Maybe a
Nothing)
newtype AddressLabeler = AddressLabeler
{ AddressLabeler -> Text -> Maybe Text
applyAddressLabeler :: Text -> Maybe Text
}
instance Semigroup AddressLabeler where
AddressLabeler Text -> Maybe Text
f <> :: AddressLabeler -> AddressLabeler -> AddressLabeler
<> AddressLabeler Text -> Maybe Text
g =
(Text -> Maybe Text) -> AddressLabeler
AddressLabeler (\Text
h -> Text -> Maybe Text
f Text
h Maybe Text -> Maybe Text -> Maybe Text
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Text -> Maybe Text
g Text
h)
instance Monoid AddressLabeler where
mempty :: AddressLabeler
mempty = (Text -> Maybe Text) -> AddressLabeler
AddressLabeler (Maybe Text -> Text -> Maybe Text
forall a b. a -> b -> a
const Maybe Text
forall a. Maybe a
Nothing)
instance ToJSON ValueSummary where
toJSON :: ValueSummary -> Value
toJSON ValueSummary
v =
[Pair] -> Value
object
[ Key
"lovelace" Key -> Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ValueSummary -> Integer
vsLovelace ValueSummary
v
, Key
"assets" Key -> [AssetSummary] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ValueSummary -> [AssetSummary]
vsAssets ValueSummary
v
]
instance ToJSON AssetSummary where
toJSON :: AssetSummary -> Value
toJSON AssetSummary
a =
[Pair] -> Value
object
[ Key
"policyId" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= AssetSummary -> Text
asPolicyId AssetSummary
a
, Key
"name" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= AssetSummary -> Text
asName AssetSummary
a
, Key
"quantity" Key -> Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= AssetSummary -> Integer
asQuantity AssetSummary
a
]
data ThreatModelTrace = ThreatModelTrace
{ ThreatModelTrace -> Text
tmtName :: !Text
, ThreatModelTrace -> ThreatModelCategory
tmtCategory :: !ThreatModelCategory
, ThreatModelTrace -> Int
tmtTestId :: !Int
, ThreatModelTrace -> Int
tmtTargetTxIndex :: !Int
, ThreatModelTrace -> [Value]
tmtModifications :: ![Value]
, ThreatModelTrace -> TxSummary
tmtOriginalTx :: !TxSummary
, ThreatModelTrace -> Maybe TxSummary
tmtModifiedTx :: !(Maybe TxSummary)
, ThreatModelTrace -> Maybe ThreatModelValidation
tmtValidation :: !(Maybe ThreatModelValidation)
, ThreatModelTrace -> ThreatModelTraceOutcome
tmtOutcome :: !ThreatModelTraceOutcome
, ThreatModelTrace -> [SrcLocRange]
tmtCovered :: ![SrcLocRange]
}
deriving (ThreatModelTrace -> ThreatModelTrace -> Bool
(ThreatModelTrace -> ThreatModelTrace -> Bool)
-> (ThreatModelTrace -> ThreatModelTrace -> Bool)
-> Eq ThreatModelTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThreatModelTrace -> ThreatModelTrace -> Bool
== :: ThreatModelTrace -> ThreatModelTrace -> Bool
$c/= :: ThreatModelTrace -> ThreatModelTrace -> Bool
/= :: ThreatModelTrace -> ThreatModelTrace -> Bool
Eq, Int -> ThreatModelTrace -> ShowS
[ThreatModelTrace] -> ShowS
ThreatModelTrace -> String
(Int -> ThreatModelTrace -> ShowS)
-> (ThreatModelTrace -> String)
-> ([ThreatModelTrace] -> ShowS)
-> Show ThreatModelTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThreatModelTrace -> ShowS
showsPrec :: Int -> ThreatModelTrace -> ShowS
$cshow :: ThreatModelTrace -> String
show :: ThreatModelTrace -> String
$cshowList :: [ThreatModelTrace] -> ShowS
showList :: [ThreatModelTrace] -> ShowS
Show, (forall x. ThreatModelTrace -> Rep ThreatModelTrace x)
-> (forall x. Rep ThreatModelTrace x -> ThreatModelTrace)
-> Generic ThreatModelTrace
forall x. Rep ThreatModelTrace x -> ThreatModelTrace
forall x. ThreatModelTrace -> Rep ThreatModelTrace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ThreatModelTrace -> Rep ThreatModelTrace x
from :: forall x. ThreatModelTrace -> Rep ThreatModelTrace x
$cto :: forall x. Rep ThreatModelTrace x -> ThreatModelTrace
to :: forall x. Rep ThreatModelTrace x -> ThreatModelTrace
Generic)
data ThreatModelTraceOutcome
=
TMTOPassed
|
TMTOFailed !Text
|
TMTOSkipped !Text
|
TMTOSkippedPhase1 !Text
|
TMTOError !Text
deriving (ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool
(ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool)
-> (ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool)
-> Eq ThreatModelTraceOutcome
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool
== :: ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool
$c/= :: ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool
/= :: ThreatModelTraceOutcome -> ThreatModelTraceOutcome -> Bool
Eq, Int -> ThreatModelTraceOutcome -> ShowS
[ThreatModelTraceOutcome] -> ShowS
ThreatModelTraceOutcome -> String
(Int -> ThreatModelTraceOutcome -> ShowS)
-> (ThreatModelTraceOutcome -> String)
-> ([ThreatModelTraceOutcome] -> ShowS)
-> Show ThreatModelTraceOutcome
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThreatModelTraceOutcome -> ShowS
showsPrec :: Int -> ThreatModelTraceOutcome -> ShowS
$cshow :: ThreatModelTraceOutcome -> String
show :: ThreatModelTraceOutcome -> String
$cshowList :: [ThreatModelTraceOutcome] -> ShowS
showList :: [ThreatModelTraceOutcome] -> ShowS
Show, (forall x.
ThreatModelTraceOutcome -> Rep ThreatModelTraceOutcome x)
-> (forall x.
Rep ThreatModelTraceOutcome x -> ThreatModelTraceOutcome)
-> Generic ThreatModelTraceOutcome
forall x. Rep ThreatModelTraceOutcome x -> ThreatModelTraceOutcome
forall x. ThreatModelTraceOutcome -> Rep ThreatModelTraceOutcome x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ThreatModelTraceOutcome -> Rep ThreatModelTraceOutcome x
from :: forall x. ThreatModelTraceOutcome -> Rep ThreatModelTraceOutcome x
$cto :: forall x. Rep ThreatModelTraceOutcome x -> ThreatModelTraceOutcome
to :: forall x. Rep ThreatModelTraceOutcome x -> ThreatModelTraceOutcome
Generic)
data ThreatModelValidation
=
TMVValid
|
TMVPhase1Invalid ![Text]
|
TMVPhase2Invalid ![Text]
|
TMVRebalanceFailed !Text
deriving (ThreatModelValidation -> ThreatModelValidation -> Bool
(ThreatModelValidation -> ThreatModelValidation -> Bool)
-> (ThreatModelValidation -> ThreatModelValidation -> Bool)
-> Eq ThreatModelValidation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThreatModelValidation -> ThreatModelValidation -> Bool
== :: ThreatModelValidation -> ThreatModelValidation -> Bool
$c/= :: ThreatModelValidation -> ThreatModelValidation -> Bool
/= :: ThreatModelValidation -> ThreatModelValidation -> Bool
Eq, Int -> ThreatModelValidation -> ShowS
[ThreatModelValidation] -> ShowS
ThreatModelValidation -> String
(Int -> ThreatModelValidation -> ShowS)
-> (ThreatModelValidation -> String)
-> ([ThreatModelValidation] -> ShowS)
-> Show ThreatModelValidation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThreatModelValidation -> ShowS
showsPrec :: Int -> ThreatModelValidation -> ShowS
$cshow :: ThreatModelValidation -> String
show :: ThreatModelValidation -> String
$cshowList :: [ThreatModelValidation] -> ShowS
showList :: [ThreatModelValidation] -> ShowS
Show, (forall x. ThreatModelValidation -> Rep ThreatModelValidation x)
-> (forall x. Rep ThreatModelValidation x -> ThreatModelValidation)
-> Generic ThreatModelValidation
forall x. Rep ThreatModelValidation x -> ThreatModelValidation
forall x. ThreatModelValidation -> Rep ThreatModelValidation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ThreatModelValidation -> Rep ThreatModelValidation x
from :: forall x. ThreatModelValidation -> Rep ThreatModelValidation x
$cto :: forall x. Rep ThreatModelValidation x -> ThreatModelValidation
to :: forall x. Rep ThreatModelValidation x -> ThreatModelValidation
Generic)
instance ToJSON TestRunTrace where
toJSON :: TestRunTrace -> Value
toJSON TestRunTrace
t =
[Pair] -> Value
object
[ Key
"testId" Key -> Int -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TestRunTrace -> Int
trtTestId TestRunTrace
t
, Key
"testName" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TestRunTrace -> Text
trtTestName TestRunTrace
t
, Key
"path" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TestRunTrace -> [Text]
trtPath TestRunTrace
t
, Key
"category" Key -> TestCategory -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TestRunTrace -> TestCategory
trtCategory TestRunTrace
t
, Key
"iterations" Key -> [IterationTrace] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TestRunTrace -> [IterationTrace]
trtIterations TestRunTrace
t
]
instance ToJSON IterationTrace where
toJSON :: IterationTrace -> Value
toJSON IterationTrace
t =
[Pair] -> Value
object
[ Key
"index" Key -> Int -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= IterationTrace -> Int
itIndex IterationTrace
t
, Key
"status" Key -> IterationStatus -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= IterationTrace -> IterationStatus
itStatus IterationTrace
t
, Key
"transitions" Key -> [Transition] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= IterationTrace -> [Transition]
itTransitions IterationTrace
t
, Key
"threatModels" Key -> [ThreatModelTrace] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= IterationTrace -> [ThreatModelTrace]
itThreatModels IterationTrace
t
]
instance ToJSON IterationStatus where
toJSON :: IterationStatus -> Value
toJSON IterationStatus
IterationSuccess =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"success" :: Text)]
toJSON (IterationFailure Text
msg) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"failure" :: Text), Key
"message" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
msg]
toJSON (IterationDiscarded Text
msg) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"discarded" :: Text), Key
"message" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
msg]
instance ToJSON Transition where
toJSON :: Transition -> Value
toJSON Transition
t =
[Pair] -> Value
object
[ Key
"stepIndex" Key -> Int -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> Int
trStepIndex Transition
t
, Key
"action" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> Text
trAction Transition
t
, Key
"stateBefore" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> Value
trStateBefore Transition
t
, Key
"stateAfter" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> Value
trStateAfter Transition
t
, Key
"transaction" Key -> Maybe TxSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> Maybe TxSummary
trTransaction Transition
t
, Key
"result" Key -> TransitionResult -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Transition -> TransitionResult
trResult Transition
t
]
instance ToJSON TransitionResult where
toJSON :: TransitionResult -> Value
toJSON (TransitionSuccess Text
txId) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"success" :: Text), Key
"txId" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
txId]
toJSON (TransitionFailure Text
err) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"failure" :: Text), Key
"error" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
err]
instance ToJSON TxSummary where
toJSON :: TxSummary -> Value
toJSON TxSummary
t =
[Pair] -> Value
object
[ Key
"id" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> Maybe Text
txsId TxSummary
t
, Key
"inputs" Key -> [TxInputSummary] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> [TxInputSummary]
txsInputs TxSummary
t
, Key
"outputs" Key -> [TxOutputSummary] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> [TxOutputSummary]
txsOutputs TxSummary
t
, Key
"mint" Key -> Maybe ValueSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> Maybe ValueSummary
txsMint TxSummary
t
, Key
"fee" Key -> Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> Integer
txsFee TxSummary
t
, Key
"signers" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> [Text]
txsSigners TxSummary
t
, Key
"validRange" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> Maybe Text
txsValidRange TxSummary
t
, Key
"withdrawals" Key -> [TxWithdrawalSummary] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxSummary -> [TxWithdrawalSummary]
txsWithdrawals TxSummary
t
]
instance ToJSON TxWithdrawalSummary where
toJSON :: TxWithdrawalSummary -> Value
toJSON TxWithdrawalSummary
t =
[Pair] -> Value
object
[ Key
"stakeAddress" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Text
twsStakeAddress TxWithdrawalSummary
t
, Key
"addressType" Key -> AddressType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> AddressType
twsAddressType TxWithdrawalSummary
t
, Key
"addressLabel" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Maybe Text
twsAddressLabel TxWithdrawalSummary
t
, Key
"amount" Key -> Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Integer
twsAmount TxWithdrawalSummary
t
, Key
"redeemerRaw" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Maybe Text
twsRedeemerRaw TxWithdrawalSummary
t
, Key
"redeemerConstr" Key -> Maybe Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Maybe Integer
twsRedeemerConstr TxWithdrawalSummary
t
, Key
"redeemerKind" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Maybe Text
twsRedeemerKind TxWithdrawalSummary
t
, Key
"redeemerPayload" Key -> Maybe Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxWithdrawalSummary -> Maybe Value
twsRedeemerPayload TxWithdrawalSummary
t
]
instance ToJSON TxInputSummary where
toJSON :: TxInputSummary -> Value
toJSON TxInputSummary
t =
[Pair] -> Value
object
[ Key
"utxo" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Text
tisUtxo TxInputSummary
t
, Key
"address" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Text
tisAddress TxInputSummary
t
, Key
"addressType" Key -> AddressType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> AddressType
tisAddressType TxInputSummary
t
, Key
"addressLabel" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Maybe Text
tisAddressLabel TxInputSummary
t
, Key
"value" Key -> ValueSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> ValueSummary
tisValue TxInputSummary
t
, Key
"redeemerRaw" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Maybe Text
tisRedeemerRaw TxInputSummary
t
, Key
"redeemerConstr" Key -> Maybe Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Maybe Integer
tisRedeemerConstr TxInputSummary
t
, Key
"redeemerKind" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Maybe Text
tisRedeemerKind TxInputSummary
t
, Key
"redeemerPayload" Key -> Maybe Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxInputSummary -> Maybe Value
tisRedeemerPayload TxInputSummary
t
]
instance ToJSON TxOutputSummary where
toJSON :: TxOutputSummary -> Value
toJSON TxOutputSummary
t =
[Pair] -> Value
object
[ Key
"utxo" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> Text
tosUtxo TxOutputSummary
t
, Key
"address" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> Text
tosAddress TxOutputSummary
t
, Key
"addressType" Key -> AddressType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> AddressType
tosAddressType TxOutputSummary
t
, Key
"addressLabel" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> Maybe Text
tosAddressLabel TxOutputSummary
t
, Key
"value" Key -> ValueSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> ValueSummary
tosValue TxOutputSummary
t
, Key
"datum" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= TxOutputSummary -> Maybe Text
tosDatum TxOutputSummary
t
]
instance ToJSON ThreatModelTrace where
toJSON :: ThreatModelTrace -> Value
toJSON ThreatModelTrace
t =
[Pair] -> Value
object
[ Key
"name" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> Text
tmtName ThreatModelTrace
t
, Key
"category" Key -> ThreatModelCategory -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> ThreatModelCategory
tmtCategory ThreatModelTrace
t
, Key
"testId" Key -> Int -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> Int
tmtTestId ThreatModelTrace
t
, Key
"targetTxIndex" Key -> Int -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> Int
tmtTargetTxIndex ThreatModelTrace
t
, Key
"modifications" Key -> [Value] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> [Value]
tmtModifications ThreatModelTrace
t
, Key
"originalTx" Key -> TxSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> TxSummary
tmtOriginalTx ThreatModelTrace
t
, Key
"modifiedTx" Key -> Maybe TxSummary -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> Maybe TxSummary
tmtModifiedTx ThreatModelTrace
t
, Key
"validation" Key -> Maybe ThreatModelValidation -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> Maybe ThreatModelValidation
tmtValidation ThreatModelTrace
t
, Key
"outcome" Key -> ThreatModelTraceOutcome -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ThreatModelTrace -> ThreatModelTraceOutcome
tmtOutcome ThreatModelTrace
t
, Key
"covered" Key -> [SrcLocRanges] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [SrcLocRange] -> [SrcLocRanges]
groupRanges (ThreatModelTrace -> [SrcLocRange]
tmtCovered ThreatModelTrace
t)
]
instance ToJSON ThreatModelTraceOutcome where
toJSON :: ThreatModelTraceOutcome -> Value
toJSON ThreatModelTraceOutcome
TMTOPassed =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"passed" :: Text)]
toJSON (TMTOFailed Text
reason) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"failed" :: Text), Key
"reason" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
reason]
toJSON (TMTOSkipped Text
reason) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"skipped" :: Text), Key
"reason" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
reason]
toJSON (TMTOSkippedPhase1 Text
reason) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"skipped_phase1" :: Text), Key
"reason" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
reason]
toJSON (TMTOError Text
msg) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"error" :: Text), Key
"message" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
msg]
instance ToJSON ThreatModelValidation where
toJSON :: ThreatModelValidation -> Value
toJSON ThreatModelValidation
TMVValid =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"valid" :: Text)]
toJSON (TMVPhase1Invalid [Text]
errs) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"phase1_invalid" :: Text), Key
"errors" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Text]
errs]
toJSON (TMVPhase2Invalid [Text]
errs) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"phase2_invalid" :: Text), Key
"errors" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Text]
errs]
toJSON (TMVRebalanceFailed Text
reason) =
[Pair] -> Value
object [Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= (Text
"rebalance_failed" :: Text), Key
"reason" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
reason]