Skip to content

Commit f3a9871

Browse files
yann300axic
authored andcommitted
Fix gas estimation translation for older compilers
1 parent ac8b1bc commit f3a9871

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

translate.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ function translateJsonCompilerOutput (output) {
6060
var contractInput = output['contracts'][contract];
6161

6262
var gasEstimates = contractInput['gasEstimates'];
63+
// FIXME: support undefined or a nicer way in translateGasEstimates
64+
if (!gasEstimates['creation']) {
65+
gasEstimates['creation'] = [ null, null ];
66+
}
67+
if (!gasEstimates['internal']) {
68+
gasEstimates['internal'] = null;
69+
}
70+
if (!gasEstimates['external']) {
71+
gasEstimates['external'] = null;
72+
}
6373

6474
var contractOutput = {
6575
'abi': JSON.parse(contractInput['interface']),

0 commit comments

Comments
 (0)