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
+10 -3
View File
@@ -95,14 +95,20 @@ construct_service_factory! {
FullImportQueue = AuraImportQueue<
Self::Block,
>
{ |config: &mut FactoryFullConfiguration<Self> , client: Arc<FullClient<Self>>, _select_chain: Self::SelectChain| {
import_queue::<_, _, aura_primitives::sr25519::AuthorityPair>(
{ |
config: &mut FactoryFullConfiguration<Self>,
client: Arc<FullClient<Self>>,
_select_chain: Self::SelectChain,
transaction_pool: Option<Arc<TransactionPool<Self::FullTransactionPoolApi>>>,
| {
import_queue::<_, _, aura_primitives::sr25519::AuthorityPair, _>(
SlotDuration::get_or_compute(&*client)?,
Box::new(client.clone()),
None,
None,
client,
config.custom.inherent_data_providers.clone(),
transaction_pool,
).map_err(Into::into)
}
},
@@ -111,13 +117,14 @@ construct_service_factory! {
>
{ |config: &mut FactoryFullConfiguration<Self>, client: Arc<LightClient<Self>>| {
let fprb = Box::new(DummyFinalityProofRequestBuilder::default()) as Box<_>;
import_queue::<_, _, AuraAuthorityPair>(
import_queue::<_, _, AuraAuthorityPair, TransactionPool<Self::FullTransactionPoolApi>>(
SlotDuration::get_or_compute(&*client)?,
Box::new(client.clone()),
None,
None,
client,
config.custom.inherent_data_providers.clone(),
None,
).map(|q| (q, fprb)).map_err(Into::into)
}
},