Address other minor issues

This commit is contained in:
Paul Hauner
2019-11-23 12:39:45 +11:00
parent ef4e12da51
commit 7109ffa89d
4 changed files with 4 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "rest_api"
version = "0.1.0"
authors = ["Luke Anderson <luke@sigmaprime.io>"]
authors = ["Paul Hauner <paul@paulhauner.com>", "Luke Anderson <luke@sigmaprime.io>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -3,9 +3,6 @@ use serde::{Deserialize, Serialize};
use std::net::Ipv4Addr;
/// Defines the encoding for the API
///
/// The validator client can speak to the beacon node in a number of encodings. Currently both JSON
/// and YAML are supported.
#[derive(Clone, Serialize, Deserialize, Copy)]
pub enum ApiEncodingFormat {
JSON,

View File

@@ -59,9 +59,10 @@ pub fn start_server<T: BeaconChainTypes>(
eth2_config: Eth2Config,
log: slog::Logger,
) -> Result<(exit_future::Signal, SocketAddr), hyper::Error> {
// Define the function that will build the request handler.
let inner_log = log.clone();
let eth2_config = Arc::new(eth2_config);
// Define the function that will build the request handler.
let make_service = make_service_fn(move |_socket: &AddrStream| {
let beacon_chain = beacon_chain.clone();
let log = inner_log.clone();

View File

@@ -57,7 +57,7 @@ pub fn get_prometheus<T: BeaconChainTypes + 'static>(
beacon_chain::scrape_for_metrics(&beacon_chain);
encoder
.encode(&lighthouse_metrics::gather()[..], &mut buffer)
.encode(&lighthouse_metrics::gather(), &mut buffer)
.unwrap();
String::from_utf8(buffer)