Skip to content

Commit 28d6996

Browse files
authored
feat: add helper method to eth validator (#20206)
1 parent 0eaffdf commit 28d6996

File tree

1 file changed

+14
-0
lines changed
  • crates/transaction-pool/src/validate

1 file changed

+14
-0
lines changed

crates/transaction-pool/src/validate/eth.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,20 @@ where
247247
}
248248
}
249249

250+
/// Validates a single transaction with the provided state provider.
251+
pub fn validate_one_with_state_provider(
252+
&self,
253+
origin: TransactionOrigin,
254+
transaction: Tx,
255+
state: impl AccountInfoReader,
256+
) -> TransactionValidationOutcome<Tx> {
257+
let tx = match self.validate_one_no_state(origin, transaction) {
258+
Ok(tx) => tx,
259+
Err(invalid_outcome) => return invalid_outcome,
260+
};
261+
self.validate_one_against_state(origin, tx, state)
262+
}
263+
250264
/// Performs stateless validation on single transaction. Returns unaltered input transaction
251265
/// if all checks pass, so transaction can continue through to stateful validation as argument
252266
/// to [`validate_one_against_state`](Self::validate_one_against_state).

0 commit comments

Comments
 (0)