Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 16, 2024
1 parent d1f62d1 commit 6600a9a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions yarn-project/end-to-end/src/integration_l1_publisher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,19 @@ describe('L1Publisher integration', () => {
const headerDecoderArgs = [`0x${block.header.toBuffer().toString('hex')}`] as const;
const decodedHeader = await headerDecoderHelper.read.decode(headerDecoderArgs);

expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual(Number(decodedHeader.chainId));
expect(Number(block.header.globalVariables.version.toBigInt())).toEqual(Number(decodedHeader.version));
expect(block.number).toEqual(Number(decodedHeader.blockNumber));
expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual(Number(decodedHeader.timestamp));
expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.chainId),
);
expect(Number(block.header.globalVariables.version.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.version),
);
expect(block.number).toEqual(Number(decodedHeader.globalVariables.blockNumber));
expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.timestamp),
);

// TODO(benesjan): this ugly. Unify how the archive value is represented.
const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchive);
const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchiveRoot);
const expectedLastArchiveRoot = block.header.lastArchive.root;
expect(expectedLastArchiveRoot).toEqual(receivedLastArchiveRoot);

Expand Down Expand Up @@ -499,13 +505,19 @@ describe('L1Publisher integration', () => {
const headerDecoderArgs = [`0x${block.header.toBuffer().toString('hex')}`] as const;
const decodedHeader = await headerDecoderHelper.read.decode(headerDecoderArgs);

expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual(Number(decodedHeader.chainId));
expect(Number(block.header.globalVariables.version.toBigInt())).toEqual(Number(decodedHeader.version));
expect(block.number).toEqual(Number(decodedHeader.blockNumber));
expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual(Number(decodedHeader.timestamp));
expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.chainId),
);
expect(Number(block.header.globalVariables.version.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.version),
);
expect(block.number).toEqual(Number(decodedHeader.globalVariables.blockNumber));
expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual(
Number(decodedHeader.globalVariables.timestamp),
);

// TODO(benesjan): this ugly. Unify how the archive value is represented.
const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchive);
const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchiveRoot);
const expectedLastArchiveRoot = block.header.lastArchive.root;
expect(expectedLastArchiveRoot).toEqual(receivedLastArchiveRoot);

Expand Down

0 comments on commit 6600a9a

Please sign in to comment.