Skip to content

Commit

Permalink
Fix gas used in transactions (#458)
Browse files Browse the repository at this point in the history
* fix: execution now uses gas_used from transaction receipt

* fix: gas used on csv_exporter
  • Loading branch information
brunoantonieto-cw authored Mar 27, 2024
1 parent 9928421 commit 3847c19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/eth/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ impl EthExecutor {
Ok((mut execution, execution_metrics)) => {
// apply execution costs that were not consided when re-executing the transaction
execution.apply_execution_costs(&receipt)?;
execution.gas = receipt.gas_used.unwrap_or_default().try_into()?;

// ensure it matches receipt before saving
if let Err(e) = execution.compare_with_receipt(&receipt) {
Expand Down
2 changes: 1 addition & 1 deletion src/eth/storage/csv/csv_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl CsvExporter {
tx.input.to.map(to_bytea).unwrap_or_default(), // address_to
to_bytea(tx.input.input), // input
to_bytea(tx.execution.output), // output
tx.input.gas_limit.to_string(), // gas
tx.execution.gas.to_string(), // gas
tx.input.gas_price.to_string(), // gas_price
tx.transaction_index.to_string(), // idx_in_block
tx.block_number.to_string(), // block_number
Expand Down

0 comments on commit 3847c19

Please sign in to comment.