diff --git a/Cargo.toml b/Cargo.toml index 6364c4d..21645ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ tokio = { version = "1.41.0", features = [ "rt", "macros", "rt-multi-thread", - "signal" + "signal", ] } graphql_client = "0.14.0" reqwest = { version = "0.12.9", features = ["json"] } diff --git a/docker-compose.yml b/docker-compose.yml index 19fe0d1..d7c540d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.9' - services: daemon: image: enjin/wallet-daemon:latest diff --git a/src/subscription.rs b/src/subscription.rs index 78635e4..c86951c 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -24,22 +24,19 @@ impl SubscriptionParams { let block_sub = Arc::clone(&subscription); tokio::spawn(async move { - block_sub.block_subscription().await.unwrap(); + block_sub.block_subscription().await; }); let runtime_sub = Arc::clone(&subscription); let updater = runtime_sub.rpc.updater(); tokio::spawn(async move { - runtime_sub.runtime_subscription(updater).await.unwrap(); + runtime_sub.runtime_subscription(updater).await; }); subscription } - async fn runtime_subscription( - self: Arc, - updater: ClientRuntimeUpdater, - ) -> Result<(), Box> { + async fn runtime_subscription(self: Arc, updater: ClientRuntimeUpdater) { let mut update_stream = updater.runtime_updates().await.unwrap(); while let Some(Ok(update)) = update_stream.next().await { @@ -70,14 +67,10 @@ impl SubscriptionParams { }, }; } - - Ok(()) } - async fn block_subscription( - self: Arc, - ) -> Result<(), Box> { - let mut blocks_sub = self.rpc.blocks().subscribe_finalized().await?; + async fn block_subscription(self: Arc) { + let mut blocks_sub = self.rpc.blocks().subscribe_finalized().await.unwrap(); while let Some(block) = blocks_sub.next().await { let block = match block { @@ -85,10 +78,9 @@ impl SubscriptionParams { Err(e) => { if e.is_disconnected_will_reconnect() { tracing::warn!("Lost connection with the RPC node, reconnecting..."); - continue; } - return Err(e.into()); + continue; } }; @@ -102,8 +94,6 @@ impl SubscriptionParams { *block_header = Some(block.header().clone()); } - - Ok(()) } pub fn get_block_header(&self) -> substrate::SubstrateHeader {