Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Signers and Signatures fields to txdetail view #79

Merged
merged 7 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deps/chainweb-api/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "chainweb-api",
"branch": "master",
"private": false,
"rev": "c35b5709f562dec211bc02db8f0dac985fb06d56",
"sha256": "1f3jf839iav5pimcz2zc1g01sjlw00q6dfhx98q42bspxixp2d8k"
"rev": "00650534d4b3065342207a732131c88519209177",
"sha256": "0lmrk9plhp4x8g1xczs4f8hld9arglvfsvbkcj9xf82sjs3cj3sm"
}
49 changes: 26 additions & 23 deletions frontend/src/Frontend/Page/TxDetail.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{-# LANGUAGE TypeFamilies #-}
module Frontend.Page.TxDetail where

import Control.Applicative
import Control.Monad
import Control.Monad.Reader
import Control.Lens (iforM_)
Expand All @@ -29,6 +30,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

Expand Down Expand Up @@ -165,29 +168,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
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
elClass "table" "ui celled table" $ do
el "thead" $ do
el "tr" $ do
el "th" $ text "Name"
el "th" $ text "Arguments"
enobayram marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down