Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make TransactionValidationTaskExecutor generic over V #4331

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions crates/transaction-pool/src/validate/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
};
use futures_util::{lock::Mutex, StreamExt};
use reth_primitives::{ChainSpec, SealedBlock};
use reth_provider::StateProviderFactory;
use reth_tasks::TaskSpawner;
use std::{future::Future, pin::Pin, sync::Arc};
use tokio::{
Expand Down Expand Up @@ -134,7 +133,7 @@ impl<Client, Tx> TransactionValidationTaskExecutor<EthTransactionValidator<Clien
}
}

impl<V: TransactionValidator + Clone> TransactionValidationTaskExecutor<V> {
impl<V> TransactionValidationTaskExecutor<V> {
/// Creates a new executor instance with the given validator for transaction validation.
///
/// Initializes the executor with the provided validator and sets up communication for
Expand All @@ -146,13 +145,11 @@ impl<V: TransactionValidator + Clone> TransactionValidationTaskExecutor<V> {
}

#[async_trait::async_trait]
impl<Client, Tx> TransactionValidator
for TransactionValidationTaskExecutor<EthTransactionValidator<Client, Tx>>
impl<V> TransactionValidator for TransactionValidationTaskExecutor<V>
where
Client: StateProviderFactory + Clone + 'static,
Tx: PoolTransaction + Clone + 'static,
V: TransactionValidator + Clone + 'static,
{
type Transaction = Tx;
type Transaction = <V as TransactionValidator>::Transaction;

async fn validate_transaction(
&self,
Expand Down
Loading