@@ -13,7 +13,13 @@ import {
13
13
type Wallet ,
14
14
deriveKeys ,
15
15
} from '@aztec/aztec.js' ;
16
- import { type AztecAddress , type CompleteAddress , Fq , GasSettings } from '@aztec/circuits.js' ;
16
+ import {
17
+ type AztecAddress ,
18
+ type CompleteAddress ,
19
+ FEE_FUNDING_FOR_TESTER_ACCOUNT ,
20
+ Fq ,
21
+ GasSettings ,
22
+ } from '@aztec/circuits.js' ;
17
23
import { type TokenContract as BananaCoin , type FPCContract , SchnorrAccountContract } from '@aztec/noir-contracts.js' ;
18
24
19
25
import { jest } from '@jest/globals' ;
@@ -87,9 +93,9 @@ describe('e2e_fees account_init', () => {
87
93
88
94
describe ( 'account pays its own fee' , ( ) => {
89
95
it ( 'pays natively in the Fee Juice after Alice bridges funds' , async ( ) => {
90
- await t . mintAndBridgeFeeJuice ( bobsAddress , t . INITIAL_GAS_BALANCE ) ;
96
+ await t . mintAndBridgeFeeJuice ( bobsAddress , FEE_FUNDING_FOR_TESTER_ACCOUNT ) ;
91
97
const [ bobsInitialGas ] = await t . getGasBalanceFn ( bobsAddress ) ;
92
- expect ( bobsInitialGas ) . toEqual ( t . INITIAL_GAS_BALANCE ) ;
98
+ expect ( bobsInitialGas ) . toEqual ( FEE_FUNDING_FOR_TESTER_ACCOUNT ) ;
93
99
94
100
const paymentMethod = new FeeJuicePaymentMethod ( bobsAddress ) ;
95
101
const tx = await bobsAccountManager . deploy ( { fee : { gasSettings, paymentMethod } } ) . wait ( ) ;
@@ -99,16 +105,18 @@ describe('e2e_fees account_init', () => {
99
105
} ) ;
100
106
101
107
it ( 'pays natively in the Fee Juice by bridging funds themselves' , async ( ) => {
102
- const claim = await t . feeJuiceBridgeTestHarness . prepareTokensOnL1 ( t . INITIAL_GAS_BALANCE , bobsAddress ) ;
108
+ const claim = await t . feeJuiceBridgeTestHarness . prepareTokensOnL1 ( FEE_FUNDING_FOR_TESTER_ACCOUNT , bobsAddress ) ;
103
109
const paymentMethod = new FeeJuicePaymentMethodWithClaim ( bobsAddress , claim ) ;
104
110
const tx = await bobsAccountManager . deploy ( { fee : { gasSettings, paymentMethod } } ) . wait ( ) ;
105
111
expect ( tx . transactionFee ! ) . toBeGreaterThan ( 0n ) ;
106
- await expect ( t . getGasBalanceFn ( bobsAddress ) ) . resolves . toEqual ( [ t . INITIAL_GAS_BALANCE - tx . transactionFee ! ] ) ;
112
+ await expect ( t . getGasBalanceFn ( bobsAddress ) ) . resolves . toEqual ( [
113
+ FEE_FUNDING_FOR_TESTER_ACCOUNT - tx . transactionFee ! ,
114
+ ] ) ;
107
115
} ) ;
108
116
109
117
it ( 'pays privately through an FPC' , async ( ) => {
110
118
// Alice mints bananas to Bob
111
- const mintedBananas = t . INITIAL_GAS_BALANCE ;
119
+ const mintedBananas = FEE_FUNDING_FOR_TESTER_ACCOUNT ;
112
120
await t . mintPrivateBananas ( mintedBananas , bobsAddress ) ;
113
121
114
122
// Bob deploys his account through the private FPC
@@ -136,7 +144,7 @@ describe('e2e_fees account_init', () => {
136
144
} ) ;
137
145
138
146
it ( 'pays publicly through an FPC' , async ( ) => {
139
- const mintedBananas = t . INITIAL_GAS_BALANCE ;
147
+ const mintedBananas = FEE_FUNDING_FOR_TESTER_ACCOUNT ;
140
148
await bananaCoin . methods . mint_to_public ( bobsAddress , mintedBananas ) . send ( ) . wait ( ) ;
141
149
142
150
const paymentMethod = new PublicFeePaymentMethod ( bananaCoin . address , bananaFPC . address , bobsWallet ) ;
@@ -164,7 +172,7 @@ describe('e2e_fees account_init', () => {
164
172
describe ( 'another account pays the fee' , ( ) => {
165
173
it ( 'pays natively in the Fee Juice' , async ( ) => {
166
174
// mint Fee Juice to alice
167
- await t . mintAndBridgeFeeJuice ( aliceAddress , t . INITIAL_GAS_BALANCE ) ;
175
+ await t . mintAndBridgeFeeJuice ( aliceAddress , FEE_FUNDING_FOR_TESTER_ACCOUNT ) ;
168
176
const [ alicesInitialGas ] = await t . getGasBalanceFn ( aliceAddress ) ;
169
177
170
178
// bob generates the private keys for his account on his own
0 commit comments