transaction_pool/
verifier.rs

1// Copyright 2020 Parity Technologies
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use crate::VerifiedTransaction;
10
11/// Transaction verification.
12///
13/// Verifier is responsible to decide if the transaction should even be considered for pool inclusion.
14pub trait Verifier<U> {
15	/// Verification error.
16	type Error;
17
18	/// Verified transaction.
19	type VerifiedTransaction: VerifiedTransaction;
20
21	/// Verifies a `UnverifiedTransaction` and produces `VerifiedTransaction` instance.
22	fn verify_transaction(&self, tx: U) -> Result<Self::VerifiedTransaction, Self::Error>;
23}