-
Notifications
You must be signed in to change notification settings - Fork 158
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
serialization for ShelleyGenesis #1927
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
example :: ShelleyGenesis C | ||
example = exampleShelleyGenesis | ||
|
||
b16 = "83a50081824a9db8a41713ad20245f4e00018182510075c40f44e1c155bedab80d3ec7c2190b0a02185e030a05a149e0dab80d3ec7c2190b1864a10082824873ed39075e40d2a6507b208423b1e15f5173ed39075e40d2a682489ac25c873e2248cc507b208423b1e15f519ac25c873e2248ccf6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but good luck finding out what changed when it fails 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, that's true. Perhaps we should compare the cbor tokens instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do something fancy in consensus: we store the bytes in a file, but convert to CBOR in case of a mismatch. We also deal with nested CBOR and actually return a diff of the CBOR. See https://github.com/input-output-hk/ouroboros-network/blob/95c9cd29ed889abe170ab2e9c6e8523b02432f03/ouroboros-consensus-test/src/Test/Util/Serialisation/Golden.hs#L87-L93
I don't think all that is needed here, though. Moreover, we really don't expect the ShelleyGenesis
to change anymore 🙂.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that's much nicer! In order to unblock IntersectMBO/ouroboros-network#2694 I think it makes sense to merge this once CI is happy. and we can make the tests failures easier to read if it becomes a problem. Indeed I do not expect the shelley genesis to change :)
7d77ace
to
ff3339c
Compare
ff3339c
to
59984c2
Compare
2702: Update dependencies r=mrBliss a=mrBliss Highlights: * IntersectMBO/cardano-ledger#1915 * IntersectMBO/cardano-ledger#1922 * IntersectMBO/cardano-ledger#1902 * IntersectMBO/cardano-ledger#1923 * IntersectMBO/cardano-ledger#1927 * IntersectMBO/cardano-ledger#1929 Co-authored-by: Thomas Winant <thomas@well-typed.com>
This PR adds
ToCBOR
andFromCBOR
instances forShelleyGenesis
.I've included round trip property tests and a unit test that maybe counts as a golden test.
closes #1925