From d0c8e89e9ec732e5015fa06f5783a977e6c6c3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Fri, 21 Jul 2023 15:04:26 +0200 Subject: [PATCH 1/7] Add Signers and Signatures fields to txdetail view --- deps/chainweb-api/github.json | 4 +-- frontend/src/Frontend/Page/TxDetail.hs | 50 ++++++++++++++------------ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/deps/chainweb-api/github.json b/deps/chainweb-api/github.json index bdb6c2d..1273a71 100644 --- a/deps/chainweb-api/github.json +++ b/deps/chainweb-api/github.json @@ -3,6 +3,6 @@ "repo": "chainweb-api", "branch": "master", "private": false, - "rev": "c35b5709f562dec211bc02db8f0dac985fb06d56", - "sha256": "1f3jf839iav5pimcz2zc1g01sjlw00q6dfhx98q42bspxixp2d8k" + "rev": "00650534d4b3065342207a732131c88519209177", + "sha256": "0lmrk9plhp4x8g1xczs4f8hld9arglvfsvbkcj9xf82sjs3cj3sm" } diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index 32972f2..fbd700f 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -12,10 +12,12 @@ {-# LANGUAGE TypeFamilies #-} module Frontend.Page.TxDetail where +import Control.Applicative import Control.Monad import Control.Monad.Reader import Control.Lens (iforM_) import Data.Aeson as A +import Data.Maybe (fromMaybe) import qualified Data.Text as T import GHCJS.DOM.Types (MonadJSM) import Obelisk.Route @@ -29,6 +31,8 @@ import Pact.Types.Continuation (PactExec(..)) import Chainweb.Api.BlockHeader import Chainweb.Api.ChainId import Chainweb.Api.Hash +import Chainweb.Api.Signer +import Chainweb.Api.Sig import ChainwebData.Api import ChainwebData.TxDetail @@ -165,29 +169,29 @@ txDetailPage nc netId cwVer txDetails = do tfield "Creation Time" $ text $ tshow $ (_txDetail_creationTime $ head txDetails) - -- tfield "Signers" $ do - -- forM_ (_pactCommand_signers cmd) $ \s -> do - -- elClass "table" "ui definition table" $ el "tbody" $ do - -- tfield "Public Key" $ text $ _signer_pubKey s - -- tfield "Account" $ text $ fromMaybe "" $ _signer_addr s - -- tfield "Scheme" $ text $ fromMaybe "" $ _signer_scheme s - -- tfield "Signature Capabilites" $ do - -- when (not $ null $ _signer_capList s) $ do - -- elClass "table" "ui celled table" $ do - -- el "thead" $ do - -- el "tr" $ do - -- el "th" $ text "Name" - -- el "th" $ text "Arguments" - -- forM_ (_signer_capList s) $ \c -> do - -- el "tbody" $ do - -- elClass "tr" "top aligned" $ do - -- el "td" $ text $ _scName c - -- elClass "td" "top aligned" - -- $ sequence - -- $ fmap (el "div" . text) (unwrapJSON <$> _scArgs c) <|> empty - -- tfield "Signatures" $ do - -- forM_ (_transaction_sigs t) $ \s -> do - -- el "div" $ text $ unSig s + tfield "Signers" $ do + forM_ (_txDetail_signers $ head txDetails) $ \s -> do + elClass "table" "ui definition table" $ el "tbody" $ do + tfield "Public Key" $ text $ _signer_pubKey s + tfield "Account" $ text $ fromMaybe "" $ _signer_addr s + tfield "Scheme" $ text $ fromMaybe "" $ _signer_scheme s + tfield "Signature Capabilites" $ do + when (not $ null $ _signer_capList s) $ do + elClass "table" "ui celled table" $ do + el "thead" $ do + el "tr" $ do + el "th" $ text "Name" + el "th" $ text "Arguments" + forM_ (_signer_capList s) $ \c -> do + el "tbody" $ do + elClass "tr" "top aligned" $ do + el "td" $ text $ _scName c + elClass "td" "top aligned" + $ sequence + $ fmap (el "div" . text) (unwrapJSON <$> _scArgs c) <|> empty + tfield "Signatures" $ do + forM_ (_txDetail_sigs $ head txDetails) $ \s -> do + el "div" $ text $ unSig s where renderCont v res = case fromJSON v of Success (pe :: PactExec) -> renderPactExec pe netId res From dd556d3a662559525e0a48e462910a792ba8de98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Fri, 21 Jul 2023 17:27:18 +0200 Subject: [PATCH 2/7] Remove Account and Scheme fields if they're empty --- frontend/src/Frontend/Page/TxDetail.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index fbd700f..c605b2d 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -17,7 +17,6 @@ import Control.Monad import Control.Monad.Reader import Control.Lens (iforM_) import Data.Aeson as A -import Data.Maybe (fromMaybe) import qualified Data.Text as T import GHCJS.DOM.Types (MonadJSM) import Obelisk.Route @@ -173,8 +172,8 @@ txDetailPage nc netId cwVer txDetails = do forM_ (_txDetail_signers $ head txDetails) $ \s -> do elClass "table" "ui definition table" $ el "tbody" $ do tfield "Public Key" $ text $ _signer_pubKey s - tfield "Account" $ text $ fromMaybe "" $ _signer_addr s - tfield "Scheme" $ text $ fromMaybe "" $ _signer_scheme s + forM_ (_signer_addr s) $ tfield "Account" . text + forM_ (_signer_scheme s) $ tfield "Scheme" . text tfield "Signature Capabilites" $ do when (not $ null $ _signer_capList s) $ do elClass "table" "ui celled table" $ do From cfb6f1237b9c287f15249c5be9d37f4ca73cce03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Fri, 21 Jul 2023 17:27:29 +0200 Subject: [PATCH 3/7] Rename Account field to Address --- frontend/src/Frontend/Page/TxDetail.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index c605b2d..68858d8 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -172,7 +172,7 @@ txDetailPage nc netId cwVer txDetails = do forM_ (_txDetail_signers $ head txDetails) $ \s -> do elClass "table" "ui definition table" $ el "tbody" $ do tfield "Public Key" $ text $ _signer_pubKey s - forM_ (_signer_addr s) $ tfield "Account" . text + forM_ (_signer_addr s) $ tfield "Address" . text forM_ (_signer_scheme s) $ tfield "Scheme" . text tfield "Signature Capabilites" $ do when (not $ null $ _signer_capList s) $ do From ddae7c7ddf719b7c4f064b6f9519538227101c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Mon, 31 Jul 2023 19:30:06 +0200 Subject: [PATCH 4/7] Separate the args of sig capabilities --- frontend/src/Frontend/Page/TxDetail.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index 68858d8..c597c9d 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -12,7 +12,6 @@ {-# LANGUAGE TypeFamilies #-} module Frontend.Page.TxDetail where -import Control.Applicative import Control.Monad import Control.Monad.Reader import Control.Lens (iforM_) @@ -174,20 +173,20 @@ txDetailPage nc netId cwVer txDetails = do tfield "Public Key" $ text $ _signer_pubKey s forM_ (_signer_addr s) $ tfield "Address" . text forM_ (_signer_scheme s) $ tfield "Scheme" . text - tfield "Signature Capabilites" $ do + tfield "Signature Capabilities" $ do when (not $ null $ _signer_capList s) $ do elClass "table" "ui celled table" $ do el "thead" $ do el "tr" $ do el "th" $ text "Name" el "th" $ text "Arguments" - forM_ (_signer_capList s) $ \c -> do - el "tbody" $ do - elClass "tr" "top aligned" $ do - el "td" $ text $ _scName c - elClass "td" "top aligned" - $ sequence - $ fmap (el "div" . text) (unwrapJSON <$> _scArgs c) <|> empty + + el "tbody" $ + forM_ (_signer_capList s) $ \c -> el "tr" $ do + el "td" $ text $ _scName c + elClass "td" "evtd" $ elClass "table" "evtable" $ + forM_ (_scArgs c) $ \arg -> elClass "tr" "evtable" $ + elClass "td" "evtable" $ text $ unwrapJSON arg tfield "Signatures" $ do forM_ (_txDetail_sigs $ head txDetails) $ \s -> do el "div" $ text $ unSig s From 0a04858bd0fd63655c4c14ac72455c728d304ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Mon, 31 Jul 2023 19:50:14 +0200 Subject: [PATCH 5/7] Let txDetailPage accept a NonEmpty list --- frontend/src/Frontend/Page/TxDetail.hs | 66 +++++++++++++------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index c597c9d..2290557 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -16,6 +16,8 @@ import Control.Monad import Control.Monad.Reader import Control.Lens (iforM_) import Data.Aeson as A +import Data.Functor ((<&>)) +import qualified Data.List.NonEmpty as NE import qualified Data.Text as T import GHCJS.DOM.Types (MonadJSM) import Obelisk.Route @@ -65,11 +67,11 @@ txDetailWidget netId = do res <- getTxDetails nc (QParamSome . RequestKey <$> reqKey) (leftmost [pb, () <$ updated reqKey]) - void - $ networkHold (inlineLoader "Querying blockchain ...") - $ fmap (either text (txDetailPage nc netId (_siChainwebVer si))) res - - + void $ networkHold (inlineLoader "Querying blockchain ...") $ res <&> \case + Left err -> text $ "Error fetching transactions: " <> err + Right txDetails -> case NE.nonEmpty txDetails of + Nothing -> text "No transaction found" + Just neTxDetails -> txDetailPage nc netId (_siChainwebVer si) neTxDetails txDetailPage :: ( MonadApp r t m @@ -82,16 +84,16 @@ txDetailPage => NetConfig -> NetId -> ChainwebVersion - -> [TxDetail] + -> NE.NonEmpty TxDetail -> m () -txDetailPage nc netId cwVer txDetails = do +txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do el "h2" $ text $ "Transaction Detail" elClass "table" "ui definition table" $ do el "tbody" $ do - tfield "Request Key" $ text (_txDetail_requestKey $ head txDetails) - tfield "Chain" $ text $ tshow $ (_txDetail_chain $ head txDetails) + tfield "Request Key" $ text (_txDetail_requestKey $ firstDetail) + tfield "Chain" $ text $ tshow $ (_txDetail_chain $ firstDetail) tfield "Block" $ do - let tagIfOrphan cid height hash = if null $ drop 1 txDetails + let tagIfOrphan cid height hash = if null restDetail then dynText $ constDyn mempty else do let h = ChainwebHost (netHost netId) cwVer @@ -102,11 +104,11 @@ txDetailPage nc netId cwVer txDetails = do forM_ txDetails $ \tx -> el "tr" $ do blockHashLink netId (ChainId (_txDetail_chain tx)) (_txDetail_blockHash tx) $ (_txDetail_blockHash tx) tagIfOrphan (ChainId $ _txDetail_chain tx) (_txDetail_height tx) (_txDetail_blockHash tx) - tfield "Code" $ case (_txDetail_code $ head txDetails) of + tfield "Code" $ case _txDetail_code firstDetail of Just c -> elAttr "pre" ("style" =: "white-space: pre-wrap;") $ text c Nothing -> do - let previousSteps = _txDetail_previousSteps $ head txDetails - initialCode = _txDetail_initialCode $ head txDetails + let previousSteps = _txDetail_previousSteps firstDetail + initialCode = _txDetail_initialCode firstDetail mkTxDetailRoute rk = mkNetRoute netId (NetRoute_TxDetail :/ rk) txDetailLink rk = do text "Continuation of " @@ -122,18 +124,18 @@ txDetailPage nc netId cwVer txDetails = do forM_ initialCode $ \c -> tfield "Initial Code" $ elAttr "pre" ("style" =: "white-space: pre-wrap;") $ text c tfield "Transaction Output" $ do elClass "table" "ui definition table" $ el "tbody" $ do - tfield "Gas" $ text $ tshow $ (_txDetail_gas $ head txDetails) + tfield "Gas" $ text $ tshow $ _txDetail_gas firstDetail tfield "Result" $ do - if (_txDetail_success $ head txDetails) then + if _txDetail_success firstDetail then elAttr "i" ("class" =: "green check icon" <> "title" =: "Succeeded") blank else elAttr "i" ("class" =: "red close icon" <> "title" =: "Failed") blank - text $ pactValueJSON (_txDetail_result $ head txDetails) - tfield "Logs" $ text (_txDetail_logs $ head txDetails) - tfield "Metadata" $ renderMetaData netId (ChainId (_txDetail_chain $ head txDetails)) (Just (_txDetail_metadata $ head txDetails)) + text $ pactValueJSON $ _txDetail_result firstDetail + tfield "Logs" $ text $ _txDetail_logs firstDetail + tfield "Metadata" $ renderMetaData netId (ChainId $ _txDetail_chain firstDetail) (Just $ _txDetail_metadata firstDetail) tfield "Continuation" $ do pb <- getPostBuild - let cont = _txDetail_continuation $ head txDetails + let cont = _txDetail_continuation firstDetail let ditchPartialResult = \case Left t -> Left t Right (False,_) -> Left "A partial response is impossible!" @@ -143,32 +145,32 @@ txDetailPage nc netId cwVer txDetails = do (constDyn Nothing) (constDyn Nothing) (constDyn QNone) - (constDyn (QParamSome $ _txDetail_requestKey $ head txDetails)) + (constDyn (QParamSome $ _txDetail_requestKey firstDetail)) (constDyn QNone) (constDyn QNone) pb widgetHold_ (inlineLoader "Querying continuation info...") (renderCont c . ditchPartialResult <$> res) - tfield "Transaction ID" $ text $ tshow (_txDetail_txid $ head txDetails) + tfield "Transaction ID" $ text $ tshow $ _txDetail_txid firstDetail tfield "Events" $ elClass "table" "ui definition table" $ el "tbody" $ - forM_ (_txDetail_events $ head txDetails) $ \ ev -> el "tr" $ do + forM_ (_txDetail_events firstDetail) $ \ ev -> el "tr" $ do elClass "td" "two wide" $ text (_txEvent_name ev) elClass "td" "evtd" $ elClass "table" "evtable" $ forM_ (_txEvent_params ev) $ \v -> elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ pactValueJSON v - tfieldPre "Data" $ text $ prettyJSON (_txDetail_data $ head txDetails) - tfield "Nonce" $ text $ (_txDetail_nonce $ head txDetails) + tfieldPre "Data" $ text $ prettyJSON $ _txDetail_data firstDetail + tfield "Nonce" $ text $ _txDetail_nonce firstDetail tfield "Meta" $ do elClass "table" "ui definition table" $ el "tbody" $ do - tfield "Chain" $ text $ tshow $ (_txDetail_chain $ head txDetails) - tfield "Sender" $ text $ (_txDetail_sender $ head txDetails) - tfield "Gas Price" $ text $ tshow $ (_txDetail_gasPrice $ head txDetails) - tfield "Gas Limit" $ text $ tshow $ (_txDetail_gasLimit $ head txDetails) - tfield "TTL" $ text $ tshow $ (_txDetail_ttl $ head txDetails) - tfield "Creation Time" $ text $ tshow $ (_txDetail_creationTime $ head txDetails) + tfield "Chain" $ text $ tshow $ _txDetail_chain firstDetail + tfield "Sender" $ text $ _txDetail_sender firstDetail + tfield "Gas Price" $ text $ tshow $ _txDetail_gasPrice firstDetail + tfield "Gas Limit" $ text $ tshow $ _txDetail_gasLimit firstDetail + tfield "TTL" $ text $ tshow $ _txDetail_ttl firstDetail + tfield "Creation Time" $ text $ tshow $ _txDetail_creationTime firstDetail tfield "Signers" $ do - forM_ (_txDetail_signers $ head txDetails) $ \s -> do + forM_ (_txDetail_signers firstDetail) $ \s -> do elClass "table" "ui definition table" $ el "tbody" $ do tfield "Public Key" $ text $ _signer_pubKey s forM_ (_signer_addr s) $ tfield "Address" . text @@ -188,7 +190,7 @@ txDetailPage nc netId cwVer txDetails = do forM_ (_scArgs c) $ \arg -> elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ unwrapJSON arg tfield "Signatures" $ do - forM_ (_txDetail_sigs $ head txDetails) $ \s -> do + forM_ (_txDetail_sigs firstDetail) $ \s -> do el "div" $ text $ unSig s where renderCont v res = case fromJSON v of From 2bab7096e171606963867f2bddb1a77626413ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Tue, 1 Aug 2023 09:00:14 +0200 Subject: [PATCH 6/7] Rename txDetails --- frontend/src/Frontend/Page/TxDetail.hs | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index 2290557..078a4a7 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -86,14 +86,14 @@ txDetailPage -> ChainwebVersion -> NE.NonEmpty TxDetail -> m () -txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do +txDetailPage nc netId cwVer txs@(firstTx NE.:| restTxs) = do el "h2" $ text $ "Transaction Detail" elClass "table" "ui definition table" $ do el "tbody" $ do - tfield "Request Key" $ text (_txDetail_requestKey $ firstDetail) - tfield "Chain" $ text $ tshow $ (_txDetail_chain $ firstDetail) + tfield "Request Key" $ text (_txDetail_requestKey $ firstTx) + tfield "Chain" $ text $ tshow $ (_txDetail_chain $ firstTx) tfield "Block" $ do - let tagIfOrphan cid height hash = if null restDetail + let tagIfOrphan cid height hash = if null restTxs then dynText $ constDyn mempty else do let h = ChainwebHost (netHost netId) cwVer @@ -101,14 +101,14 @@ txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do t <- holdDyn " (Determining if an orphan...)" $ fmap (\whash -> if whash == hash then "" else " (orphan)") (fforMaybe winningHash (fmap hashB64U)) dynText t - forM_ txDetails $ \tx -> el "tr" $ do + forM_ txs $ \tx -> el "tr" $ do blockHashLink netId (ChainId (_txDetail_chain tx)) (_txDetail_blockHash tx) $ (_txDetail_blockHash tx) tagIfOrphan (ChainId $ _txDetail_chain tx) (_txDetail_height tx) (_txDetail_blockHash tx) - tfield "Code" $ case _txDetail_code firstDetail of + tfield "Code" $ case _txDetail_code firstTx of Just c -> elAttr "pre" ("style" =: "white-space: pre-wrap;") $ text c Nothing -> do - let previousSteps = _txDetail_previousSteps firstDetail - initialCode = _txDetail_initialCode firstDetail + let previousSteps = _txDetail_previousSteps firstTx + initialCode = _txDetail_initialCode firstTx mkTxDetailRoute rk = mkNetRoute netId (NetRoute_TxDetail :/ rk) txDetailLink rk = do text "Continuation of " @@ -124,18 +124,18 @@ txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do forM_ initialCode $ \c -> tfield "Initial Code" $ elAttr "pre" ("style" =: "white-space: pre-wrap;") $ text c tfield "Transaction Output" $ do elClass "table" "ui definition table" $ el "tbody" $ do - tfield "Gas" $ text $ tshow $ _txDetail_gas firstDetail + tfield "Gas" $ text $ tshow $ _txDetail_gas firstTx tfield "Result" $ do - if _txDetail_success firstDetail then + if _txDetail_success firstTx then elAttr "i" ("class" =: "green check icon" <> "title" =: "Succeeded") blank else elAttr "i" ("class" =: "red close icon" <> "title" =: "Failed") blank - text $ pactValueJSON $ _txDetail_result firstDetail - tfield "Logs" $ text $ _txDetail_logs firstDetail - tfield "Metadata" $ renderMetaData netId (ChainId $ _txDetail_chain firstDetail) (Just $ _txDetail_metadata firstDetail) + text $ pactValueJSON $ _txDetail_result firstTx + tfield "Logs" $ text $ _txDetail_logs firstTx + tfield "Metadata" $ renderMetaData netId (ChainId $ _txDetail_chain firstTx) (Just $ _txDetail_metadata firstTx) tfield "Continuation" $ do pb <- getPostBuild - let cont = _txDetail_continuation firstDetail + let cont = _txDetail_continuation firstTx let ditchPartialResult = \case Left t -> Left t Right (False,_) -> Left "A partial response is impossible!" @@ -145,32 +145,32 @@ txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do (constDyn Nothing) (constDyn Nothing) (constDyn QNone) - (constDyn (QParamSome $ _txDetail_requestKey firstDetail)) + (constDyn (QParamSome $ _txDetail_requestKey firstTx)) (constDyn QNone) (constDyn QNone) pb widgetHold_ (inlineLoader "Querying continuation info...") (renderCont c . ditchPartialResult <$> res) - tfield "Transaction ID" $ text $ tshow $ _txDetail_txid firstDetail + tfield "Transaction ID" $ text $ tshow $ _txDetail_txid firstTx tfield "Events" $ elClass "table" "ui definition table" $ el "tbody" $ - forM_ (_txDetail_events firstDetail) $ \ ev -> el "tr" $ do + forM_ (_txDetail_events firstTx) $ \ ev -> el "tr" $ do elClass "td" "two wide" $ text (_txEvent_name ev) elClass "td" "evtd" $ elClass "table" "evtable" $ forM_ (_txEvent_params ev) $ \v -> elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ pactValueJSON v - tfieldPre "Data" $ text $ prettyJSON $ _txDetail_data firstDetail - tfield "Nonce" $ text $ _txDetail_nonce firstDetail + tfieldPre "Data" $ text $ prettyJSON $ _txDetail_data firstTx + tfield "Nonce" $ text $ _txDetail_nonce firstTx tfield "Meta" $ do elClass "table" "ui definition table" $ el "tbody" $ do - tfield "Chain" $ text $ tshow $ _txDetail_chain firstDetail - tfield "Sender" $ text $ _txDetail_sender firstDetail - tfield "Gas Price" $ text $ tshow $ _txDetail_gasPrice firstDetail - tfield "Gas Limit" $ text $ tshow $ _txDetail_gasLimit firstDetail - tfield "TTL" $ text $ tshow $ _txDetail_ttl firstDetail - tfield "Creation Time" $ text $ tshow $ _txDetail_creationTime firstDetail + tfield "Chain" $ text $ tshow $ _txDetail_chain firstTx + tfield "Sender" $ text $ _txDetail_sender firstTx + tfield "Gas Price" $ text $ tshow $ _txDetail_gasPrice firstTx + tfield "Gas Limit" $ text $ tshow $ _txDetail_gasLimit firstTx + tfield "TTL" $ text $ tshow $ _txDetail_ttl firstTx + tfield "Creation Time" $ text $ tshow $ _txDetail_creationTime firstTx tfield "Signers" $ do - forM_ (_txDetail_signers firstDetail) $ \s -> do + forM_ (_txDetail_signers firstTx) $ \s -> do elClass "table" "ui definition table" $ el "tbody" $ do tfield "Public Key" $ text $ _signer_pubKey s forM_ (_signer_addr s) $ tfield "Address" . text @@ -190,7 +190,7 @@ txDetailPage nc netId cwVer txDetails@(firstDetail NE.:| restDetail) = do forM_ (_scArgs c) $ \arg -> elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ unwrapJSON arg tfield "Signatures" $ do - forM_ (_txDetail_sigs firstDetail) $ \s -> do + forM_ (_txDetail_sigs firstTx) $ \s -> do el "div" $ text $ unSig s where renderCont v res = case fromJSON v of From 176d3d063f2abc6e11dd682cea7a0f43336eb429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Tue, 1 Aug 2023 09:04:54 +0200 Subject: [PATCH 7/7] Add separators to signatures --- frontend/src/Frontend/Page/TxDetail.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/Frontend/Page/TxDetail.hs b/frontend/src/Frontend/Page/TxDetail.hs index 078a4a7..d945abe 100644 --- a/frontend/src/Frontend/Page/TxDetail.hs +++ b/frontend/src/Frontend/Page/TxDetail.hs @@ -190,8 +190,9 @@ txDetailPage nc netId cwVer txs@(firstTx NE.:| restTxs) = do forM_ (_scArgs c) $ \arg -> elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ unwrapJSON arg tfield "Signatures" $ do - forM_ (_txDetail_sigs firstTx) $ \s -> do - el "div" $ text $ unSig s + elClass "table" "evtable" $ + forM_ (_txDetail_sigs firstTx) $ \s -> + elClass "tr" "evtable" $ elClass "td" "evtable" $ text $ unSig s where renderCont v res = case fromJSON v of Success (pe :: PactExec) -> renderPactExec pe netId res