diff --git a/crates/consensus/src/pure/eip4844.rs b/crates/consensus/src/pure/eip4844.rs index de92abb825d..8d8c52514a9 100644 --- a/crates/consensus/src/pure/eip4844.rs +++ b/crates/consensus/src/pure/eip4844.rs @@ -7,7 +7,7 @@ use crate::constants::eip4844::{ /// See also [the EIP-4844 helpers](https://eips.ethereum.org/EIPS/eip-4844#helpers /// (`calc_excess_blob_gas`). #[inline] -pub fn calc_excess_blob_gas(parent_excess_blob_gas: u64, parent_blob_gas_used: u64) -> u64 { +pub const fn calc_excess_blob_gas(parent_excess_blob_gas: u64, parent_blob_gas_used: u64) -> u64 { (parent_excess_blob_gas + parent_blob_gas_used).saturating_sub(TARGET_DATA_GAS_PER_BLOCK) } diff --git a/crates/consensus/src/transaction/common.rs b/crates/consensus/src/transaction/common.rs index 532ff57f301..471faead6a6 100644 --- a/crates/consensus/src/transaction/common.rs +++ b/crates/consensus/src/transaction/common.rs @@ -14,7 +14,7 @@ pub enum TxKind { impl TxKind { /// Returns the address of the contract that will be called or will receive the transfer. - pub fn to(self) -> Option
{ + pub const fn to(self) -> Option { match self { TxKind::Create => None, TxKind::Call(to) => Some(to), @@ -23,19 +23,19 @@ impl TxKind { /// Returns true if the transaction is a contract creation. #[inline] - pub fn is_create(self) -> bool { + pub const fn is_create(self) -> bool { matches!(self, TxKind::Create) } /// Returns true if the transaction is a contract call. #[inline] - pub fn is_call(self) -> bool { + pub const fn is_call(self) -> bool { matches!(self, TxKind::Call(_)) } /// Calculates a heuristic for the in-memory size of the [TransactionKind]. #[inline] - pub(crate) fn size(self) -> usize { + pub(crate) const fn size(self) -> usize { std::mem::size_of::