@@ -8,10 +8,12 @@ import { retryUntil } from '@aztec/foundation/retry';
88import { type PrivateKeyAccount , privateKeyToAccount } from 'viem/accounts' ;
99
1010import { createEthereumChain } from './chain.js' ;
11+ import { createExtendedL1Client } from './client.js' ;
1112import { DefaultL1ContractsConfig } from './config.js' ;
1213import { RollupContract } from './contracts/rollup.js' ;
1314import { type DeployL1ContractsArgs , type Operator , deployL1Contracts } from './deploy_l1_contracts.js' ;
1415import { startAnvil } from './test/start_anvil.js' ;
16+ import type { ExtendedViemWalletClient } from './types.js' ;
1517
1618describe ( 'deploy_l1_contracts' , ( ) => {
1719 let privateKey : PrivateKeyAccount ;
@@ -28,6 +30,7 @@ describe('deploy_l1_contracts', () => {
2830 const chainId = process . env . L1_CHAIN_ID ? parseInt ( process . env . L1_CHAIN_ID , 10 ) : 31337 ;
2931 let rpcUrl = process . env . L1_RPC_URL ;
3032 let stop : ( ) => Promise < void > = ( ) => Promise . resolve ( ) ;
33+ let client : ExtendedViemWalletClient ;
3134
3235 beforeAll ( async ( ) => {
3336 logger = createLogger ( 'ethereum:test:deploy_l1_contracts' ) ;
@@ -45,6 +48,8 @@ describe('deploy_l1_contracts', () => {
4548 if ( ! rpcUrl ) {
4649 ( { stop, rpcUrl } = await startAnvil ( ) ) ;
4750 }
51+
52+ client = createExtendedL1Client ( [ rpcUrl ] , privateKey , createEthereumChain ( [ rpcUrl ] , chainId ) . chainInfo ) ;
4853 } ) ;
4954
5055 afterAll ( async ( ) => {
@@ -127,4 +132,20 @@ describe('deploy_l1_contracts', () => {
127132 ) ;
128133 }
129134 } ) ;
135+
136+ it ( 'deploys and adds 48 initialValidators' , async ( ) => {
137+ const initialValidators = times ( 48 , ( ) => {
138+ const addr = EthAddress . random ( ) ;
139+ const bn254SecretKey = new SecretValue ( Fr . random ( ) . toBigInt ( ) ) ;
140+ return { attester : addr , withdrawer : addr , bn254SecretKey } ;
141+ } ) ;
142+
143+ const deployment = await deploy ( { initialValidators, aztecTargetCommitteeSize : initialValidators . length } ) ;
144+ const rollup = new RollupContract ( client , deployment . l1ContractAddresses . rollupAddress ) ;
145+
146+ expect ( await rollup . getActiveAttesterCount ( ) ) . toEqual ( BigInt ( initialValidators . length ) ) ;
147+ expect ( ( await rollup . getAttesters ( ) ) . map ( a => a . toLowerCase ( ) ) . sort ( ) ) . toEqual (
148+ initialValidators . map ( ( { attester } ) => attester . toString ( ) . toLowerCase ( ) ) . sort ( ) ,
149+ ) ;
150+ } ) ;
130151} ) ;
0 commit comments