From decd29adfb280d0a892155633df74bacc980d3b0 Mon Sep 17 00:00:00 2001 From: pawan Date: Sun, 1 Mar 2020 02:06:38 +0530 Subject: [PATCH] Port beacon_chain to stable futures --- beacon_node/beacon_chain/Cargo.toml | 2 +- beacon_node/beacon_chain/src/eth1_chain.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index f74d3f0226..1de7d458c3 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -35,7 +35,7 @@ types = { path = "../../eth2/types" } tokio = "0.1.22" eth1 = { path = "../eth1" } websocket_server = { path = "../websocket_server" } -futures = "0.1.25" +futures = "0.3" genesis = { path = "../genesis" } integer-sqrt = "0.1" rand = "0.7.2" diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index 663801532a..a740c514f5 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -1,7 +1,6 @@ use crate::metrics; use eth1::{Config as Eth1Config, Eth1Block, Service as HttpService}; use eth2_hashing::hash; -use futures::Future; use slog::{debug, error, trace, Logger}; use ssz::{Decode, Encode}; use ssz_derive::{Decode, Encode}; @@ -278,11 +277,8 @@ impl> CachingEth1Backend { } /// Starts the routine which connects to the external eth1 node and updates the caches. - pub fn start( - &self, - exit: tokio::sync::oneshot::Receiver<()>, - ) -> impl Future { - self.core.auto_update(exit) + pub async fn start(&self, exit: tokio::sync::oneshot::Receiver<()>) -> Result<(), ()> { + self.core.auto_update(exit).await } /// Instantiates `self` from an existing service.