Skip to content

Commit 353c328

Browse files
authored
fixes finalizationEpoch (#758)
1 parent 3cb1b48 commit 353c328

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/infrastructure/ChainHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class ChainHttp extends Http implements ChainRepository {
6060
UInt64.fromNumericString(body.latestFinalizedBlock.height),
6161
body.latestFinalizedBlock.hash,
6262
body.latestFinalizedBlock.finalizationPoint,
63-
body.latestFinalizedBlock.finalizationPoint,
63+
body.latestFinalizedBlock.finalizationEpoch,
6464
),
6565
),
6666
);

test/infrastructure/ChainHttp.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ describe('ChainHttp', () => {
4141
chainInfoDTO.scoreHigh = '3';
4242
const finalizedBlockDto = {} as FinalizedBlockDTO;
4343
finalizedBlockDto.finalizationEpoch = 1;
44-
finalizedBlockDto.finalizationPoint = 1;
44+
finalizedBlockDto.finalizationPoint = 2;
4545
finalizedBlockDto.hash = 'hash';
4646
finalizedBlockDto.height = '1';
4747
chainInfoDTO.latestFinalizedBlock = finalizedBlockDto;
4848
when(chainRoutesApi.getChainInfo()).thenReturn(Promise.resolve(chainInfoDTO));
4949
const info = await chainRepository.getChainInfo().toPromise();
5050
expect(info).to.be.not.null;
51-
expect(info.height.toString()).to.be.equals('1');
52-
expect(info.scoreLow.toString()).to.be.equals('2');
53-
expect(info.scoreHigh.toString()).to.be.equals('3');
54-
expect(info.latestFinalizedBlock.height.toString()).to.be.equals('1');
55-
expect(info.latestFinalizedBlock.hash).to.be.equals('hash');
56-
expect(info.latestFinalizedBlock.finalizationPoint).to.be.equals(1);
57-
expect(info.latestFinalizedBlock.finalizationEpoch).to.be.equals(1);
51+
expect(info.height.toString()).to.be.equals(chainInfoDTO.height);
52+
expect(info.scoreLow.toString()).to.be.equals(chainInfoDTO.scoreLow);
53+
expect(info.scoreHigh.toString()).to.be.equals(chainInfoDTO.scoreHigh);
54+
expect(info.latestFinalizedBlock.height.toString()).to.be.equals(finalizedBlockDto.height);
55+
expect(info.latestFinalizedBlock.hash).to.be.equals(finalizedBlockDto.hash);
56+
expect(info.latestFinalizedBlock.finalizationPoint).to.be.equals(finalizedBlockDto.finalizationPoint);
57+
expect(info.latestFinalizedBlock.finalizationEpoch).to.be.equals(finalizedBlockDto.finalizationEpoch);
5858
});
5959
});

0 commit comments

Comments
 (0)