mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Converted the Beacon API service to Futures
- Added SSZ encode for HeadResponse - Converted all of the /beacon/ endpoints to return BoxFut instead of ApiResult - Wrapped all of the '?'s in a new macro try_future!() - Copied the try macro to try_future, so that a boxed future can easily be returned. - Replaced all of the response serializations to use the new success_response
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate network as client_network;
|
||||
|
||||
@@ -91,7 +93,6 @@ impl<T: BeaconChainTypes> Service for ApiService<T> {
|
||||
(&Method::GET, "/network/listen_port") => network::get_listen_port::<T>(req),
|
||||
(&Method::GET, "/network/listen_addresses") => network::get_listen_addresses::<T>(req),
|
||||
|
||||
/*
|
||||
// Methods for Beacon Node
|
||||
(&Method::GET, "/beacon/head") => beacon::get_head::<T>(req),
|
||||
(&Method::GET, "/beacon/block") => beacon::get_block::<T>(req),
|
||||
@@ -111,6 +112,7 @@ impl<T: BeaconChainTypes> Service for ApiService<T> {
|
||||
helpers::implementation_pending_response(req)
|
||||
}
|
||||
|
||||
/*
|
||||
// Methods for Validator
|
||||
(&Method::GET, "/beacon/validator/duties") => validator::get_validator_duties::<T>(req),
|
||||
(&Method::GET, "/beacon/validator/block") => validator::get_new_beacon_block::<T>(req),
|
||||
|
||||
Reference in New Issue
Block a user