Skip to content

Commit

Permalink
add with_base_fee for TransactionInfo (alloy-rs#721)
Browse files Browse the repository at this point in the history
* add with_base_fee for TransactionInfo

* fix clippy
  • Loading branch information
tcoratger authored and ben186 committed Jul 27, 2024
1 parent c64bfc4 commit 0fbcfe2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/rpc-types/src/eth/transaction/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ pub struct TransactionInfo {
pub base_fee: Option<u128>,
}

impl TransactionInfo {
/// Returns a new [`TransactionInfo`] with the provided base fee.
pub const fn with_base_fee(mut self, base_fee: u128) -> Self {
self.base_fee = Some(base_fee);
self
}
}

impl From<&Transaction> for TransactionInfo {
fn from(tx: &Transaction) -> Self {
Self {
Expand Down

0 comments on commit 0fbcfe2

Please sign in to comment.