fix: return gas per tx in error (#4858)

This commit is contained in:
rakita
2023-09-29 20:00:56 +02:00
committed by GitHub
parent ce85e17830
commit 8fd27a4b40
2 changed files with 7 additions and 1 deletions

View File

@@ -349,10 +349,11 @@ impl<'a> EVMProcessor<'a> {
// Check if gas used matches the value set in header.
if block.gas_used != cumulative_gas_used {
let receipts = Receipts::from_block_receipt(receipts);
return Err(BlockValidationError::BlockGasUsed {
got: cumulative_gas_used,
expected: block.gas_used,
gas_spent_by_tx: self.receipts.gas_spent_by_tx()?,
gas_spent_by_tx: receipts.gas_spent_by_tx()?,
}
.into())
}