@@ -96,6 +96,26 @@ This is because the instrumentation process increases the gas costs for using th
9696the extra events. If this is the case, then the coverage may be incomplete. To avoid this, using
9797` estimateGas ` to estimate your gas costs should be more resilient in most cases.
9898
99+ Example (in a Truffle test):
100+ ``` javascript
101+ // Hardcoded Gas Call
102+ MyContract .deployed ().then (instance => {
103+ instance .claimTokens (0 , {gasLimit: 3000000 }).then (() => {
104+ assert (web3 .eth .getBalance (instance .address ).equals (new BigNumber (' 0' )))
105+ done ();
106+ })
107+ });
108+
109+ // Using gas estimation
110+ MyContract .deployed ().then (instance => {
111+ const data = instance .contract .claimTokens .getData (0 );
112+ const gasEstimate = web3 .eth .estimateGas ({to: instance .address , data: data});
113+ instance .claimTokens (0 , {gasLimit: gasEstimate}).then (() => {
114+ assert (web3 .eth .getBalance (instance .address ).equals (new BigNumber (' 0' )))
115+ done ();
116+ })
117+ });
118+ ```
99119** Using ` require ` in ` migrations.js ` files** : Truffle overloads Node's ` require ` function but
100120implements a simplified search algorithm for node_modules packages
101121([ see Truffle issue #383 ] ( https://github.com/trufflesuite/truffle/issues/383 ) ).
@@ -117,12 +137,12 @@ find discrepancies between the coverage report and your suite's behavior, please
117137+ ** metacoin** : The default truffle project
118138 + [ HTML reports] ( https://sc-forks.github.io/metacoin/ )
119139 + [ Metacoin with solidity-coverage installed] ( https://github.com/sc-forks/metacoin ) (simple, without configuration)
120- + ** zeppelin-solidity** at commit 453a19825013a586751b87c67bebd551a252fb50
121- + [ HTML reports] ( https://sc-forks.github.io/zeppelin-solidity/ )
122- + [ Zeppelin with solidity-coverage installed] ( https://github.com/sc-forks/zeppelin-solidity ) (declares own coverage network in truffle.js)
123- + ** numeraire** at commit 5ac3fa432c6b4192468c95a66e52ca086c804c95
124- + [ HTML reports] ( https://sc-forks.github.io/contract/ )
125- + [ Numeraire with solidity-coverage installed] ( https://github.com/sc-forks/contract ) (uses .solcover.js)
140+ + ** zeppelin-solidity** at commit [ 453a198 ] ( https://github.com/OpenZeppelin/zeppelin-solidity/tree/ 453a19825013a586751b87c67bebd551a252fb50)
141+ + [ HTML reports] ( https://sc-forks.github.io/zeppelin-solidity/ ) (declares own coverage network in truffle.js)
142+ + [ Zeppelin with solidity-coverage installed] ( https://github.com/sc-forks/zeppelin-solidity )
143+ + ** numeraire** at commit [ 695b0a0 ] ( https://github.com/numerai/contract/tree/695b0a073c1f70199138f5e988e8cc20382205a4 ) (uses .solcover.js)
144+ + [ HTML reports] ( https://sc-forks.github.io/contract/contracts/index.html )
145+ + [ Numeraire with solidity-coverage installed] ( https://github.com/sc-forks/contract )
126146
127147### Contribution Guidelines
128148
0 commit comments