Skip to content

Commit

Permalink
Fix several schemas in api.yaml and logs.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jan 10, 2024
1 parent aea2714 commit a96a284
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion hydra-node/json-schemas/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ components:
tag:
type: string
enum: ["InvalidHeadId"]
headSeed:
headId:
$ref: "api.yaml#/components/schemas/HeadId"
- title: FailedToConstructAbortTx
description: |
Expand Down
28 changes: 17 additions & 11 deletions hydra-node/json-schemas/logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1732,30 +1732,27 @@ definitions:
additionalProperties: false
required:
- tag
- contestationPeriod
- parties
- headId
- headSeed
- headParameters
- participants
description: >-
The initial transaction of the Head, announcing various parameters and
the parties, has been posted on-chain.
properties:
tag:
type: string
enum: ["OnInitTx"]
contestationPeriod:
type: number
description: >-
The length of the contestaion period, in seconds, represented as a
decimal number.
parties:
type: array
items:
$ref: "api.yaml#/components/schemas/Party"
headId:
$ref: "api.yaml#/components/schemas/HeadId"
headSeed:
$ref: "api.yaml#/components/schemas/HeadSeed"
headParameters:
$ref: "api.yaml#/components/schemas/HeadParameters"
participants:
type: array
items:
$ref: "api.yaml#/components/schemas/OnChainId"
- title: OnCommitTx
type: object
additionalProperties: false
Expand Down Expand Up @@ -1806,12 +1803,15 @@ definitions:
additionalProperties: false
required:
- tag
- headId
- snapshotNumber
- contestationDeadline
properties:
tag:
type: string
enum: ["OnCloseTx"]
headId:
$ref: "api.yaml#/components/schemas/HeadId"
snapshotNumber:
type: integer
minimum: 0
Expand All @@ -1822,11 +1822,14 @@ definitions:
additionalProperties: false
required:
- tag
- headId
- snapshotNumber
properties:
tag:
type: string
enum: ["OnContestTx"]
headId:
$ref: "api.yaml#/components/schemas/HeadId"
snapshotNumber:
type: integer
minimum: 0
Expand All @@ -1835,10 +1838,13 @@ definitions:
additionalProperties: false
required:
- tag
- headId
properties:
tag:
type: string
enum: ["OnFanoutTx"]
headId:
$ref: "api.yaml#/components/schemas/HeadId"

Effect:
description: >-
Expand Down
11 changes: 9 additions & 2 deletions hydra-node/src/Hydra/Chain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,22 @@ data OnChainTx tx
, headParameters :: HeadParameters
, participants :: [OnChainId]
}
| OnCommitTx {headId :: HeadId, party :: Party, committed :: UTxOType tx}
| OnCommitTx
{ headId :: HeadId
, party :: Party
, committed :: UTxOType tx
}
| OnAbortTx {headId :: HeadId}
| OnCollectComTx {headId :: HeadId}
| OnCloseTx
{ headId :: HeadId
, snapshotNumber :: SnapshotNumber
, contestationDeadline :: UTCTime
}
| OnContestTx {headId :: HeadId, snapshotNumber :: SnapshotNumber}
| OnContestTx
{ headId :: HeadId
, snapshotNumber :: SnapshotNumber
}
| OnFanoutTx {headId :: HeadId}
deriving stock (Generic)

Expand Down

0 comments on commit a96a284

Please sign in to comment.