Sync sim mini update (#1018)

* Include syncing status as a node fn

* Update sync sim to use de node/syncing endpoint
This commit is contained in:
divma
2020-04-21 08:33:12 -05:00
committed by GitHub
parent 9e42a851e4
commit b88b3ffe40
2 changed files with 16 additions and 12 deletions

View File

@@ -24,8 +24,8 @@ pub use operation_pool::PersistedOperationPool;
pub use proto_array_fork_choice::core::ProtoArray;
pub use rest_types::{
CanonicalHeadResponse, Committee, HeadBeaconBlock, IndividualVotesRequest,
IndividualVotesResponse, ValidatorDutiesRequest, ValidatorDutyBytes, ValidatorRequest,
ValidatorResponse, ValidatorSubscription,
IndividualVotesResponse, SyncingResponse, ValidatorDutiesRequest, ValidatorDutyBytes,
ValidatorRequest, ValidatorResponse, ValidatorSubscription,
};
// Setting a long timeout for debug ensures that crypto-heavy operations can still succeed.
@@ -654,6 +654,13 @@ impl<E: EthSpec> Node<E> {
.into_future()
.and_then(move |url| client.json_get(url, vec![]))
}
pub fn syncing_status(&self) -> impl Future<Item = SyncingResponse, Error = Error> {
let client = self.0.clone();
self.url("syncing")
.into_future()
.and_then(move |url| client.json_get(url, vec![]))
}
}
/// Provides the functions on the `/advanced` endpoint of the node.