Fix a bug with OpCode gas costs being incorrect or NaN

This commit is contained in:
Leonid Logvinov
2019-02-28 16:53:44 -08:00
parent 16f8339f3c
commit 808ce969d9
2 changed files with 8 additions and 4 deletions

View File

@@ -5,6 +5,10 @@
{
"note": "Fix a bug when `TruffleArtifactAdapter` wasn't correctly parsing solc config in the pre 5.0 version of trufle",
"pr": "todo"
},
{
"note": "Fix a bug when `opCodes` gas costs were incorrect or `NaN`",
"pr": "todo"
}
]
},

View File

@@ -138,12 +138,12 @@ export const utils = {
};
if (structLogs[0].depth === 1) {
// Geth uses 1-indexed depth counter whilst ganache starts from 0
normalizedStructLogs = _.map(structLogs, reduceDepthBy1);
normalizedStructLogs = _.map(structLogs, normalizeCallCost);
normalizedStructLogs = _.map(structLogs, normalizeStaticCallCost);
normalizedStructLogs = _.map(normalizedStructLogs, reduceDepthBy1);
normalizedStructLogs = _.map(normalizedStructLogs, normalizeCallCost);
normalizedStructLogs = _.map(normalizedStructLogs, normalizeStaticCallCost);
} else {
// Ganache shifts opcodes gas costs so we need to unshift them
normalizedStructLogs = _.map(structLogs, shiftGasCosts1Left);
normalizedStructLogs = _.map(normalizedStructLogs, shiftGasCosts1Left);
}
return normalizedStructLogs;
},