Skip to content

Commit

Permalink
FIX json schema and stick to UTxO case standard
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrange committed Oct 5, 2022
1 parent 99f60da commit 658efbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions hydra-node/json-schemas/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,11 @@ components:
type: object
additionalProperties: false
required:
- snapshot
- initialUTxO
- tag
properties:
snapshot:
$ref: "#/components/schemas/Snapshot"
initialUTxO:
$ref: "#/components/schemas/UTxO"
tag:
type: string
enum: ["InitialSnapshot"]
Expand Down
2 changes: 1 addition & 1 deletion hydra-node/src/Hydra/Chain/Direct/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ genStClosed ctx utxo = do
let (sn, snapshot, toFanout) = case confirmed of
InitialSnapshot{} ->
( 0
, InitialSnapshot {initialUtxo = u0}
, InitialSnapshot {initialUTxO = u0}
, u0
)
ConfirmedSnapshot{snapshot = snap, signatures} ->
Expand Down
6 changes: 3 additions & 3 deletions hydra-node/src/Hydra/Snapshot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ instance (FromCBOR tx, FromCBOR (UTxOType tx)) => FromCBOR (Snapshot tx) where

-- | A snapshot that can be used to close a head with. Either the initial one, or when it was signed by all parties, i.e. it is confirmed.
data ConfirmedSnapshot tx
= InitialSnapshot { initialUtxo :: UTxOType tx }
= InitialSnapshot { initialUTxO :: UTxOType tx }
| ConfirmedSnapshot
{ snapshot :: Snapshot tx
, signatures :: MultiSignature (Snapshot tx)
Expand All @@ -86,10 +86,10 @@ data ConfirmedSnapshot tx
-- | Safely get a 'Snapshot' from a confirmed snapshot.
getSnapshot :: ConfirmedSnapshot tx -> Snapshot tx
getSnapshot = \case
InitialSnapshot{initialUtxo} ->
InitialSnapshot{initialUTxO} ->
Snapshot
{ number = 0
, utxo = initialUtxo
, utxo = initialUTxO
, confirmed = []
}
ConfirmedSnapshot{snapshot} -> snapshot
Expand Down

0 comments on commit 658efbd

Please sign in to comment.