Relax Trait Bounds on TransactionPool::Transaction and EthPoolTransaction (#11079)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Eric Woolsey
2024-10-04 00:34:29 -07:00
committed by GitHub
parent 84370b81d7
commit 1fe9f324b0
12 changed files with 71 additions and 71 deletions

View File

@ -1033,7 +1033,7 @@ where
has_bad_transactions = true;
} else {
// this is a new transaction that should be imported into the pool
let pool_transaction = Pool::Transaction::from_pooled(tx);
let pool_transaction = Pool::Transaction::from_pooled(tx.into());
new_txs.push(pool_transaction);
entry.insert(HashSet::from([peer_id]));
@ -1396,11 +1396,14 @@ impl PropagateTransaction {
}
/// Create a new instance from a pooled transaction
fn new<T: PoolTransaction<Consensus = TransactionSignedEcRecovered>>(
tx: Arc<ValidPoolTransaction<T>>,
) -> Self {
fn new<T>(tx: Arc<ValidPoolTransaction<T>>) -> Self
where
T: PoolTransaction<Consensus: Into<TransactionSignedEcRecovered>>,
{
let size = tx.encoded_length();
let transaction = Arc::new(tx.transaction.clone().into_consensus().into_signed());
let recovered: TransactionSignedEcRecovered =
tx.transaction.clone().into_consensus().into();
let transaction = Arc::new(recovered.into_signed());
Self { size, transaction }
}
}