mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: Cleanup diffs before changes
This commit is contained in:
@ -332,9 +332,9 @@ impl Hash for TransactionSigned {
|
|||||||
|
|
||||||
impl PartialEq for TransactionSigned {
|
impl PartialEq for TransactionSigned {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
self.signature == other.signature
|
self.signature == other.signature &&
|
||||||
&& self.transaction == other.transaction
|
self.transaction == other.transaction &&
|
||||||
&& self.tx_hash() == other.tx_hash()
|
self.tx_hash() == other.tx_hash()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,13 +582,13 @@ impl<'a> arbitrary::Arbitrary<'a> for TransactionSigned {
|
|||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Ok(Self { transaction, signature, ..Default::default() })
|
Ok(Self { transaction, signature, hash: Default::default() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InMemorySize for TransactionSigned {
|
impl InMemorySize for TransactionSigned {
|
||||||
fn size(&self) -> usize {
|
fn size(&self) -> usize {
|
||||||
let Self { hash: _, signature, transaction, .. } = self;
|
let Self { hash: _, signature, transaction } = self;
|
||||||
self.tx_hash().size() + signature.size() + transaction.size()
|
self.tx_hash().size() + signature.size() + transaction.size()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -617,26 +617,26 @@ impl Decodable2718 for TransactionSigned {
|
|||||||
TxType::Legacy => Err(Eip2718Error::UnexpectedType(0)),
|
TxType::Legacy => Err(Eip2718Error::UnexpectedType(0)),
|
||||||
TxType::Eip2930 => {
|
TxType::Eip2930 => {
|
||||||
let (tx, signature) = TxEip2930::rlp_decode_with_signature(buf)?;
|
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 => {
|
TxType::Eip1559 => {
|
||||||
let (tx, signature) = TxEip1559::rlp_decode_with_signature(buf)?;
|
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 => {
|
TxType::Eip4844 => {
|
||||||
let (tx, signature) = TxEip4844::rlp_decode_with_signature(buf)?;
|
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 => {
|
TxType::Eip7702 => {
|
||||||
let (tx, signature) = TxEip7702::rlp_decode_with_signature(buf)?;
|
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> {
|
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self> {
|
||||||
let (tx, signature) = TxLegacy::rlp_decode_with_signature(buf)?;
|
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() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ where
|
|||||||
request: TransactionRequest,
|
request: TransactionRequest,
|
||||||
) -> Result<TransactionSigned, Self::Error> {
|
) -> Result<TransactionSigned, Self::Error> {
|
||||||
let Ok(tx) = request.build_typed_tx() else {
|
let Ok(tx) = request.build_typed_tx() else {
|
||||||
return Err(EthApiError::TransactionConversionError);
|
return Err(EthApiError::TransactionConversionError)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create an empty signature for the transaction.
|
// Create an empty signature for the transaction.
|
||||||
|
|||||||
Reference in New Issue
Block a user