diff --git a/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts b/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts index 02cdc8affee0..b162bc7d35f7 100644 --- a/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts +++ b/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts @@ -1,4 +1,4 @@ -import { setup as e2eSetup } from '../fixtures/utils.js'; +import { setup as e2eSetup, getL1WalletClient } from '../fixtures/utils.js'; import { type UniswapSetupContext, uniswapL1L2TestSuite } from '../shared/uniswap_l1_l2.js'; // This tests works on forked mainnet. There is a dump of the data in `dumpedState` such that we @@ -18,9 +18,10 @@ const testSetup = async (): Promise => { deployL1ContractsValues, wallets, logger, + config, } = await e2eSetup(2, { stateLoad: dumpedState }); - const walletClient = deployL1ContractsValues.walletClient; + const walletClient = getL1WalletClient(config.rpcUrl, 1); const publicClient = deployL1ContractsValues.publicClient; const ownerWallet = wallets[0]; diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index d90102914d4c..8507db86f005 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -439,6 +439,16 @@ export async function setup( }; } +/** Returns an L1 wallet client for anvil using a well-known private key based on the index. */ +export function getL1WalletClient(rpcUrl: string, index: number) { + const hdAccount = mnemonicToAccount(MNEMONIC, { addressIndex: index }); + return createWalletClient({ + account: hdAccount, + chain: foundry, + transport: http(rpcUrl), + }); +} + /** * Ensures there's a running Anvil instance and returns the RPC URL. * @returns