Skip to content

Commit

Permalink
chore: use inmemory size functions for tx impl (#12802)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 23, 2024
1 parent f8a88c5 commit 13786c7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use alloy_primitives::{
keccak256, Address, Bytes, ChainId, PrimitiveSignature as Signature, TxHash, TxKind, B256, U256,
};
use alloy_rlp::{Decodable, Encodable, Error as RlpError, Header};
use core::{
hash::{Hash, Hasher},
mem,
};
use core::hash::{Hash, Hasher};
use derive_more::{AsRef, Deref};
use once_cell as _;
#[cfg(not(feature = "std"))]
Expand Down Expand Up @@ -1461,7 +1458,7 @@ impl InMemorySize for TransactionSigned {
/// Calculate a heuristic for the in-memory size of the [`TransactionSigned`].
#[inline]
fn size(&self) -> usize {
mem::size_of::<TxHash>() + self.transaction.size() + mem::size_of::<Signature>()
self.hash().size() + self.transaction.size() + self.signature().size()
}
}

Expand Down

0 comments on commit 13786c7

Please sign in to comment.