From 0fbcfe2a0c239630057555c8fcf8d8f2d12bc47a Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Fri, 10 May 2024 18:41:33 +0200 Subject: [PATCH] add `with_base_fee` for `TransactionInfo` (#721) * add with_base_fee for TransactionInfo * fix clippy --- crates/rpc-types/src/eth/transaction/common.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/rpc-types/src/eth/transaction/common.rs b/crates/rpc-types/src/eth/transaction/common.rs index 0f4969ae274..0d6d4e84039 100644 --- a/crates/rpc-types/src/eth/transaction/common.rs +++ b/crates/rpc-types/src/eth/transaction/common.rs @@ -19,6 +19,14 @@ pub struct TransactionInfo { pub base_fee: Option, } +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 {