@@ -13,11 +13,14 @@ import { FeeJuiceAddress } from '@aztec/protocol-contracts/fee-juice';
1313
1414import { jest } from '@jest/globals' ;
1515
16- import { publicDeployAccounts , setup } from '../fixtures/utils.js' ;
16+ import { type EndToEndContext , publicDeployAccounts , setup } from '../fixtures/utils.js' ;
17+ import { FeeJuicePortalTestingHarnessFactory } from '../shared/gas_portal_test_harness.js' ;
1718
1819jest . setTimeout ( 100_000 ) ;
1920
2021describe ( 'benchmarks/tx_size_fees' , ( ) => {
22+ let ctx : EndToEndContext ;
23+
2124 let aliceWallet : AccountWalletWithSecretKey ;
2225 let bobAddress : AztecAddress ;
2326 let sequencerAddress : AztecAddress ;
@@ -27,17 +30,17 @@ describe('benchmarks/tx_size_fees', () => {
2730
2831 // setup the environment
2932 beforeAll ( async ( ) => {
30- const { wallets , aztecNode } = await setup ( 3 , { } , { } , true ) ;
33+ ctx = await setup ( 3 , { } , { } , true ) ;
3134
32- aliceWallet = wallets [ 0 ] ;
33- bobAddress = wallets [ 1 ] . getAddress ( ) ;
34- sequencerAddress = wallets [ 2 ] . getAddress ( ) ;
35+ aliceWallet = ctx . wallets [ 0 ] ;
36+ bobAddress = ctx . wallets [ 1 ] . getAddress ( ) ;
37+ sequencerAddress = ctx . wallets [ 2 ] . getAddress ( ) ;
3538
36- await aztecNode . setConfig ( {
39+ await ctx . aztecNode . setConfig ( {
3740 feeRecipient : sequencerAddress ,
3841 } ) ;
3942
40- await publicDeployAccounts ( aliceWallet , wallets ) ;
43+ await publicDeployAccounts ( aliceWallet , ctx . wallets ) ;
4144 } ) ;
4245
4346 // deploy the contracts
@@ -49,9 +52,29 @@ describe('benchmarks/tx_size_fees', () => {
4952
5053 // mint tokens
5154 beforeAll ( async ( ) => {
55+ const feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory . create ( {
56+ aztecNode : ctx . aztecNode ,
57+ pxeService : ctx . pxe ,
58+ publicClient : ctx . deployL1ContractsValues . publicClient ,
59+ walletClient : ctx . deployL1ContractsValues . walletClient ,
60+ wallet : ctx . wallets [ 0 ] ,
61+ logger : ctx . logger ,
62+ } ) ;
63+
64+ const { secret : fpcSecret } = await feeJuiceBridgeTestHarness . prepareTokensOnL1 (
65+ 100_000_000_000n ,
66+ 100_000_000_000n ,
67+ fpc . address ,
68+ ) ;
69+ const { secret : aliceSecret } = await feeJuiceBridgeTestHarness . prepareTokensOnL1 (
70+ 100_000_000_000n ,
71+ 100_000_000_000n ,
72+ aliceWallet . getAddress ( ) ,
73+ ) ;
74+
5275 await Promise . all ( [
53- feeJuice . methods . mint_public ( aliceWallet . getAddress ( ) , 100e9 ) . send ( ) . wait ( ) ,
54- feeJuice . methods . mint_public ( fpc . address , 100e9 ) . send ( ) . wait ( ) ,
76+ feeJuice . methods . claim ( fpc . address , 100e9 , fpcSecret ) . send ( ) . wait ( ) ,
77+ feeJuice . methods . claim ( aliceWallet . getAddress ( ) , 100e9 , aliceSecret ) . send ( ) . wait ( ) ,
5578 ] ) ;
5679 await token . methods . privately_mint_private_note ( 100e9 ) . send ( ) . wait ( ) ;
5780 await token . methods . mint_public ( aliceWallet . getAddress ( ) , 100e9 ) . send ( ) . wait ( ) ;
0 commit comments