{-# LANGUAGE OverloadedStrings #-}
module Cometa.Transaction.Inspection
( transaction,
subTransaction,
body,
subBody,
)
where
import Cometa.Error (Error)
import qualified Cometa.Internal.Inspection as Inspection
import qualified Cometa.SubTransaction as Sub
import qualified Cometa.SubTransaction.Body as SubBody
import qualified Cometa.Transaction as Tx
import qualified Cometa.Transaction.Body as Body
import Data.Aeson (Value)
transaction :: Tx.Transaction -> IO (Either Error Value)
transaction :: Transaction -> IO (Either Error Value)
transaction = Text -> CUInt -> ByteString -> IO (Either Error Value)
Inspection.inspect Text
"inspection.transaction" CUInt
0 (ByteString -> IO (Either Error Value))
-> (Transaction -> ByteString)
-> Transaction
-> IO (Either Error Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Transaction -> ByteString
Tx.encodeCbor
subTransaction :: Sub.SubTransaction -> IO (Either Error Value)
subTransaction :: SubTransaction -> IO (Either Error Value)
subTransaction = Text -> CUInt -> ByteString -> IO (Either Error Value)
Inspection.inspect Text
"inspection.subTransaction" CUInt
1 (ByteString -> IO (Either Error Value))
-> (SubTransaction -> ByteString)
-> SubTransaction
-> IO (Either Error Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SubTransaction -> ByteString
Sub.encodeCbor
body :: Body.EncodedBody -> IO (Either Error Value)
body :: EncodedBody -> IO (Either Error Value)
body = Text -> CUInt -> ByteString -> IO (Either Error Value)
Inspection.inspect Text
"inspection.body" CUInt
2 (ByteString -> IO (Either Error Value))
-> (EncodedBody -> ByteString)
-> EncodedBody
-> IO (Either Error Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EncodedBody -> ByteString
Body.toCbor
subBody :: SubBody.EncodedBody -> IO (Either Error Value)
subBody :: EncodedBody -> IO (Either Error Value)
subBody = Text -> CUInt -> ByteString -> IO (Either Error Value)
Inspection.inspect Text
"inspection.subBody" CUInt
3 (ByteString -> IO (Either Error Value))
-> (EncodedBody -> ByteString)
-> EncodedBody
-> IO (Either Error Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EncodedBody -> ByteString
SubBody.toCbor