Skip to content

Commit

Permalink
ToJSON Tx: add "type" field
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Jan 17, 2024
1 parent be48a81 commit bbbe559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hydra-node/src/Hydra/Ledger/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ instance FromCBOR Tx where

instance ToJSON Tx where
toJSON tx =
let TextEnvelopeType envelopeType = textEnvelopeType (proxyToAsType (Proxy @Tx))
in
object
[ "cborHex" .= (Aeson.String $ decodeUtf8 $ Base16.encode $ serialiseToCBOR tx)
, "txId" .= (txId tx)
, "type" .= envelopeType
]

instance FromJSON Tx where
Expand Down

0 comments on commit bbbe559

Please sign in to comment.