From b91742a6471612ca9e1f0959e038ce28d399072b Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Wed, 3 Apr 2024 19:09:08 +0300 Subject: [PATCH] lightclient: Use generic TPlat for chainSuccess Signed-off-by: Alexandru Vasile --- lightclient/src/background.rs | 8 ++++---- lightclient/src/lib.rs | 2 +- lightclient/src/shared_client.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lightclient/src/background.rs b/lightclient/src/background.rs index e9bd9424e3..0ae565b1de 100644 --- a/lightclient/src/background.rs +++ b/lightclient/src/background.rs @@ -108,7 +108,7 @@ impl BackgroundTaskHandle { /// coming to/from Smoldot. #[allow(clippy::type_complexity)] pub struct BackgroundTask { - channels: BackgroundTaskChannels, + channels: BackgroundTaskChannels, data: BackgroundTaskData, } @@ -117,7 +117,7 @@ impl BackgroundTask { pub(crate) fn new( client: SharedClient, chain_id: smoldot_light::ChainId, - from_back: smoldot_light::JsonRpcResponses, + from_back: smoldot_light::JsonRpcResponses, ) -> (BackgroundTask, BackgroundTaskHandle) { let (tx, rx) = mpsc::unbounded_channel(); @@ -191,11 +191,11 @@ impl BackgroundTask { } } -struct BackgroundTaskChannels { +struct BackgroundTaskChannels { /// Messages sent into this background task from the front end. from_front: UnboundedReceiverStream, /// Messages sent into the background task from Smoldot. - from_back: smoldot_light::JsonRpcResponses, + from_back: smoldot_light::JsonRpcResponses, } struct BackgroundTaskData { diff --git a/lightclient/src/lib.rs b/lightclient/src/lib.rs index 6df5c2ec47..3884bf2ab4 100644 --- a/lightclient/src/lib.rs +++ b/lightclient/src/lib.rs @@ -185,7 +185,7 @@ impl LightClientRpc { pub(crate) fn new_raw( client: impl Into>, chain_id: smoldot_light::ChainId, - rpc_responses: smoldot_light::JsonRpcResponses, + rpc_responses: smoldot_light::JsonRpcResponses, ) -> Self where TPlat: smoldot_light::platform::PlatformRef + Send + 'static, diff --git a/lightclient/src/shared_client.rs b/lightclient/src/shared_client.rs index d725030599..a954550f7d 100644 --- a/lightclient/src/shared_client.rs +++ b/lightclient/src/shared_client.rs @@ -38,7 +38,7 @@ impl SharedClient { pub(crate) fn add_chain( &self, config: sl::AddChainConfig<'_, TChain, impl Iterator>, - ) -> Result { + ) -> Result, sl::AddChainError> { self.client .lock() .expect("mutex should not be poisoned")