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
+12 -7
View File
@@ -209,12 +209,15 @@ construct_service_factory! {
},
LightService = LightComponents<Self>
{ |config| <LightComponents<Factory>>::new(config) },
FullImportQueue = BabeImportQueue<Self::Block> {
|
config: &mut FactoryFullConfiguration<Self>,
client: Arc<FullClient<Self>>,
select_chain: Self::SelectChain
| {
FullImportQueue = BabeImportQueue<Self::Block>
{
|
config: &mut FactoryFullConfiguration<Self>,
client: Arc<FullClient<Self>>,
select_chain: Self::SelectChain,
transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>,
|
{
let (block_import, link_half) =
grandpa::block_import::<_, _, _, RuntimeApi, FullClient<Self>, _>(
client.clone(), client.clone(), select_chain
@@ -229,6 +232,7 @@ construct_service_factory! {
client.clone(),
client,
config.custom.inherent_data_providers.clone(),
transaction_pool,
)?;
config.custom.import_setup = Some((babe_block_import.clone(), link_half, babe_link));
@@ -252,7 +256,7 @@ construct_service_factory! {
finality_proof_import.create_finality_proof_request_builder();
// FIXME: pruning task isn't started since light client doesn't do `AuthoritySetup`.
let (import_queue, ..) = import_queue(
let (import_queue, ..) = import_queue::<_, _, _, _, _, _, TransactionPool<Self::FullTransactionPoolApi>>(
Config::get_or_compute(&*client)?,
block_import,
None,
@@ -260,6 +264,7 @@ construct_service_factory! {
client.clone(),
client,
config.custom.inherent_data_providers.clone(),
None,
)?;
Ok((import_queue, finality_proof_request_builder))