mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: cut down on tx_type usage (#13287)
This commit is contained in:
@ -54,7 +54,7 @@ impl OpTransactionSigned {
|
||||
/// Calculates hash of given transaction and signature and returns new instance.
|
||||
pub fn new(transaction: OpTypedTransaction, signature: Signature) -> Self {
|
||||
let signed_tx = Self::new_unhashed(transaction, signature);
|
||||
if !matches!(signed_tx.tx_type(), OpTxType::Deposit) {
|
||||
if signed_tx.ty() != OpTxType::Deposit {
|
||||
signed_tx.hash.get_or_init(|| signed_tx.recalculate_hash());
|
||||
}
|
||||
|
||||
@ -246,9 +246,10 @@ impl alloy_rlp::Decodable for OpTransactionSigned {
|
||||
|
||||
impl Encodable2718 for OpTransactionSigned {
|
||||
fn type_flag(&self) -> Option<u8> {
|
||||
match self.tx_type() {
|
||||
op_alloy_consensus::OpTxType::Legacy => None,
|
||||
tx_type => Some(tx_type as u8),
|
||||
if Typed2718::is_legacy(self) {
|
||||
None
|
||||
} else {
|
||||
Some(self.ty())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user