chore: Cleanup diffs before changes

This commit is contained in:
sprites0
2025-04-16 04:19:51 +00:00
parent 6d639b3726
commit 9805589e7b
2 changed files with 11 additions and 11 deletions

View File

@ -332,9 +332,9 @@ impl Hash for TransactionSigned {
impl PartialEq for TransactionSigned {
fn eq(&self, other: &Self) -> bool {
self.signature == other.signature
&& self.transaction == other.transaction
&& self.tx_hash() == other.tx_hash()
self.signature == other.signature &&
self.transaction == other.transaction &&
self.tx_hash() == other.tx_hash()
}
}
@ -582,13 +582,13 @@ impl<'a> arbitrary::Arbitrary<'a> for TransactionSigned {
)
.unwrap();
Ok(Self { transaction, signature, ..Default::default() })
Ok(Self { transaction, signature, hash: Default::default() })
}
}
impl InMemorySize for TransactionSigned {
fn size(&self) -> usize {
let Self { hash: _, signature, transaction, .. } = self;
let Self { hash: _, signature, transaction } = self;
self.tx_hash().size() + signature.size() + transaction.size()
}
}
@ -617,26 +617,26 @@ impl Decodable2718 for TransactionSigned {
TxType::Legacy => Err(Eip2718Error::UnexpectedType(0)),
TxType::Eip2930 => {
let (tx, signature) = TxEip2930::rlp_decode_with_signature(buf)?;
Ok(Self { transaction: Transaction::Eip2930(tx), signature, ..Default::default() })
Ok(Self { transaction: Transaction::Eip2930(tx), signature, hash: Default::default() })
}
TxType::Eip1559 => {
let (tx, signature) = TxEip1559::rlp_decode_with_signature(buf)?;
Ok(Self { transaction: Transaction::Eip1559(tx), signature, ..Default::default() })
Ok(Self { transaction: Transaction::Eip1559(tx), signature, hash: Default::default() })
}
TxType::Eip4844 => {
let (tx, signature) = TxEip4844::rlp_decode_with_signature(buf)?;
Ok(Self { transaction: Transaction::Eip4844(tx), signature, ..Default::default() })
Ok(Self { transaction: Transaction::Eip4844(tx), signature, hash: Default::default() })
}
TxType::Eip7702 => {
let (tx, signature) = TxEip7702::rlp_decode_with_signature(buf)?;
Ok(Self { transaction: Transaction::Eip7702(tx), signature, ..Default::default() })
Ok(Self { transaction: Transaction::Eip7702(tx), signature, hash: Default::default() })
}
}
}
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self> {
let (tx, signature) = TxLegacy::rlp_decode_with_signature(buf)?;
Ok(Self { transaction: Transaction::Legacy(tx), signature, ..Default::default() })
Ok(Self { transaction: Transaction::Legacy(tx), signature, hash: Default::default() })
}
}

View File

@ -72,7 +72,7 @@ where
request: TransactionRequest,
) -> Result<TransactionSigned, Self::Error> {
let Ok(tx) = request.build_typed_tx() else {
return Err(EthApiError::TransactionConversionError);
return Err(EthApiError::TransactionConversionError)
};
// Create an empty signature for the transaction.