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

chore(sdk): impl SignedTransaction for TransactionSigned #12187

Merged
merged 4 commits into from
Nov 10, 2024

Conversation

emhane
Copy link
Member

@emhane emhane commented Oct 30, 2024

Closes #12169

Implements SignedTransaction for TransactionSigned, treating TransactionSigned as an l1 type only

@emhane emhane added the A-sdk Related to reth's use as a library label Oct 30, 2024
@emhane emhane changed the base branch from main to emhane/signed-tx-trait-sig October 30, 2024 09:22
Base automatically changed from emhane/signed-tx-trait-sig to main November 1, 2024 12:03
@emhane emhane requested a review from mattsse November 4, 2024 06:22
signature: Signature,
) -> Self {
Self::from_transaction_and_signature(transaction, signature)
fn from_transaction_and_signature(transaction: Transaction, signature: Signature) -> Self {
Copy link
Collaborator

@joshieDo joshieDo Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add some version of this with hash? recalculating the hash seems wasteful. i took a peek at the codebase and it seems like we do this even when the type already has an hash . eg

impl TryFrom<WithOtherFields<alloy_rpc_types::Transaction>> for TransactionSigned {

or adding a maybe_tx_hash() -> Option<TxHash> to the trait, that can be checked here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely! nice find, think it doesn't fit in scope of this refactor pr though, please open a perf issue for this

@emhane emhane added this pull request to the merge queue Nov 10, 2024
Merged via the queue into main with commit 3774100 Nov 10, 2024
40 checks passed
@emhane emhane deleted the emhane/impl-signed-tx branch November 10, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement SignedTransaction for Transaction
3 participants