chore: relax tryfrom error (#12735)

This commit is contained in:
Matthias Seitz
2024-11-21 12:08:07 +01:00
committed by GitHub
parent c2e6938606
commit d00920c421

View File

@ -5,7 +5,7 @@ use alloy_primitives::B256;
use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};
use derive_more::{Constructor, Deref, IntoIterator};
use reth_codecs_derive::add_arbitrary_tests;
use reth_primitives::{transaction::TransactionConversionError, PooledTransactionsElement};
use reth_primitives::PooledTransactionsElement;
/// A list of transaction hashes that the peer would like transaction bodies for.
#[derive(Clone, Debug, PartialEq, Eq, RlpEncodableWrapper, RlpDecodableWrapper, Default)]
@ -60,9 +60,9 @@ impl<T: Encodable2718> PooledTransactions<T> {
impl<T, U> TryFrom<Vec<U>> for PooledTransactions<T>
where
T: TryFrom<U, Error = TransactionConversionError>,
T: TryFrom<U>,
{
type Error = TransactionConversionError;
type Error = T::Error;
fn try_from(txs: Vec<U>) -> Result<Self, Self::Error> {
txs.into_iter().map(T::try_from).collect()