mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat: add block timestamp to meta (#7460)
This commit is contained in:
@ -15,4 +15,6 @@ pub struct TransactionMeta {
|
||||
pub base_fee: Option<u64>,
|
||||
/// The excess blob gas of the block.
|
||||
pub excess_blob_gas: Option<u64>,
|
||||
/// The block's timestamp.
|
||||
pub timestamp: u64,
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@ where
|
||||
let base_fee = block.base_fee_per_gas;
|
||||
let block_hash = block.hash();
|
||||
let excess_blob_gas = block.excess_blob_gas;
|
||||
let timestamp = block.timestamp;
|
||||
let block = block.unseal();
|
||||
|
||||
#[cfg(feature = "optimism")]
|
||||
@ -100,6 +101,7 @@ where
|
||||
block_number,
|
||||
base_fee,
|
||||
excess_blob_gas,
|
||||
timestamp,
|
||||
};
|
||||
|
||||
#[cfg(feature = "optimism")]
|
||||
|
||||
@ -1741,7 +1741,7 @@ pub(crate) fn build_transaction_receipt_with_block_receipts(
|
||||
inner: log.into(),
|
||||
block_hash: Some(meta.block_hash),
|
||||
block_number: Some(meta.block_number),
|
||||
block_timestamp: None,
|
||||
block_timestamp: Some(meta.timestamp),
|
||||
transaction_hash: Some(meta.tx_hash),
|
||||
transaction_index: Some(meta.index),
|
||||
log_index: Some((num_logs + tx_log_idx) as u64),
|
||||
|
||||
@ -1608,6 +1608,7 @@ impl<TX: DbTx> TransactionsProvider for DatabaseProvider<TX> {
|
||||
block_number,
|
||||
base_fee: header.base_fee_per_gas,
|
||||
excess_blob_gas: header.excess_blob_gas,
|
||||
timestamp: header.timestamp,
|
||||
};
|
||||
|
||||
return Ok(Some((transaction, meta)))
|
||||
|
||||
@ -247,6 +247,7 @@ impl TransactionsProvider for MockEthProvider {
|
||||
block_number: block.header.number,
|
||||
base_fee: block.header.base_fee_per_gas,
|
||||
excess_blob_gas: block.header.excess_blob_gas,
|
||||
timestamp: block.header.timestamp,
|
||||
};
|
||||
return Ok(Some((tx.clone(), meta)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user