Skip to content

Commit c65c0df

Browse files
committed
Change chains for unit test
1 parent 0d4cce1 commit c65c0df

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed
Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
import { it, expect, describe } from 'vitest';
22

33
import { createPublicClient, http, padHex, zeroAddress } from 'viem';
4-
import { mainnet } from '../chains';
4+
import { sepolia } from '../chains';
55
import { publicActionsParentChain } from './publicActionsParentChain';
6+
import { arbitrum } from 'viem/chains';
67

7-
const arbOneSequencerInbox = '0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6';
8-
9-
const client = createPublicClient({
10-
chain: mainnet,
8+
const arbSepoliaSequencerInbox = '0x6c97864CE4bEf387dE0b3310A44230f7E3F1be0D';
9+
const sepoliaClient = createPublicClient({
10+
chain: sepolia,
11+
transport: http(),
12+
}).extend(publicActionsParentChain({ sequencerInbox: arbSepoliaSequencerInbox }));
13+
const arbitrumClient = createPublicClient({
14+
chain: arbitrum,
1115
transport: http(),
12-
}).extend(publicActionsParentChain({ sequencerInbox: arbOneSequencerInbox }));
16+
}).extend(
17+
publicActionsParentChain({ sequencerInbox: '0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1' }),
18+
);
1319

1420
describe('Getters', () => {
1521
it('[maxTimeVariation] Should return max time variation', async () => {
16-
const maxTimeVariation = await client.getMaxTimeVariation();
22+
const maxTimeVariation = await sepoliaClient.getMaxTimeVariation();
1723
expect(maxTimeVariation).toEqual({
1824
delayBlocks: 5760n,
1925
futureBlocks: 64n,
@@ -23,23 +29,28 @@ describe('Getters', () => {
2329
});
2430

2531
it('[isBatchPoster] Should return if an address is a batch poster', async () => {
26-
const isZeroAddressBatchPoster = await client.isBatchPoster({
32+
const isZeroAddressBatchPoster = await arbitrumClient.isBatchPoster({
2733
batchPoster: zeroAddress,
2834
});
2935
expect(isZeroAddressBatchPoster).toBeFalsy();
36+
37+
const isBatchPosterOnXai = await arbitrumClient.isBatchPoster({
38+
batchPoster: '0x7F68dba68E72a250004812fe04F1123Fca89aBa9',
39+
});
40+
expect(isBatchPosterOnXai).toBeTruthy();
3041
});
3142

3243
it('[isValidKeysetHash] Should return if a keysetHash is a valid one', async () => {
33-
const isEmptyHashValidKeysetHash = await client.isValidKeysetHash({
44+
const isEmptyHashValidKeysetHash = await arbitrumClient.isValidKeysetHash({
3445
keysetHash: padHex('0x'),
3546
});
3647
expect(isEmptyHashValidKeysetHash).toBeFalsy();
3748

38-
// Test on Nova
39-
const isAValidKeysetHashOnNova = await client.isValidKeysetHash({
40-
keysetHash: '0x01191accc7ad5a8020e6c6d122984540e9fc48d0457bda63e0a32c8c31994f4a',
41-
sequencerInbox: '0x211e1c4c7f1bf5351ac850ed10fd68cffcf6c21b',
49+
// Test on ProofOfPlay
50+
const isAValidKeysetHashOnPoP = await arbitrumClient.isValidKeysetHash({
51+
keysetHash: '0xc2c008db9d0d25ca30d60080f5ebd3d114dbccd95f2bd2df05446eae6b1acadf',
52+
sequencerInbox: '0xa58F38102579dAE7C584850780dDA55744f67DF1',
4253
});
43-
expect(isAValidKeysetHashOnNova).toBeTruthy();
54+
expect(isAValidKeysetHashOnPoP).toBeTruthy();
4455
});
4556
});

0 commit comments

Comments
 (0)