Skip to content

Conversation

@agustinmista
Copy link
Contributor

@agustinmista agustinmista self-assigned this Oct 17, 2025
@agustinmista agustinmista force-pushed the peras/enrich-shelley-blocks-with-certs branch from 24dba5c to 13e6fa7 Compare October 17, 2025 12:58

instance ShelleyCompatible proto era => Condense (ShelleyBlock proto era) where
condense = show . shelleyBlockRaw
condense = show . ((shelleyBlockHeader &&& shelleyBlockBody) &&& shelleyBlockPerasCert)
Copy link
Contributor Author

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.

@agustinmista agustinmista force-pushed the peras/enrich-shelley-blocks-with-certs branch 2 times, most recently from 65b3897 to a93ba8f Compare October 20, 2025 13:36
@agustinmista agustinmista force-pushed the peras/enrich-shelley-blocks-with-certs branch from a93ba8f to c0822d7 Compare October 20, 2025 13:46
@agustinmista agustinmista requested a review from amesgen October 20, 2025 14:00
Copy link
Member

@amesgen amesgen left a 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

Comment on lines +176 to +187
-- | 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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants