From 34bc4983e788c529dd5a50cdbf226e043c9b3b1c Mon Sep 17 00:00:00 2001 From: DoTheBestToGetTheBest <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:02:24 -0700 Subject: [PATCH] Adding EthTransactionValidator::validate_all function (#5006) Co-authored-by: Matthias Seitz --- crates/transaction-pool/src/validate/eth.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/transaction-pool/src/validate/eth.rs b/crates/transaction-pool/src/validate/eth.rs index fa9a8a538..3a0af31ba 100644 --- a/crates/transaction-pool/src/validate/eth.rs +++ b/crates/transaction-pool/src/validate/eth.rs @@ -48,6 +48,18 @@ where ) -> TransactionValidationOutcome { self.inner.validate_one(origin, transaction) } + + /// Validates all given transactions. + /// + /// Returns all outcomes for the given transactions in the same order. + /// + /// See also [Self::validate_one] + pub fn validate_all( + &self, + transaction: Vec<(TransactionOrigin, Tx)>, + ) -> Vec> { + transaction.into_iter().map(|(origin, tx)| self.validate_one(origin, tx)).collect() + } } #[async_trait::async_trait]