Skip to content

Commit

Permalink
Byron ticked ledger state: also add tip block number
Browse files Browse the repository at this point in the history
We need this to implement the translation of the last ticked Byron ledger state
to the first Shelley state.

The ticked Shelley ledger state already contains the tip block number just as
the unticked Shelley ledger state, so this is just making something consistent
across Byron and Shelley.
  • Loading branch information
amesgen committed Sep 8, 2023
1 parent 6e22a69 commit 16f6110
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ getByronTip state =

-- | The ticked Byron ledger state
data instance Ticked (LedgerState ByronBlock) = TickedByronLedgerState {
tickedByronLedgerState :: !CC.ChainValidationState
untickedByronLedgerTipBlockNo :: !(WithOrigin BlockNo)
, tickedByronLedgerState :: !CC.ChainValidationState
, untickedByronLedgerTransition :: !ByronTransition
}
deriving (Generic, NoThunks)
Expand All @@ -175,7 +176,8 @@ instance IsLedger (LedgerState ByronBlock) where

applyChainTickLedgerResult cfg slotNo ByronLedgerState{..} = pureLedgerResult $
TickedByronLedgerState {
tickedByronLedgerState =
untickedByronLedgerTipBlockNo = byronLedgerTipBlockNo
, tickedByronLedgerState =
CC.applyChainTick cfg (toByronSlotNo slotNo) byronLedgerState
, untickedByronLedgerTransition =
byronLedgerTransition
Expand Down

0 comments on commit 16f6110

Please sign in to comment.