Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 7a64651

Browse files
authored
Expose build_system_rpc_future and TransactionPoolAdapator in sc-service (#14238)
* Make block sync service customizable This change allows user to have their own network block logic, for example, we'd like to disable the builtin block sync service when using another syncing approach. * Remove unnecessary Box * Revert network_block * Expose build_system_rpc_future() and TransactionPoolAdaptor * fmt
1 parent 7f1861e commit 7a64651

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

client/service/src/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ pub struct BuildNetworkParams<'a, TBl: BlockT, TExPool, TImpQu, TCl> {
749749
/// Optional warp sync params.
750750
pub warp_sync_params: Option<WarpSyncParams<TBl>>,
751751
}
752+
752753
/// Build the network service, the network status sinks and an RPC sender.
753754
pub fn build_network<TBl, TExPool, TImpQu, TCl>(
754755
params: BuildNetworkParams<TBl, TExPool, TImpQu, TCl>,

client/service/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async fn build_network_future<
211211
}
212212

213213
/// Builds a future that processes system RPC requests.
214-
async fn build_system_rpc_future<
214+
pub async fn build_system_rpc_future<
215215
B: BlockT,
216216
C: BlockchainEvents<B>
217217
+ HeaderBackend<B>
@@ -421,6 +421,13 @@ pub struct TransactionPoolAdapter<C, P> {
421421
client: Arc<C>,
422422
}
423423

424+
impl<C, P> TransactionPoolAdapter<C, P> {
425+
/// Constructs a new instance of [`TransactionPoolAdapter`].
426+
pub fn new(pool: Arc<P>, client: Arc<C>) -> Self {
427+
Self { pool, client }
428+
}
429+
}
430+
424431
/// Get transactions for propagation.
425432
///
426433
/// Function extracted to simplify the test and prevent creating `ServiceFactory`.

0 commit comments

Comments
 (0)