diff --git a/packages/projection/src/operators/certificates/withCertificates.ts b/packages/projection/src/operators/certificates/withCertificates.ts index ee5cbce4653..de0eeadea56 100644 --- a/packages/projection/src/operators/certificates/withCertificates.ts +++ b/packages/projection/src/operators/certificates/withCertificates.ts @@ -4,7 +4,7 @@ import { WithRolledBackEvents } from '../withRolledBackEvents'; import { projectorOperator } from '../utils'; export interface CertificatePointer { - blockHeight: Cardano.BlockNo; + slot: Cardano.Slot; txIndex: number; certIndex: number; } @@ -23,7 +23,7 @@ export interface WithCertificates { const blockCertificates = ({ block: { - header: { blockNo }, + header: { slot }, body } }: RollForwardEvent) => @@ -31,8 +31,8 @@ const blockCertificates = ({ certificates.map((certificate, certIndex) => ({ certificate, pointer: { - blockHeight: blockNo, certIndex, + slot, txIndex } })) diff --git a/packages/projection/test/operators/certificates/withCertificates.test.ts b/packages/projection/test/operators/certificates/withCertificates.test.ts index c5dbac1de31..7a850345b14 100644 --- a/packages/projection/test/operators/certificates/withCertificates.test.ts +++ b/packages/projection/test/operators/certificates/withCertificates.test.ts @@ -9,7 +9,7 @@ import { } from '../../../src'; import { createTestScheduler } from '@cardano-sdk/util-dev'; -const rollForwardEvent = (blockNo: Cardano.BlockNo, txs: Cardano.Certificate[][]) => +const rollForwardEvent = (slot: Cardano.Slot, txs: Cardano.Certificate[][]) => ({ block: { body: txs.map( @@ -18,7 +18,7 @@ const rollForwardEvent = (blockNo: Cardano.BlockNo, txs: Cardano.Certificate[][] body: { certificates } } as Cardano.TxAlonzo) ), - header: { blockNo } + header: { slot } }, eventType: ChainSyncEventType.RollForward } as RollForwardEvent); @@ -26,12 +26,12 @@ const rollForwardEvent = (blockNo: Cardano.BlockNo, txs: Cardano.Certificate[][] const rollBackwardEvent = (blocks: Cardano.Certificate[][][]) => ({ eventType: ChainSyncEventType.RollBackward, - rolledBackEvents: blocks.map((txs, blockNo) => ({ + rolledBackEvents: blocks.map((txs, slot) => ({ block: { body: txs.map((certificates) => ({ body: { certificates } })), - header: { blockNo } + header: { slot } } })) } as RollBackwardEvent); @@ -58,24 +58,24 @@ describe('withCertificates', () => { { certificate: certificates[0][0], pointer: { - blockHeight: 1, certIndex: 0, + slot: 1, txIndex: 0 } }, { certificate: certificates[1][0], pointer: { - blockHeight: 1, certIndex: 0, + slot: 1, txIndex: 1 } }, { certificate: certificates[1][1], pointer: { - blockHeight: 1, certIndex: 1, + slot: 1, txIndex: 1 } } @@ -102,24 +102,24 @@ describe('withCertificates', () => { { certificate: certificates[1][1], pointer: { - blockHeight: 0, certIndex: 1, + slot: 0, txIndex: 1 } }, { certificate: certificates[1][0], pointer: { - blockHeight: 0, certIndex: 0, + slot: 0, txIndex: 1 } }, { certificate: certificates[0][0], pointer: { - blockHeight: 0, certIndex: 0, + slot: 0, txIndex: 0 } } diff --git a/packages/projection/test/operators/certificates/withStakePools.test.ts b/packages/projection/test/operators/certificates/withStakePools.test.ts index 4299c43f8c0..6c6220a1c31 100644 --- a/packages/projection/test/operators/certificates/withStakePools.test.ts +++ b/packages/projection/test/operators/certificates/withStakePools.test.ts @@ -48,7 +48,7 @@ describe('withStakePools', () => { } else { // delete all updates and retirements <= current tip const belowOrAtTip = ({ source }: WithCertificateSource) => - evt.tip !== 'origin' && source.blockHeight <= evt.tip.blockNo; + evt.tip !== 'origin' && source.slot <= evt.tip.slot; for (const [_, stakePool] of stakePools) { stakePool.updates = stakePool.updates.filter(belowOrAtTip); stakePool.retirements = stakePool.retirements.filter(belowOrAtTip);