-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: make transaction type fields private #13915
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -673,7 +673,10 @@ mod tests { | |||||
let transaction: TransactionSigned = provider | ||||||
.transaction_by_id_unhashed(tx_id)? | ||||||
.map(|tx| { | ||||||
TransactionSigned::new_unhashed(tx.transaction, tx.signature) | ||||||
TransactionSigned::new_unhashed( | ||||||
tx.transaction().clone(), | ||||||
*tx.signature(), | ||||||
Comment on lines
+676
to
+678
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks odd, why does this require a conversion at all, in any case we need decomposition fns like reth/crates/primitives-traits/src/block/mod.rs Lines 99 to 100 in cd44fc3
|
||||||
) | ||||||
}) | ||||||
.expect("no transaction entry"); | ||||||
let signer = | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -913,7 +913,7 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
let size = transaction.size(); | ||
|
||
#[allow(unreachable_patterns)] | ||
match transaction.transaction { | ||
match transaction.transaction() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we also want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so should I change this one
with this one?
|
||
Transaction::Legacy(TxLegacy { | ||
chain_id, | ||
nonce, | ||
|
@@ -923,17 +923,17 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
value, | ||
input, | ||
}) => Ok(Self::Legacy { | ||
chain_id, | ||
chain_id: *chain_id, | ||
hash, | ||
sender, | ||
nonce, | ||
gas_price, | ||
gas_limit, | ||
to, | ||
value, | ||
input, | ||
nonce: *nonce, | ||
gas_price: *gas_price, | ||
gas_limit: *gas_limit, | ||
to: *to, | ||
value: *value, | ||
input: input.clone(), | ||
size, | ||
cost: U256::from(gas_limit) * U256::from(gas_price) + value, | ||
cost: U256::from(*gas_limit) * U256::from(*gas_price) + value, | ||
}), | ||
Transaction::Eip2930(TxEip2930 { | ||
chain_id, | ||
|
@@ -945,18 +945,18 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
input, | ||
access_list, | ||
}) => Ok(Self::Eip2930 { | ||
chain_id, | ||
chain_id: *chain_id, | ||
hash, | ||
sender, | ||
nonce, | ||
gas_price, | ||
gas_limit, | ||
to, | ||
value, | ||
input, | ||
access_list, | ||
nonce: *nonce, | ||
gas_price: *gas_price, | ||
gas_limit: *gas_limit, | ||
to: *to, | ||
value: *value, | ||
input: input.clone(), | ||
access_list: access_list.clone(), | ||
size, | ||
cost: U256::from(gas_limit) * U256::from(gas_price) + value, | ||
cost: U256::from(*gas_limit) * U256::from(*gas_price) + value, | ||
}), | ||
Transaction::Eip1559(TxEip1559 { | ||
chain_id, | ||
|
@@ -969,19 +969,19 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
input, | ||
access_list, | ||
}) => Ok(Self::Eip1559 { | ||
chain_id, | ||
chain_id: *chain_id, | ||
hash, | ||
sender, | ||
nonce, | ||
max_fee_per_gas, | ||
max_priority_fee_per_gas, | ||
gas_limit, | ||
to, | ||
value, | ||
input, | ||
access_list, | ||
nonce: *nonce, | ||
max_fee_per_gas: *max_fee_per_gas, | ||
max_priority_fee_per_gas: *max_priority_fee_per_gas, | ||
gas_limit: *gas_limit, | ||
to: *to, | ||
value: *value, | ||
input: input.clone(), | ||
access_list: access_list.clone(), | ||
size, | ||
cost: U256::from(gas_limit) * U256::from(max_fee_per_gas) + value, | ||
cost: U256::from(*gas_limit) * U256::from(*max_fee_per_gas) + value, | ||
}), | ||
Transaction::Eip4844(TxEip4844 { | ||
chain_id, | ||
|
@@ -996,21 +996,21 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
blob_versioned_hashes: _, | ||
max_fee_per_blob_gas, | ||
}) => Ok(Self::Eip4844 { | ||
chain_id, | ||
chain_id: *chain_id, | ||
hash, | ||
sender, | ||
nonce, | ||
max_fee_per_gas, | ||
max_priority_fee_per_gas, | ||
max_fee_per_blob_gas, | ||
gas_limit, | ||
to, | ||
value, | ||
input, | ||
access_list, | ||
nonce: *nonce, | ||
max_fee_per_gas: *max_fee_per_gas, | ||
max_priority_fee_per_gas: *max_priority_fee_per_gas, | ||
max_fee_per_blob_gas: *max_fee_per_blob_gas, | ||
gas_limit: *gas_limit, | ||
to: *to, | ||
value: *value, | ||
input: input.clone(), | ||
access_list: access_list.clone(), | ||
sidecar: BlobTransactionSidecar::default(), | ||
size, | ||
cost: U256::from(gas_limit) * U256::from(max_fee_per_gas) + value, | ||
cost: U256::from(*gas_limit) * U256::from(*max_fee_per_gas) + value, | ||
}), | ||
Transaction::Eip7702(TxEip7702 { | ||
chain_id, | ||
|
@@ -1024,20 +1024,20 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction { | |
authorization_list, | ||
input, | ||
}) => Ok(Self::Eip7702 { | ||
chain_id, | ||
chain_id: *chain_id, | ||
hash, | ||
sender, | ||
nonce, | ||
max_fee_per_gas, | ||
max_priority_fee_per_gas, | ||
gas_limit, | ||
to, | ||
value, | ||
input, | ||
access_list, | ||
authorization_list, | ||
nonce: *nonce, | ||
max_fee_per_gas: *max_fee_per_gas, | ||
max_priority_fee_per_gas: *max_priority_fee_per_gas, | ||
gas_limit: *gas_limit, | ||
to: *to, | ||
value: *value, | ||
input: input.clone(), | ||
access_list: access_list.clone(), | ||
authorization_list: authorization_list.clone(), | ||
size, | ||
cost: U256::from(gas_limit) * U256::from(max_fee_per_gas) + value, | ||
cost: U256::from(*gas_limit) * U256::from(*max_fee_per_gas) + value, | ||
}), | ||
tx => Err(TryFromRecoveredTransactionError::UnsupportedTransactionType(tx.ty())), | ||
} | ||
|
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 didn't require a change