Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant SignedTransaction::Signature #12185

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions crates/primitives-traits/src/transaction/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::hash::Hash;

use alloy_consensus::Transaction;
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{keccak256, Address, TxHash, B256};
use alloy_primitives::{keccak256, Address, Signature, TxHash, B256};

/// A signed transaction.
pub trait SignedTransaction:
Expand All @@ -26,17 +26,14 @@ pub trait SignedTransaction:
/// Transaction type that is signed.
type Transaction: Transaction;

/// Signature type that results from signing transaction.
type Signature;

/// Returns reference to transaction hash.
fn tx_hash(&self) -> &TxHash;

/// Returns reference to transaction.
fn transaction(&self) -> &Self::Transaction;

/// Returns reference to signature.
fn signature(&self) -> &Self::Signature;
fn signature(&self) -> &Signature;

/// Recover signer from signature and hash.
///
Expand All @@ -59,10 +56,8 @@ pub trait SignedTransaction:
/// Create a new signed transaction from a transaction and its signature.
///
/// This will also calculate the transaction hash using its encoding.
fn from_transaction_and_signature(
transaction: Self::Transaction,
signature: Self::Signature,
) -> Self;
fn from_transaction_and_signature(transaction: Self::Transaction, signature: Signature)
-> Self;

/// Calculate transaction hash, eip2728 transaction does not contain rlp header and start with
/// tx type.
Expand Down
Loading