@@ -20,6 +20,9 @@ const MultiSend = artifacts.require('MultiSend');
20
20
const DefaultCallbackHandler = artifacts . require ( 'DefaultCallbackHandler' ) ;
21
21
const ProxyFactory = artifacts . require ( 'ProxyFactory' ) ;
22
22
const zeroAddress = `0x${ '0' . repeat ( 40 ) } ` ;
23
+ // TODO: remove requirement to put this parameter in the test cases:
24
+ // should estimate gas when gas is not provided to CPK
25
+ const defaultGasLimit = '0x100000' ;
23
26
24
27
const toConfirmationPromise = ( promiEvent ) => new Promise (
25
28
( resolve , reject ) => promiEvent . on ( 'confirmation' ,
@@ -98,7 +101,7 @@ function shouldSupportDifferentTransactions({
98
101
to : multiStep . address ,
99
102
value : 0 ,
100
103
data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
101
- } ] ) ;
104
+ } ] , { gasLimit : defaultGasLimit } ) ;
102
105
( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 1 ) ;
103
106
} ) ;
104
107
@@ -117,7 +120,7 @@ function shouldSupportDifferentTransactions({
117
120
value : 0 ,
118
121
data : multiStep . contract . methods . doStep ( 2 ) . encodeABI ( ) ,
119
122
} ,
120
- ] ) ;
123
+ ] , { gasLimit : defaultGasLimit } ) ;
121
124
( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 2 ) ;
122
125
} ) ;
123
126
@@ -149,7 +152,7 @@ function shouldSupportDifferentTransactions({
149
152
value : 0 ,
150
153
data : multiStep . contract . methods . doERC20Step ( 2 , erc20 . address ) . encodeABI ( ) ,
151
154
} ,
152
- ] ) ;
155
+ ] , { gasLimit : defaultGasLimit } ) ;
153
156
154
157
( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 2 ) ;
155
158
@@ -201,7 +204,7 @@ function shouldSupportDifferentTransactions({
201
204
`${ 1e18 } ` ,
202
205
) . encodeABI ( ) ,
203
206
} ,
204
- ] ) ;
207
+ ] , { gasLimit : defaultGasLimit } ) ;
205
208
206
209
if ( cpk . address === proxyOwner ) {
207
210
fromWei ( await erc20 . balanceOf ( cpk . address ) ) . should . equal ( 99 ) ;
@@ -222,7 +225,7 @@ function shouldSupportDifferentTransactions({
222
225
to : multiStep . address ,
223
226
value : 0 ,
224
227
data : multiStep . contract . methods . doStep ( 2 ) . encodeABI ( ) ,
225
- } ] ) . should . be . rejectedWith ( / m u s t d o t h e n e x t s t e p / ) ;
228
+ } ] , { gasLimit : defaultGasLimit } ) . should . be . rejectedWith ( / m u s t d o t h e n e x t s t e p / ) ;
226
229
227
230
( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 0 ) ;
228
231
await getTransactionCount ( ownerAccount )
@@ -248,7 +251,7 @@ function shouldSupportDifferentTransactions({
248
251
value : 0 ,
249
252
data : multiStep . contract . methods . doStep ( 3 ) . encodeABI ( ) ,
250
253
} ,
251
- ] ) . should . be . rejectedWith ( / ( p r o x y c r e a t i o n a n d ) ? t r a n s a c t i o n e x e c u t i o n e x p e c t e d t o f a i l / ) ;
254
+ ] , { gasLimit : defaultGasLimit } ) . should . be . rejectedWith ( / ( p r o x y c r e a t i o n a n d ) ? t r a n s a c t i o n e x e c u t i o n e x p e c t e d t o f a i l / ) ;
252
255
253
256
( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 0 ) ;
254
257
await getTransactionCount ( ownerAccount )
@@ -261,7 +264,7 @@ function shouldSupportDifferentTransactions({
261
264
to : multiStep . address ,
262
265
value : 0 ,
263
266
data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
264
- } ] ) ) ;
267
+ } ] , { gasLimit : defaultGasLimit } ) ) ;
265
268
} ) ;
266
269
267
270
it ( 'can execute a single transaction with a specific gas price' , async ( ) => {
@@ -278,7 +281,7 @@ function shouldSupportDifferentTransactions({
278
281
value : 0 ,
279
282
data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
280
283
} ] ,
281
- { gasPrice } ,
284
+ { gasPrice, gasLimit : defaultGasLimit } ,
282
285
) ;
283
286
const gasUsed = await getGasUsed ( txObj ) ;
284
287
@@ -311,7 +314,7 @@ function shouldSupportDifferentTransactions({
311
314
data : multiStep . contract . methods . doStep ( 2 ) . encodeABI ( ) ,
312
315
} ,
313
316
] ,
314
- { gasPrice } ,
317
+ { gasPrice, gasLimit : defaultGasLimit } ,
315
318
) ;
316
319
const gasUsed = await getGasUsed ( txObj ) ;
317
320
@@ -386,7 +389,7 @@ function shouldWorkWithWeb3(Web3, defaultAccount, safeOwner, gnosisSafeProviderB
386
389
to : idPrecompile ,
387
390
value : 0 ,
388
391
data : '0x' ,
389
- } ] ) ;
392
+ } ] , { gasLimit : defaultGasLimit } ) ;
390
393
} ) ;
391
394
392
395
shouldSupportDifferentTransactions ( {
@@ -515,7 +518,7 @@ function shouldWorkWithEthers(ethers, defaultAccount, safeOwner, gnosisSafeProvi
515
518
to : idPrecompile ,
516
519
value : 0 ,
517
520
data : '0x' ,
518
- } ] ) ;
521
+ } ] , { gasLimit : defaultGasLimit } ) ;
519
522
} ) ;
520
523
521
524
shouldSupportDifferentTransactions ( {
0 commit comments