@@ -143,7 +143,7 @@ describe("Without Paymaster", () => {
143143 acc . execute (
144144 config . testGas ,
145145 0 ,
146- testGas . interface . encodeFunctionData ( "recursiveCall" , [ 32 , 0 , 32 ] )
146+ testGas . interface . encodeFunctionData ( "recursiveCall" , [ 32 , 0 , 0 , 32 ] )
147147 ) ,
148148 { ...opChecks ( provider ) }
149149 ) ;
@@ -157,8 +157,8 @@ describe("Without Paymaster", () => {
157157 [ 0 , 2 , 4 , 8 , 16 ] . forEach ( ( depth ) => {
158158 test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
159159 let opts = opChecks ( provider ) ;
160- if ( depth === 8 ) opts = opCheckDeep ( 1195400 ) ;
161- if ( depth === 16 ) opts = opCheckDeep ( 4364942 ) ;
160+ if ( depth === 8 ) opts = opCheckDeep ( 1195897 ) ;
161+ if ( depth === 16 ) opts = opCheckDeep ( 4365893 ) ;
162162
163163 const response = await client . sendUserOperation (
164164 acc . execute (
@@ -167,6 +167,7 @@ describe("Without Paymaster", () => {
167167 testGas . interface . encodeFunctionData ( "recursiveCall" , [
168168 depth ,
169169 0 ,
170+ 0 ,
170171 depth ,
171172 ] )
172173 ) ,
@@ -183,8 +184,8 @@ describe("Without Paymaster", () => {
183184 [ 0 , 2 , 4 , 8 , 16 ] . forEach ( ( depth ) => {
184185 test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
185186 let opts = opChecks ( provider ) ;
186- if ( depth === 8 ) opts = opCheckDeep ( 1261728 ) ;
187- if ( depth === 16 ) opts = opCheckDeep ( 4498665 ) ;
187+ if ( depth === 8 ) opts = opCheckDeep ( 1262227 ) ;
188+ if ( depth === 16 ) opts = opCheckDeep ( 4499616 ) ;
188189
189190 const response = await client . sendUserOperation (
190191 acc . execute (
@@ -193,6 +194,7 @@ describe("Without Paymaster", () => {
193194 testGas . interface . encodeFunctionData ( "recursiveCall" , [
194195 depth ,
195196 0 ,
197+ 0 ,
196198 depth ,
197199 ] )
198200 ) ,
@@ -205,12 +207,36 @@ describe("Without Paymaster", () => {
205207 } ) ;
206208 } ) ;
207209
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 ( ) ;
228+
229+ expect ( event ?. args . success ) . toBe ( true ) ;
230+ } ) ;
231+ } ) ;
232+ } ) ;
233+
208234 describe ( "With multiple stacks per depth" , ( ) => {
209235 [ 0 , 1 , 2 , 3 ] . forEach ( ( depth ) => {
210236 test ( `Sender can make contract interactions with ${ depth } recursive calls` , async ( ) => {
211237 let opts = opChecks ( provider ) ;
212- if ( depth === 2 ) opts = opCheckDeep ( 865684 ) ;
213- if ( depth === 3 ) opts = opCheckDeep ( 7925084 ) ;
238+ if ( depth === 2 ) opts = opCheckDeep ( 866332 ) ;
239+ if ( depth === 3 ) opts = opCheckDeep ( 7929055 ) ;
214240
215241 const width = depth ;
216242 const response = await client . sendUserOperation (
@@ -220,6 +246,7 @@ describe("Without Paymaster", () => {
220246 testGas . interface . encodeFunctionData ( "recursiveCall" , [
221247 depth ,
222248 width ,
249+ 0 ,
223250 depth ,
224251 ] )
225252 ) ,
0 commit comments