Skip to content

Commit

Permalink
Merge pull request #62 from 0xPolygonHermez/fix/ft-change-depth-gas-cost
Browse files Browse the repository at this point in the history
fix gas cost when deeper context
  • Loading branch information
krlosMata committed Jan 25, 2024
2 parents 6deb34b + 2f63c84 commit d8ca5c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sm/sm_main/debug/full-tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ class FullTracer {
prevTraceCall.gas_cost = String(Number(prevTraceCall.gas) - Number(gasCTX));
} else if (prevTraceCall.depth !== singleInfo.depth) {
// Means opcode failed with error (ex: oog, invalidStaticTx...)
prevTraceCall.gas_cost = prevTraceCall.gas;
if (prevTraceCall.error !== '') {
prevTraceCall.gas_cost = prevTraceCall.gas;
}
} else {
prevTraceCall.gas_cost = String(gasCost);
}
Expand Down

0 comments on commit d8ca5c8

Please sign in to comment.