diff --git a/src/testHelpers.ts b/src/testHelpers.ts index bb98ac6d..f9e810f6 100644 --- a/src/testHelpers.ts +++ b/src/testHelpers.ts @@ -1,16 +1,6 @@ -import { PublicClient } from 'viem'; import { privateKeyToAccount, PrivateKeyAccount } from 'viem/accounts'; import { config } from 'dotenv'; -import { - CreateRollupTransactionReceipt, - createRollupPrepareTransactionReceipt, -} from './createRollupPrepareTransactionReceipt'; -import { generateChainId } from './utils'; -import { prepareChainConfig } from './prepareChainConfig'; -import { createRollupPrepareConfig } from './createRollupPrepareConfig'; -import { createRollupPrepareTransactionRequest } from './createRollupPrepareTransactionRequest'; - config(); export function getTestPrivateKeyAccount(): PrivateKeyAccount & { privateKey: `0x${string}` } { @@ -32,49 +22,3 @@ function sanitizePrivateKey(privateKey: string): `0x${string}` { return privateKey as `0x${string}`; } - -export type TestSetupCreateRollupParameters = { - publicClient: PublicClient; -}; - -export async function testSetupCreateRollup({ - publicClient, -}: TestSetupCreateRollupParameters): Promise { - const deployer = getTestPrivateKeyAccount(); - - // generate a random chain id - const chainId = generateChainId(); - - // create the chain config - const chainConfig = prepareChainConfig({ - chainId, - arbitrum: { InitialChainOwner: deployer.address }, - }); - - const config = createRollupPrepareConfig({ - chainId: BigInt(chainId), - owner: deployer.address, - chainConfig, - }); - - // prepare the transaction for deploying the core contracts - const request = await createRollupPrepareTransactionRequest({ - params: { - config, - batchPoster: deployer.address, - validators: [deployer.address], - }, - account: deployer.address, - publicClient, - }); - - // sign and send the transaction - const txHash = await publicClient.sendRawTransaction({ - serializedTransaction: await deployer.signTransaction(request), - }); - - // get the transaction receipt after waiting for the transaction to complete - return createRollupPrepareTransactionReceipt( - await publicClient.waitForTransactionReceipt({ hash: txHash }), - ); -}