Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Jan 5, 2025
1 parent 65f4cb6 commit d6affd8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/consensus/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ alloy-eips.workspace = true
[dev-dependencies]
alloy-consensus.workspace = true
reth-storage-api.workspace = true
reth-ethereum-primitives.workspace = true
rand.workspace = true
mockall = "0.13"

3 changes: 2 additions & 1 deletion crates/consensus/common/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ mod tests {
use mockall::mock;
use rand::Rng;
use reth_chainspec::ChainSpecBuilder;
use reth_primitives::{proofs, Account, BlockBody, Transaction, TransactionSigned};
use reth_ethereum_primitives::{Transaction, TransactionSigned};
use reth_primitives::{proofs, Account, BlockBody};
use reth_storage_api::{
errors::provider::ProviderResult, AccountReader, HeaderProvider, WithdrawalsProvider,
};
Expand Down
9 changes: 9 additions & 0 deletions crates/ethereum/primitives/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,15 @@ impl PartialEq for TransactionSigned {
}
}

impl TransactionSigned {
/// Creates a new signed transaction from the given transaction and signature without the hash.
///
/// Note: this only calculates the hash on the first [`TransactionSigned::hash`] call.
pub fn new_unhashed(transaction: Transaction, signature: Signature) -> Self {
Self { hash: Default::default(), signature, transaction }
}
}

impl Typed2718 for TransactionSigned {
fn ty(&self) -> u8 {
self.transaction.ty()
Expand Down
11 changes: 0 additions & 11 deletions crates/primitives/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,17 +779,6 @@ impl From<TypedTransaction> for Transaction {
}

/// Signed transaction.
///
/// # Deprecation Notice
///
/// This type will be deprecated in favor of the Ethereum-specific type from reth-ethereum-primitives.
/// New code should use `reth_ethereum_primitives::Transaction` instead.
///
/// This type is currently used as a default transaction type in several places:
/// - As the default Block transaction type
/// - In testing code
///
/// These usages will be gradually migrated to use the Ethereum-specific type.
#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::add_arbitrary_tests(rlp))]
#[derive(Debug, Clone, Eq, AsRef, Deref, Serialize, Deserialize)]
pub struct TransactionSigned {
Expand Down

0 comments on commit d6affd8

Please sign in to comment.