mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-15 08:28:20 +00:00
ebd97730d5
- 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
14 lines
351 B
Rust
14 lines
351 B
Rust
macro_rules! try_future {
|
|
($expr:expr) => {
|
|
match $expr {
|
|
core::result::Result::Ok(val) => val,
|
|
core::result::Result::Err(err) => {
|
|
return Box::new(futures::future::err(std::convert::From::from(err)))
|
|
}
|
|
}
|
|
};
|
|
($expr:expr,) => {
|
|
$crate::try_future!($expr)
|
|
};
|
|
}
|