@@ -207,28 +207,33 @@ describe("Without Paymaster", () => {
207207 } ) ;
208208 } ) ;
209209
210- describe ( "With gas discount" , ( ) => {
211- const depth = 3 ;
212- [ 15000 , 20000 , 25000 , 30000 , 35000 ] . forEach ( ( discount ) => {
213- test ( `Sender can make contract interactions with ${ discount } gas discount to recursive calls` , async ( ) => {
214- const response = await client . sendUserOperation (
215- acc . execute (
216- config . testGas ,
217- 0 ,
218- testGas . interface . encodeFunctionData ( "recursiveCall" , [
219- depth ,
220- 0 ,
221- discount ,
222- depth ,
223- ] )
224- ) ,
225- opChecks ( provider )
226- ) ;
227- const event = await response . wait ( ) ;
210+ describe ( "With random gas discount" , ( ) => {
211+ [ 1 , 2 , 3 ] . forEach ( ( depth ) =>
212+ describe ( `At depth equal to ${ depth } ` , ( ) => {
213+ Array . from ( { length : 5 } , ( ) =>
214+ Math . floor ( Math . random ( ) * 100000 )
215+ ) . forEach ( ( discount ) => {
216+ test ( `Sender can make contract interactions with ${ discount } gas discount to recursive calls` , async ( ) => {
217+ const response = await client . sendUserOperation (
218+ acc . execute (
219+ config . testGas ,
220+ 0 ,
221+ testGas . interface . encodeFunctionData ( "recursiveCall" , [
222+ depth ,
223+ 0 ,
224+ discount ,
225+ depth ,
226+ ] )
227+ ) ,
228+ opChecks ( provider )
229+ ) ;
230+ const event = await response . wait ( ) ;
228231
229- expect ( event ?. args . success ) . toBe ( true ) ;
230- } ) ;
231- } ) ;
232+ expect ( event ?. args . success ) . toBe ( true ) ;
233+ } ) ;
234+ } ) ;
235+ } )
236+ ) ;
232237 } ) ;
233238
234239 describe ( "With multiple stacks per depth" , ( ) => {
0 commit comments