Skip to content

Commit

Permalink
Merge pull request #53 from 0xPolygonHermez/feature/tracer-gas-limit
Browse files Browse the repository at this point in the history
Apply changes from tracer cpp
  • Loading branch information
krlosMata committed Sep 30, 2022
2 parents 5fc4a9d + 3612ca1 commit 3511691
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sm/sm_main/debug/full-tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ class FullTracer {
};

//Set consumed tx gas
response.gas_used = String(Number(response.gas_left) - Number(ctx.GAS));
if(Number(ctx.GAS) > Number(response.gas_left)) {
response.gas_used = String(Number(response.gas_left));
} else {
response.gas_used = String(Number(response.gas_left) - Number(ctx.GAS));
}

response.call_trace.context.gas_used = response.gas_used;
this.accBatchGas += Number(response.gas_used);

Expand Down

0 comments on commit 3511691

Please sign in to comment.