diff --git a/src/createTokenBridge.integration.test.ts b/src/createTokenBridge.integration.test.ts index 7232324c..f7c916d7 100644 --- a/src/createTokenBridge.integration.test.ts +++ b/src/createTokenBridge.integration.test.ts @@ -18,7 +18,9 @@ const nitroTestnodeL2Client = createPublicClient({ }); it(`successfully deploys token bridge contracts on parent chain`, async () => { - const createRollupTxReceipt = await testSetupCreateRollup(); + const createRollupTxReceipt = await testSetupCreateRollup({ + publicClient: nitroTestnodeL1Client, + }); const { rollup } = createRollupTxReceipt.getCoreContracts(); const txRequest = await createTokenBridgePrepareTransactionRequest({ diff --git a/src/testHelpers.ts b/src/testHelpers.ts index 9282e6ca..1e29a7aa 100644 --- a/src/testHelpers.ts +++ b/src/testHelpers.ts @@ -1,5 +1,7 @@ +import { PublicClient } from 'viem'; import { privateKeyToAccount, PrivateKeyAccount } from 'viem/accounts'; import { config } from 'dotenv'; + import { CreateRollupTransactionReceipt, createRollupPrepareTransactionReceipt, @@ -8,8 +10,6 @@ import { generateChainId } from './utils'; import { prepareChainConfig } from './prepareChainConfig'; import { createRollupPrepareConfig } from './createRollupPrepareConfig'; import { createRollupPrepareTransactionRequest } from './createRollupPrepareTransactionRequest'; -import { createPublicClient, http } from 'viem'; -import { nitroTestnodeL1 } from './chains'; config(); @@ -31,12 +31,13 @@ function sanitizePrivateKey(privateKey: string): `0x${string}` { return privateKey as `0x${string}`; } -export async function testSetupCreateRollup(): Promise { - const publicClient = createPublicClient({ - chain: nitroTestnodeL1, - transport: http(), - }); +export type TestSetupCreateRollupParameters = { + publicClient: PublicClient; +}; +export async function testSetupCreateRollup({ + publicClient, +}: TestSetupCreateRollupParameters): Promise { const deployer = getTestPrivateKeyAccount(); // generate a random chain id