Skip to content

Commit

Permalink
feat: support Babbage block
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Jul 1, 2022
1 parent c1d34d1 commit fe484e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/api-cardano-db-hasura/src/ChainFollower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
createChainSyncClient,
createInteractionContext,
isAlonzoBlock,
isBabbageBlock,
isMaryBlock,
Schema
} from '@cardano-ogmios/client'
Expand Down Expand Up @@ -65,9 +66,10 @@ export class ChainFollower {
requestNext()
},
rollForward: async ({ block }, requestNext) => {
let b: Schema.BlockMary
if (isAlonzoBlock(block)) {
// @ts-ignore
let b: Schema.BlockBabbage | Schema.BlockAlonzo | Schema.BlockMary
if (isBabbageBlock(block)) {
b = block.babbage as Schema.BlockBabbage
} else if (isAlonzoBlock(block)) {
b = block.alonzo as Schema.BlockAlonzo
} else if (isMaryBlock(block)) {
b = block.mary as Schema.BlockMary
Expand Down

0 comments on commit fe484e1

Please sign in to comment.