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

[wip] feat: alloy tx type conversions back to OpTransactionSigned #14121

Merged
merged 4 commits into from
Feb 1, 2025

Conversation

stevencartavia
Copy link
Contributor

should close #13914

@emhane emhane added A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library labels Jan 31, 2025
Comment on lines 34 to 45
macro_rules! impl_from_signed {
($($tx:ident),*) => {
$(
impl From<Signed<$tx>> for OpTransactionSigned {
fn from(value: Signed<$tx>) -> Self {
let(tx,sig,hash) = value.into_parts();
Self::new(tx.into(), sig, hash)
}
}
)*
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I want this below the struct def and impl

let (tx, hash) = tx.into_parts();
Self::new(OpTypedTransaction::Deposit(tx), TxDeposit::signature(), hash)
}
_ => panic!("Invalid OpTxEnvelope variant"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 169 to 171
let (tx, hash) = tx.into_parts();
Self::new(OpTypedTransaction::Deposit(tx), TxDeposit::signature(), hash)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

for this we can add a from Sealed<TxDeposit> impl

Comment on lines 608 to 610
let hash = if is_deposit(&transaction) { B256::ZERO } else { signature_hash(&transaction) };

Ok(Self::new(transaction, signature))
Ok(Self::new(transaction, signature, hash))
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should use new_unhashed instead

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool, ty

@mattsse mattsse marked this pull request as ready for review February 1, 2025 07:41
@mattsse mattsse enabled auto-merge February 1, 2025 07:41
@mattsse mattsse added this pull request to the merge queue Feb 1, 2025
Merged via the queue into paradigmxyz:main with commit 3d72151 Feb 1, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-reth Related to Optimism and op-reth A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add alloy tx type conversions back
3 participants