Various small improvements to service construction. (#6738)

* Remove service components and add build_network, build_offchain_workers etc

* Improve transaction pool api

* Remove commented out line

* Add PartialComponents

* Add BuildNetworkParams, documentation

* Remove unused imports in tests

* Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Remove unused imports in node-bench

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
Ashley
2020-07-28 15:21:33 +02:00
committed by GitHub
parent 97f400f0f0
commit 9220b646d2
17 changed files with 401 additions and 326 deletions
@@ -169,6 +169,18 @@ impl<B, Block: BlockT> FinalityProofProvider<B, Block>
{
FinalityProofProvider { backend, authority_provider: Arc::new(authority_provider) }
}
/// Create new finality proof provider for the service using:
///
/// - backend for accessing blockchain data;
/// - storage_and_proof_provider, which is generally a client.
pub fn new_for_service(
backend: Arc<B>,
storage_and_proof_provider: Arc<dyn StorageAndProofProvider<Block, B>>,
) -> Arc<Self> {
Arc::new(Self::new(backend, storage_and_proof_provider))
}
}
impl<B, Block> sc_network::config::FinalityProofProvider<Block> for FinalityProofProvider<B, Block>