-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: impl TryFrom<reth_rpc_types::Transaction> for Transaction #7551
Conversation
} | ||
Some(3u8) => { | ||
// EIP-4844 | ||
Ok(Transaction::Eip4844(TxEip4844 { |
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.
3u8 should be the type for Eip4844? The document here should be updated?
https://github.com/alloy-rs/alloy/blob/main/crates/rpc-types/src/eth/transaction/mod.rs#L106C5-L116C38
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.
yes, please update those docs
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.
lgtm
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, a few pedantic nits,
Ok(Transaction::Legacy(TxLegacy { | ||
chain_id: tx.chain_id, | ||
nonce: tx.nonce, | ||
gas_price: tx.gas_price.ok_or(ConversionError::MissingGasPrice)?, |
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 is a bit dangerous, because gasprice is commonly set for all tx types, so this match arm should check if there are any 1559 fields present, if so return an error
|
||
fn try_from(tx: reth_rpc_types::Transaction) -> Result<Self, Self::Error> { | ||
match tx.transaction_type { | ||
None => { |
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.
None => { | |
None | Some(0u8) => { |
value: tx.value, | ||
access_list: tx.access_list.ok_or(ConversionError::MissingAccessList)?.into(), | ||
input: tx.input, | ||
blob_versioned_hashes: tx.blob_versioned_hashes.unwrap_or_default(), |
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 also be an error ref alloy-rs/alloy#506
also need to update evm-inspector rev pin... |
close #7214