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 Verifiers to cw-data #188

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/kadena-io/chainweb-api.git
tag: 1b2de025cfdc09698bfb1ec3807cd85405d6a339
--sha256: sha256-06jvD1kmkmthcRkyWhVLTbytwabghInxqXQD/Lm7kbA=
tag: b7eb7ffc3d6da99afe194205631a8f052308b7f4
--sha256: sha256-8Eamd+POoA8qEWJJZ2BPMDjlfVMvbBzOHXZP3QX8eEQ=

source-repository-package
type: git
Expand Down
1 change: 1 addition & 0 deletions haskell-src/exec/Chainweb/Lookups.hs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ mkTransaction b (tx,txo) = Transaction
, _tx_continuation = PgJSONB <$> _toutContinuation txo
, _tx_txid = fromIntegral <$> _toutTxId txo
, _tx_numEvents = Just $ fromIntegral $ length $ _toutEvents txo
, _tx_verifiers = PgJSONB <$> tx ^? to (CW._transaction_cmdStr) . key "verifiers"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really where the verifiers field appears?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests I've added answer this question.

}
where
cmd = CW._transaction_cmd tx
Expand Down
1 change: 1 addition & 0 deletions haskell-src/exec/Chainweb/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ toApiTxDetail tx contHist blk evs signers sigs = TxDetail
, _txDetail_previousSteps = V.toList (chSteps contHist) <$ chCode contHist
, _txDetail_signers = signers
, _txDetail_sigs = sigs
, _txDetail_verifiers = unPgJsonb <$> _tx_verifiers tx
}
where
unMaybeValue = maybe Null unPgJsonb
Expand Down
1 change: 1 addition & 0 deletions haskell-src/lib/ChainwebDb/Types/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ data TransactionT f = Transaction
, _tx_continuation :: C f (Maybe (PgJSONB Value))
, _tx_txid :: C f (Maybe Int64)
, _tx_numEvents :: C f (Maybe Int64)
, _tx_verifiers :: C f (Maybe (PgJSONB Value))
}
deriving stock (Generic)
deriving anyclass (Beamable)
Expand Down
Loading