Skip to content

Commit 135c3c0

Browse files
committed
finclude transaction cost in gas estimation
1 parent fc2c6a4 commit 135c3c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/contracts.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ var async = require('async');
77
var adjustGas = function(contract) {
88
var maxGas, adjustedGas;
99
if (contract.gas === 'auto') {
10-
if (contract.deploy) {
10+
if (contract.deploy || contract.deploy === undefined) {
1111
if (contract.gasEstimates.creation !== undefined) {
12+
// TODO: should sum it instead
1213
maxGas = Math.max(contract.gasEstimates.creation[0], contract.gasEstimates.creation[1], 500000);
1314
} else {
1415
maxGas = 500000;
@@ -17,7 +18,8 @@ var adjustGas = function(contract) {
1718
maxGas = 500000;
1819
}
1920
// TODO: put a check so it doesn't go over the block limit
20-
adjustedGas = Math.round(maxGas * 1.40);
21+
adjustedGas = Math.round(maxGas * 1.40);
22+
adjustedGas += 25000;
2123
contract.gas = adjustedGas;
2224
}
2325
};

0 commit comments

Comments
 (0)