Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions yarn-project/end-to-end/src/e2e_block_building.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { AztecNode } from '@aztec/aztec-node';
import { AztecNode, getConfigEnvVars } from '@aztec/aztec-node';
import { AztecRPCServer, ContractDeployer, Fr, TxStatus } from '@aztec/aztec.js';
import { EthereumRpc } from '@aztec/ethereum.js/eth_rpc';
import { WalletProvider } from '@aztec/ethereum.js/provider';
import { EthAddress, createDebugLogger } from '@aztec/foundation';
import { ContractAbi } from '@aztec/noir-contracts';
import { TestContractAbi } from '@aztec/noir-contracts/examples';
import times from 'lodash.times';
import { createAztecNode } from './create_aztec_node.js';
import { createAztecRpcServer } from './create_aztec_rpc_client.js';
import { createProvider, deployRollupContract, deployUnverifiedDataEmitterContract } from './deploy_l1_contracts.js';

const { ETHEREUM_HOST = 'http://localhost:8545' } = process.env;
const MNEMONIC = 'test test test test test test test test test test test junk';

const logger = createDebugLogger('aztec:e2e_block_building');

const config = getConfigEnvVars();

describe('e2e_block_building', () => {
let provider: WalletProvider;
let node: AztecNode;
Expand All @@ -24,21 +25,19 @@ describe('e2e_block_building', () => {
const abi = TestContractAbi as ContractAbi;

beforeEach(async () => {
provider = createProvider(ETHEREUM_HOST, MNEMONIC, 1);
provider = createProvider(config.rpcUrl, MNEMONIC, 1);
config.publisherPrivateKey = provider.getPrivateKey(0) || Buffer.alloc(32);
const ethRpc = new EthereumRpc(provider);
logger('Deploying contracts...');
rollupAddress = await deployRollupContract(provider, ethRpc);
unverifiedDataEmitterAddress = await deployUnverifiedDataEmitterContract(provider, ethRpc);
config.rollupContract = rollupAddress;
config.unverifiedDataEmitterContract = unverifiedDataEmitterAddress;
logger('Deployed contracts...');
});

beforeEach(async () => {
node = await createAztecNode(
rollupAddress,
unverifiedDataEmitterAddress,
ETHEREUM_HOST,
provider.getPrivateKey(0)!,
);
node = await AztecNode.createAndSync(config);
aztecRpcServer = await createAztecRpcServer(1, node);
}, 10_000);

Expand Down