consensus: Make future handling a little nicer

Part of #428.
This commit is contained in:
teor 2020-06-11 22:09:51 +10:00 committed by Henry de Valence
parent 7b8707be1e
commit c2590ce526
3 changed files with 4 additions and 1 deletions

1
Cargo.lock generated
View File

@ -2127,6 +2127,7 @@ version = "0.1.0"
dependencies = [
"color-eyre",
"eyre",
"futures-util",
"tokio",
"tower",
"tracing",

View File

@ -10,6 +10,7 @@ edition = "2018"
[dependencies]
zebra-chain = { path = "../zebra-chain" }
zebra-state = { path = "../zebra-state" }
futures-util = "0.3.5"
tower = "0.3.1"
[dev-dependencies]

View File

@ -8,6 +8,7 @@
//! Verification is provided via a `tower::Service`, to support backpressure and batch
//! verification.
use futures_util::FutureExt;
use std::{
error,
future::Future,
@ -80,7 +81,7 @@ where
block: block.into(),
});
Box::pin(async move { Ok(header_hash) })
async move { Ok(header_hash) }.boxed()
}
}