diff --git a/src/decorators/publicActionsParentChain.unit.test.ts b/src/decorators/publicActionsParentChain.unit.test.ts index d65bfcfd..3c5a235a 100644 --- a/src/decorators/publicActionsParentChain.unit.test.ts +++ b/src/decorators/publicActionsParentChain.unit.test.ts @@ -1,19 +1,25 @@ import { it, expect, describe } from 'vitest'; import { createPublicClient, http, padHex, zeroAddress } from 'viem'; -import { mainnet } from '../chains'; +import { sepolia } from '../chains'; import { publicActionsParentChain } from './publicActionsParentChain'; +import { arbitrum } from 'viem/chains'; -const arbOneSequencerInbox = '0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6'; - -const client = createPublicClient({ - chain: mainnet, +const arbSepoliaSequencerInbox = '0x6c97864CE4bEf387dE0b3310A44230f7E3F1be0D'; +const sepoliaClient = createPublicClient({ + chain: sepolia, + transport: http(), +}).extend(publicActionsParentChain({ sequencerInbox: arbSepoliaSequencerInbox })); +const arbitrumClient = createPublicClient({ + chain: arbitrum, transport: http(), -}).extend(publicActionsParentChain({ sequencerInbox: arbOneSequencerInbox })); +}).extend( + publicActionsParentChain({ sequencerInbox: '0x995a9d3ca121D48d21087eDE20bc8acb2398c8B1' }), +); describe('Getters', () => { it('[maxTimeVariation] Should return max time variation', async () => { - const maxTimeVariation = await client.getMaxTimeVariation(); + const maxTimeVariation = await sepoliaClient.getMaxTimeVariation(); expect(maxTimeVariation).toEqual({ delayBlocks: 5760n, futureBlocks: 64n, @@ -23,23 +29,28 @@ describe('Getters', () => { }); it('[isBatchPoster] Should return if an address is a batch poster', async () => { - const isZeroAddressBatchPoster = await client.isBatchPoster({ + const isZeroAddressBatchPoster = await arbitrumClient.isBatchPoster({ batchPoster: zeroAddress, }); expect(isZeroAddressBatchPoster).toBeFalsy(); + + const isBatchPosterOnXai = await arbitrumClient.isBatchPoster({ + batchPoster: '0x7F68dba68E72a250004812fe04F1123Fca89aBa9', + }); + expect(isBatchPosterOnXai).toBeTruthy(); }); it('[isValidKeysetHash] Should return if a keysetHash is a valid one', async () => { - const isEmptyHashValidKeysetHash = await client.isValidKeysetHash({ + const isEmptyHashValidKeysetHash = await arbitrumClient.isValidKeysetHash({ keysetHash: padHex('0x'), }); expect(isEmptyHashValidKeysetHash).toBeFalsy(); - // Test on Nova - const isAValidKeysetHashOnNova = await client.isValidKeysetHash({ - keysetHash: '0x01191accc7ad5a8020e6c6d122984540e9fc48d0457bda63e0a32c8c31994f4a', - sequencerInbox: '0x211e1c4c7f1bf5351ac850ed10fd68cffcf6c21b', + // Test on ProofOfPlay + const isAValidKeysetHashOnPoP = await arbitrumClient.isValidKeysetHash({ + keysetHash: '0xc2c008db9d0d25ca30d60080f5ebd3d114dbccd95f2bd2df05446eae6b1acadf', + sequencerInbox: '0xa58F38102579dAE7C584850780dDA55744f67DF1', }); - expect(isAValidKeysetHashOnNova).toBeTruthy(); + expect(isAValidKeysetHashOnPoP).toBeTruthy(); }); });