From 0e526e78db3496c41809b154a101cd4cd9cabacb Mon Sep 17 00:00:00 2001 From: NikVolf <nikvolf@gmail.com> Date: Wed, 15 Jan 2020 16:19:57 +0300 Subject: [PATCH] fix new_light --- bin/node/cli/src/service.rs | 4 +++- client/transaction-pool/graph/benches/basics.rs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs index cadc6159de2f0..179cc92a399db 100644 --- a/bin/node/cli/src/service.rs +++ b/bin/node/cli/src/service.rs @@ -314,7 +314,9 @@ pub fn new_light<C: Send + Default + 'static>(config: NodeConfiguration<C>) let fetcher = fetcher .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?; let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone()); - let pool = sc_transaction_pool::BasicPool::new(config, pool_api); + let pool = sc_transaction_pool::BasicPool::with_revalidation_type( + config, pool_api, sc_transaction_pool::RevalidationType::Light, + ); Ok(pool) })? .with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool| { diff --git a/client/transaction-pool/graph/benches/basics.rs b/client/transaction-pool/graph/benches/basics.rs index 1dfe2aeea1797..75d15cc1f1916 100644 --- a/client/transaction-pool/graph/benches/basics.rs +++ b/client/transaction-pool/graph/benches/basics.rs @@ -50,7 +50,7 @@ impl ChainApi for TestApi { type Hash = H256; type Error = sp_transaction_pool::error::Error; type ValidationFuture = Ready<sp_transaction_pool::error::Result<TransactionValidity>>; - type BodyFuture = Ready<error::Result<Option<Vec<Extrinsic>>>>; + type BodyFuture = Ready<sp_transaction_pool::error::Result<Option<Vec<Extrinsic>>>>; fn validate_transaction( &self, @@ -155,13 +155,13 @@ fn benchmark_main(c: &mut Criterion) { c.bench_function("sequential 50 tx", |b| { b.iter(|| { - bench_configured(Pool::new(Default::default(), TestApi::new_dependant()), 50); + bench_configured(Pool::new(Default::default(), TestApi::new_dependant().into()), 50); }); }); c.bench_function("random 100 tx", |b| { b.iter(|| { - bench_configured(Pool::new(Default::default(), TestApi::default()), 100); + bench_configured(Pool::new(Default::default(), TestApi::default().into()), 100); }); }); }