-
Notifications
You must be signed in to change notification settings - Fork 33
[WIP] Enrich block bodies to contain Peras certificates #1722
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
base: peras-staging
Are you sure you want to change the base?
[WIP] Enrich block bodies to contain Peras certificates #1722
Conversation
24dba5c to
13e6fa7
Compare
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Block.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/unstable-shelley-testlib/Test/Consensus/Shelley/Examples.hs
Show resolved
Hide resolved
|
|
||
| instance ShelleyCompatible proto era => Condense (ShelleyBlock proto era) where | ||
| condense = show . shelleyBlockRaw | ||
| condense = show . ((shelleyBlockHeader &&& shelleyBlockBody) &&& shelleyBlockPerasCert) |
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 might want to tweak this instance.
65b3897 to
a93ba8f
Compare
ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/Serialisation/Golden.hs
Show resolved
Hide resolved
a93ba8f to
c0822d7
Compare
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 looks good to me for now, let's wait until we get feedback from Ledger
| -- | Reconstruct a Shelley ledger block from a 'ShelleyBlock'. | ||
| -- | ||
| -- TODO: we should be able to avoid this conversion in most cases | ||
| fromShelleyBlock :: ShelleyBlock proto era -> SL.Block (ShelleyProtocolHeader proto) era | ||
| fromShelleyBlock blk = SL.Block (shelleyBlockHeader blk) (shelleyBlockBody blk) | ||
|
|
||
| -- | Construct a 'ShelleyBlock' from a Shelley ledger block. | ||
| -- | ||
| -- TODO: we should be able to avoid this conversion in most cases | ||
| toShelleyBlock :: | ||
| ShelleyCompatible proto era => SL.Block (ShelleyProtocolHeader proto) era -> ShelleyBlock proto era | ||
| toShelleyBlock (SL.Block hdr body) = mkShelleyBlock hdr body |
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 could also just store an SL.Block, but encode it differently. But either way, this conversion should be super cheap
Closes tweag/cardano-peras#141