Skip to content

Commit a1e0378

Browse files
committed
feature(cardano-db-sync): Add HasNewEpochState to all other eras
1 parent f1b1166 commit a1e0378

File tree

1 file changed

+37
-1
lines changed
  • cardano-db-sync/src/Cardano/DbSync/Ledger

1 file changed

+37
-1
lines changed

cardano-db-sync/src/Cardano/DbSync/Ledger/Types.hs

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,45 @@ instance HasNewEpochState StandardShelley where
218218
hApplyExtLedgerState $
219219
fn (applyNewEpochState' st) :* fn id :* fn id :* fn id :* fn id :* fn id :* Nil
220220

221+
instance HasNewEpochState StandardAllegra where
222+
getNewEpochState st = case ledgerState st of
223+
LedgerStateAllegra allegra -> Just (shelleyLedgerState allegra)
224+
_ -> Nothing
225+
226+
applyNewEpochState st =
227+
hApplyExtLedgerState $
228+
fn id :* fn (applyNewEpochState' st) :* fn id :* fn id :* fn id :* fn id :* Nil
229+
230+
instance HasNewEpochState StandardMary where
231+
getNewEpochState st = case ledgerState st of
232+
LedgerStateMary mary -> Just (shelleyLedgerState mary)
233+
_ -> Nothing
234+
235+
applyNewEpochState st =
236+
hApplyExtLedgerState $
237+
fn id :* fn id :* fn (applyNewEpochState' st) :* fn id :* fn id :* fn id :* Nil
238+
239+
instance HasNewEpochState StandardAlonzo where
240+
getNewEpochState st = case ledgerState st of
241+
LedgerStateAlonzo alonzo -> Just (shelleyLedgerState alonzo)
242+
_ -> Nothing
243+
244+
applyNewEpochState st =
245+
hApplyExtLedgerState $
246+
fn id :* fn id :* fn id :* fn (applyNewEpochState' st) :* fn id :* fn id :* Nil
247+
248+
instance HasNewEpochState StandardBabbage where
249+
getNewEpochState st = case ledgerState st of
250+
LedgerStateBabbage babbage -> Just (shelleyLedgerState babbage)
251+
_ -> Nothing
252+
253+
applyNewEpochState st =
254+
hApplyExtLedgerState $
255+
fn id :* fn id :* fn id :* fn id :* fn (applyNewEpochState' st) :* fn id :* Nil
256+
221257
instance HasNewEpochState StandardConway where
222258
getNewEpochState st = case ledgerState st of
223-
LedgerStateConway shelley -> Just (shelleyLedgerState shelley)
259+
LedgerStateConway conway -> Just (shelleyLedgerState conway)
224260
_ -> Nothing
225261

226262
applyNewEpochState st =

0 commit comments

Comments
 (0)