Attempt fix for addr parsing

This commit is contained in:
Paul Hauner
2019-11-23 15:20:29 +11:00
parent 466eb0420f
commit 68942318a7
4 changed files with 111 additions and 153 deletions

View File

@@ -12,7 +12,6 @@ use reqwest::{
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use ssz::Encode;
use std::marker::PhantomData;
use std::net::SocketAddr;
use std::time::Duration;
use types::{
Attestation, BeaconBlock, BeaconState, CommitteeIndex, Epoch, EthSpec, Fork, Hash256,
@@ -36,9 +35,9 @@ pub struct RemoteBeaconNode<E: EthSpec> {
}
impl<E: EthSpec> RemoteBeaconNode<E> {
pub fn new(http_endpoint: SocketAddr) -> Result<Self, String> {
pub fn new(http_endpoint: String) -> Result<Self, String> {
Ok(Self {
http: HttpClient::new(format!("http://{}", http_endpoint.to_string()))
http: HttpClient::new(http_endpoint)
.map_err(|e| format!("Unable to create http client: {:?}", e))?,
})
}