mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
fix: Exclude system tx from gas_used, expose is_system_transaction
This commit is contained in:
@ -22,7 +22,7 @@ use revm::{
|
||||
DatabaseCommit,
|
||||
};
|
||||
|
||||
fn is_system_transaction(tx: &TransactionSigned) -> bool {
|
||||
pub fn is_system_transaction(tx: &TransactionSigned) -> bool {
|
||||
let Some(gas_price) = tx.gas_price() else {
|
||||
return false;
|
||||
};
|
||||
@ -143,7 +143,9 @@ where
|
||||
let ResultAndState { result, mut state } = result_and_state;
|
||||
f(&result);
|
||||
let gas_used = result.gas_used();
|
||||
self.gas_used += gas_used;
|
||||
if !is_system_transaction(tx.tx()) {
|
||||
self.gas_used += gas_used;
|
||||
}
|
||||
self.receipts
|
||||
.push(self.receipt_builder.build_receipt(ReceiptBuilderCtx {
|
||||
tx: tx.tx(),
|
||||
|
||||
Reference in New Issue
Block a user