@@ -20,6 +20,9 @@ const MultiSend = artifacts.require('MultiSend');
2020const DefaultCallbackHandler = artifacts . require ( 'DefaultCallbackHandler' ) ;
2121const ProxyFactory = artifacts . require ( 'ProxyFactory' ) ;
2222const 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' ;
2326
2427const toConfirmationPromise = ( promiEvent ) => new Promise (
2528 ( resolve , reject ) => promiEvent . on ( 'confirmation' ,
@@ -98,7 +101,7 @@ function shouldSupportDifferentTransactions({
98101 to : multiStep . address ,
99102 value : 0 ,
100103 data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
101- } ] ) ;
104+ } ] , { gasLimit : defaultGasLimit } ) ;
102105 ( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 1 ) ;
103106 } ) ;
104107
@@ -117,7 +120,7 @@ function shouldSupportDifferentTransactions({
117120 value : 0 ,
118121 data : multiStep . contract . methods . doStep ( 2 ) . encodeABI ( ) ,
119122 } ,
120- ] ) ;
123+ ] , { gasLimit : defaultGasLimit } ) ;
121124 ( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 2 ) ;
122125 } ) ;
123126
@@ -149,7 +152,7 @@ function shouldSupportDifferentTransactions({
149152 value : 0 ,
150153 data : multiStep . contract . methods . doERC20Step ( 2 , erc20 . address ) . encodeABI ( ) ,
151154 } ,
152- ] ) ;
155+ ] , { gasLimit : defaultGasLimit } ) ;
153156
154157 ( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 2 ) ;
155158
@@ -201,7 +204,7 @@ function shouldSupportDifferentTransactions({
201204 `${ 1e18 } ` ,
202205 ) . encodeABI ( ) ,
203206 } ,
204- ] ) ;
207+ ] , { gasLimit : defaultGasLimit } ) ;
205208
206209 if ( cpk . address === proxyOwner ) {
207210 fromWei ( await erc20 . balanceOf ( cpk . address ) ) . should . equal ( 99 ) ;
@@ -222,7 +225,7 @@ function shouldSupportDifferentTransactions({
222225 to : multiStep . address ,
223226 value : 0 ,
224227 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 / ) ;
226229
227230 ( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 0 ) ;
228231 await getTransactionCount ( ownerAccount )
@@ -248,7 +251,7 @@ function shouldSupportDifferentTransactions({
248251 value : 0 ,
249252 data : multiStep . contract . methods . doStep ( 3 ) . encodeABI ( ) ,
250253 } ,
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 / ) ;
252255
253256 ( await multiStep . lastStepFinished ( cpk . address ) ) . toNumber ( ) . should . equal ( 0 ) ;
254257 await getTransactionCount ( ownerAccount )
@@ -261,7 +264,7 @@ function shouldSupportDifferentTransactions({
261264 to : multiStep . address ,
262265 value : 0 ,
263266 data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
264- } ] ) ) ;
267+ } ] , { gasLimit : defaultGasLimit } ) ) ;
265268 } ) ;
266269
267270 it ( 'can execute a single transaction with a specific gas price' , async ( ) => {
@@ -278,7 +281,7 @@ function shouldSupportDifferentTransactions({
278281 value : 0 ,
279282 data : multiStep . contract . methods . doStep ( 1 ) . encodeABI ( ) ,
280283 } ] ,
281- { gasPrice } ,
284+ { gasPrice, gasLimit : defaultGasLimit } ,
282285 ) ;
283286 const gasUsed = await getGasUsed ( txObj ) ;
284287
@@ -311,7 +314,7 @@ function shouldSupportDifferentTransactions({
311314 data : multiStep . contract . methods . doStep ( 2 ) . encodeABI ( ) ,
312315 } ,
313316 ] ,
314- { gasPrice } ,
317+ { gasPrice, gasLimit : defaultGasLimit } ,
315318 ) ;
316319 const gasUsed = await getGasUsed ( txObj ) ;
317320
@@ -386,7 +389,7 @@ function shouldWorkWithWeb3(Web3, defaultAccount, safeOwner, gnosisSafeProviderB
386389 to : idPrecompile ,
387390 value : 0 ,
388391 data : '0x' ,
389- } ] ) ;
392+ } ] , { gasLimit : defaultGasLimit } ) ;
390393 } ) ;
391394
392395 shouldSupportDifferentTransactions ( {
@@ -515,7 +518,7 @@ function shouldWorkWithEthers(ethers, defaultAccount, safeOwner, gnosisSafeProvi
515518 to : idPrecompile ,
516519 value : 0 ,
517520 data : '0x' ,
518- } ] ) ;
521+ } ] , { gasLimit : defaultGasLimit } ) ;
519522 } ) ;
520523
521524 shouldSupportDifferentTransactions ( {
0 commit comments