This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from anton-rs/refcell/hoist-optimism-tx-meta
fix: addresses review comments
- Loading branch information
Showing
6 changed files
with
73 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use reth_primitives::U256; | ||
use revm::L1BlockInfo; | ||
|
||
/// Optimism Transaction Metadata | ||
/// | ||
/// Includes the L1 fee and data gas for the tx along with the L1 | ||
/// block info. In order to pass the [OptimismTxMeta] into the | ||
/// async colored `build_transaction_receipt_with_block_receipts` | ||
/// function, a reference counter for the L1 block info is | ||
/// used so the L1 block info can be shared between receipts. | ||
#[derive(Debug, Default, Clone)] | ||
pub(crate) struct OptimismTxMeta { | ||
/// The L1 block info. | ||
pub(crate) l1_block_info: Option<L1BlockInfo>, | ||
/// The L1 fee for the block. | ||
pub(crate) l1_fee: Option<U256>, | ||
/// The L1 data gas for the block. | ||
pub(crate) l1_data_gas: Option<U256>, | ||
} | ||
|
||
impl OptimismTxMeta { | ||
/// Creates a new [OptimismTxMeta]. | ||
pub(crate) fn new( | ||
l1_block_info: Option<L1BlockInfo>, | ||
l1_fee: Option<U256>, | ||
l1_data_gas: Option<U256>, | ||
) -> Self { | ||
Self { l1_block_info, l1_fee, l1_data_gas } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters