@@ -113,16 +113,16 @@ describe("Without Paymaster", () => {
113113 acc . execute (
114114 config . testGas ,
115115 0 ,
116- testGas . interface . encodeFunctionData ( "recursiveCall" , [ 32 , 32 ] )
116+ testGas . interface . encodeFunctionData ( "recursiveCall" , [ 32 , 0 , 32 ] )
117117 )
118118 ) ;
119119 } catch ( error : any ) {
120- expect ( error ?. error . code ) . toBe ( errorCodes . invalidFields ) ;
120+ expect ( error ?. error . code ) . toBe ( errorCodes . executionReverted ) ;
121121 }
122122 } ) ;
123123
124124 describe ( "With increasing call stack size" , ( ) => {
125- describe ( "With zero value calls " , ( ) => {
125+ describe ( "With zero value" , ( ) => {
126126 [ 0 , 2 , 4 , 8 , 16 ] . forEach ( ( depth ) => {
127127 test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
128128 const response = await client . sendUserOperation (
@@ -131,6 +131,7 @@ describe("Without Paymaster", () => {
131131 0 ,
132132 testGas . interface . encodeFunctionData ( "recursiveCall" , [
133133 depth ,
134+ 0 ,
134135 depth ,
135136 ] )
136137 )
@@ -142,7 +143,7 @@ describe("Without Paymaster", () => {
142143 } ) ;
143144 } ) ;
144145
145- describe ( "With non-zero value calls " , ( ) => {
146+ describe ( "With non-zero value" , ( ) => {
146147 [ 0 , 2 , 4 , 8 , 16 ] . forEach ( ( depth ) => {
147148 test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
148149 const response = await client . sendUserOperation (
@@ -151,6 +152,29 @@ describe("Without Paymaster", () => {
151152 ethers . utils . parseEther ( "0.001" ) ,
152153 testGas . interface . encodeFunctionData ( "recursiveCall" , [
153154 depth ,
155+ 0 ,
156+ depth ,
157+ ] )
158+ )
159+ ) ;
160+ const event = await response . wait ( ) ;
161+
162+ expect ( event ?. args . success ) . toBe ( true ) ;
163+ } ) ;
164+ } ) ;
165+ } ) ;
166+
167+ describe ( "With multiple stacks per depth" , ( ) => {
168+ [ 0 , 1 , 2 , 3 ] . forEach ( ( depth ) => {
169+ test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
170+ const width = depth ;
171+ const response = await client . sendUserOperation (
172+ acc . execute (
173+ config . testGas ,
174+ 0 ,
175+ testGas . interface . encodeFunctionData ( "recursiveCall" , [
176+ depth ,
177+ width ,
154178 depth ,
155179 ] )
156180 )
0 commit comments