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

Update the Utxo schema to be an object #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions cardano.json
Original file line number Diff line number Diff line change
Expand Up @@ -1881,17 +1881,16 @@

, "Utxo":
Copy link
Member

Choose a reason for hiding this comment

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

As a side-note, this definition should probably not even be here. This is not used anywhere in the Cardano schema actually. It is used in a few places in Ogmios but that's not so-to-speak needed to capture Cardano's on entities (as weird as it may sound).

{ "title": "Utxo"
, "type": "array"
, "additionalItems": false
, "items":
{ "type": "array"
, "additionalItems": false
, "minItems": 2
, "maxItems": 2
, "items":
[ { "$ref": "cardano.json#/definitions/TransactionOutputReference" }
, { "$ref": "cardano.json#/definitions/TransactionOutput" }
]
, "type": "object"
, "propertyNames":
{ "pattern": "^[0-9a-f]{64}#[0-9]+$" }
Copy link
Member

Choose a reason for hiding this comment

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

This kind of key encoding multiple information at once has shown to be quite difficult to parse for clients down the line so that is something I've been trying to avoid in the schema.

Copy link
Member

Choose a reason for hiding this comment

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

Also, if changed here, it should be changed consistently across all occurrences of TransactionOutputReference which then becomes a little awkward.

, "items": { "$ref": "cardano.json#/definitions/TransactionOutput" }
, "example":
{ "09d34606abdcd0b10ebc89307cbfa0b469f9144194137b45b7a04b273961add8#687":
{ "address": "addr1w9htvds89a78ex2uls5y969ttry9s3k9etww0staxzndwlgmzuul5"
, "value":
{ "lovelace": 7620669 }
}
}
}

Expand Down