Skip to main content

ValidatingPool

Trait ValidatingPool 

Source
pub trait ValidatingPool: TransactionPool {
    type Validator: TransactionValidator<Transaction = Self::Transaction>;

    // Required method
    fn validator(&self) -> &Self::Validator;

    // Provided method
    fn validate(
        &self,
        origin: TransactionOrigin,
        transaction: Self::Transaction,
    ) -> impl Future<Output = TransactionValidationOutcome<Self::Transaction>> + Send { ... }
}
Expand description

Extension for TransactionPool that exposes the pool’s underlying TransactionValidator.

This is implemented by pools that validate transactions through a single validator before insertion (e.g. Pool). It lets consumers and wrapper pools reach the validator directly, for example to validate a transaction without inserting it into the pool.

Required Associated Types§

Source

type Validator: TransactionValidator<Transaction = Self::Transaction>

The validator used to validate transactions before they are inserted into the pool.

Required Methods§

Source

fn validator(&self) -> &Self::Validator

Returns a reference to the pool’s transaction validator.

Provided Methods§

Source

fn validate( &self, origin: TransactionOrigin, transaction: Self::Transaction, ) -> impl Future<Output = TransactionValidationOutcome<Self::Transaction>> + Send

Validates the given transaction without inserting it into the pool.

This is a convenience wrapper around TransactionValidator::validate_transaction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§