Add transaction pool to Aura and Babe import queue (#3225)

* Add transaction pool to babe import queue

* Add transaction pool to Babe check header

* Fix tests

* Add tx pool to Aura import_queue

* Fix tests, node-template

* Add comments regarding unused _transaction_pool

* Make tx pool optional in check_header
This commit is contained in:
Marcio Diaz
2019-08-13 11:44:00 +02:00
committed by André Silva
parent 9ca96d6fe7
commit 7b45130115
8 changed files with 82 additions and 41 deletions
+5 -1
View File
@@ -381,6 +381,7 @@ pub trait ServiceFactory: 'static + Sized {
config: &mut FactoryFullConfiguration<Self>,
_client: Arc<FullClient<Self>>,
_select_chain: Self::SelectChain,
_transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>,
) -> Result<Self::FullImportQueue, error::Error> {
if let Some(name) = config.chain_spec.consensus_engine() {
match name {
@@ -454,6 +455,7 @@ pub trait Components: Sized + 'static {
config: &mut FactoryFullConfiguration<Self::Factory>,
client: Arc<ComponentClient<Self>>,
select_chain: Option<Self::SelectChain>,
_transaction_pool: Option<Arc<TransactionPool<Self::TransactionPoolApi>>>,
) -> Result<(Self::ImportQueue, Option<BoxFinalityProofRequestBuilder<FactoryBlock<Self::Factory>>>), error::Error>;
/// Finality proof provider for serving network requests.
@@ -572,10 +574,11 @@ impl<Factory: ServiceFactory> Components for FullComponents<Factory> {
config: &mut FactoryFullConfiguration<Self::Factory>,
client: Arc<ComponentClient<Self>>,
select_chain: Option<Self::SelectChain>,
transaction_pool: Option<Arc<TransactionPool<Self::TransactionPoolApi>>>,
) -> Result<(Self::ImportQueue, Option<BoxFinalityProofRequestBuilder<FactoryBlock<Self::Factory>>>), error::Error> {
let select_chain = select_chain
.ok_or(error::Error::SelectChainRequired)?;
Factory::build_full_import_queue(config, client, select_chain)
Factory::build_full_import_queue(config, client, select_chain, transaction_pool)
.map(|queue| (queue, None))
}
@@ -695,6 +698,7 @@ impl<Factory: ServiceFactory> Components for LightComponents<Factory> {
config: &mut FactoryFullConfiguration<Self::Factory>,
client: Arc<ComponentClient<Self>>,
_select_chain: Option<Self::SelectChain>,
_transaction_pool: Option<Arc<TransactionPool<Self::TransactionPoolApi>>>,
) -> Result<(Self::ImportQueue, Option<BoxFinalityProofRequestBuilder<FactoryBlock<Self::Factory>>>), error::Error> {
Factory::build_light_import_queue(config, client)
.map(|(queue, builder)| (queue, Some(builder)))