-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[wip] feat: alloy tx type conversions back to OpTransactionSigned #14121
Conversation
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) | ||
} | ||
} | ||
)* | ||
}; | ||
} |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let (tx, hash) = tx.into_parts(); | ||
Self::new(OpTypedTransaction::Deposit(tx), TxDeposit::signature(), hash) | ||
} |
There was a problem hiding this comment.
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
let hash = if is_deposit(&transaction) { B256::ZERO } else { signature_hash(&transaction) }; | ||
|
||
Ok(Self::new(transaction, signature)) | ||
Ok(Self::new(transaction, signature, hash)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, ty
should close #13914