Skip to content

Commit

Permalink
Update golden files to reflect new serialization
Browse files Browse the repository at this point in the history
Seems like cardano-api's serialiseToTextEnvelope is encoding a different
'type'. We are not using it for decoding anymore, but our golden files
need updating because of this. Both formats are according to our api schema.
  • Loading branch information
ch1bo committed Sep 9, 2024
1 parent 26393b3 commit f9ecd62
Show file tree
Hide file tree
Showing 15 changed files with 208 additions and 199 deletions.
102 changes: 51 additions & 51 deletions hydra-node/golden/ReasonablySized (ClientInput (Tx ConwayEra)).json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions hydra-node/golden/ReasonablySized (ServerOutput (Tx ConwayEra)).json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-node/golden/StateChanged/DecommitRecorded.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions hydra-node/golden/StateChanged/SnapshotRequested.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-node/golden/StateChanged/TransactionReceived.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion hydra-node/golden/StateEvent (Tx ConwayEra).json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion hydra-node/json-schemas/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1982,10 +1982,20 @@ components:
- cborHex
- description
- type
description: |
A Cardano transaction in the text envelope format . That is, a JSON
object wrapper with some 'type' around a 'cborHex' encoded transaction.
The hydra-node uses this format as follows:
- When encoding, an additonal 'txId' is included.
- On decoding, when 'txId' is included it is checked to be consistent.
- The 'type' is not used to determine content and any transaction is
tried to decode as a 'ConwayEra' transaction, which mostly is
backward compatible to previous eras.
properties:
type:
type: string
enum: ["Tx ConwayEra", "Unwitnessed Tx ConwayEra", "Witnessed Tx ConwayEra"]
enum: ["Tx ConwayEra"]
description:
type: string
cborHex:
Expand Down
10 changes: 5 additions & 5 deletions hydra-tx/golden/ReasonablySized (Tx ConwayEra).json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion hydra-tx/hydra-tx.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ library
, hydra-plutus-extras
, hydra-prelude
, lens
, lens-aeson
, ouroboros-consensus
, ouroboros-consensus-cardano
, plutus-core
Expand Down
2 changes: 1 addition & 1 deletion hydra-tx/src/Hydra/Tx/IsTx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type ArbitraryIsTx tx =

instance IsShelleyBasedEra era => ToJSON (Api.Tx era) where
toJSON tx =
case toJSON $ serialiseToTextEnvelope (Just "Hydra-encoded cardano-api Tx") tx of
case toJSON $ serialiseToTextEnvelope Nothing tx of
Aeson.Object km ->
Aeson.Object $ KeyMap.insert "txId" (toJSON $ getTxId $ getTxBody tx) km
v -> v
Expand Down

0 comments on commit f9ecd62

Please sign in to comment.