diff --git a/substrate/client/transaction-pool/src/api.rs b/substrate/client/transaction-pool/src/api.rs index c2935f6e17..8979ecc7e0 100644 --- a/substrate/client/transaction-pool/src/api.rs +++ b/substrate/client/transaction-pool/src/api.rs @@ -25,23 +25,27 @@ use sc_client_api::{ light::{Fetcher, RemoteCallRequest} }; use sp_core::{H256, Blake2Hasher, Hasher}; -use sp_runtime::{generic::BlockId, traits::{self, Block as BlockT}, transaction_validity::TransactionValidity}; +use sp_runtime::{ + generic::BlockId, + traits::{Block as BlockT, BlockIdTo, ProvideRuntimeApi}, + transaction_validity::TransactionValidity, +}; use sp_transaction_pool::runtime_api::TaggedTransactionQueue; use crate::error::{self, Error}; /// The transaction pool logic for full client. -pub struct FullChainApi { - client: Arc, +pub struct FullChainApi { + client: Arc, pool: ThreadPool, _marker: PhantomData, } -impl FullChainApi where +impl FullChainApi where Block: BlockT, - T: traits::ProvideRuntimeApi + traits::BlockIdTo { + Client: ProvideRuntimeApi + BlockIdTo { /// Create new transaction pool logic. - pub fn new(client: Arc) -> Self { + pub fn new(client: Arc) -> Self { FullChainApi { client, pool: ThreadPoolBuilder::new() @@ -54,11 +58,11 @@ impl FullChainApi where } } -impl sc_transaction_graph::ChainApi for FullChainApi where +impl sc_transaction_graph::ChainApi for FullChainApi where Block: BlockT, - T: traits::ProvideRuntimeApi + traits::BlockIdTo + 'static + Send + Sync, - T::Api: TaggedTransactionQueue, - sp_api::ApiErrorFor: Send, + Client: ProvideRuntimeApi + BlockIdTo + 'static + Send + Sync, + Client::Api: TaggedTransactionQueue, + sp_api::ApiErrorFor: Send, { type Block = Block; type Hash = H256; @@ -112,19 +116,19 @@ impl sc_transaction_graph::ChainApi for FullChainApi where } /// The transaction pool logic for light client. -pub struct LightChainApi { - client: Arc, +pub struct LightChainApi { + client: Arc, fetcher: Arc, _phantom: PhantomData, } -impl LightChainApi where +impl LightChainApi where Block: BlockT, - T: HeaderBackend, + Client: HeaderBackend, F: Fetcher, { /// Create new transaction pool logic. - pub fn new(client: Arc, fetcher: Arc) -> Self { + pub fn new(client: Arc, fetcher: Arc) -> Self { LightChainApi { client, fetcher, @@ -133,9 +137,9 @@ impl LightChainApi where } } -impl sc_transaction_graph::ChainApi for LightChainApi where +impl sc_transaction_graph::ChainApi for LightChainApi where Block: BlockT, - T: HeaderBackend + 'static, + Client: HeaderBackend + 'static, F: Fetcher + 'static, { type Block = Block;