mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Strip newlines from VC token
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
use account_utils::ZeroizeString;
|
use account_utils::{strip_off_newlines, ZeroizeString};
|
||||||
use eth2::lighthouse_vc::std_types::{InterchangeJsonStr, KeystoreJsonStr};
|
use eth2::lighthouse_vc::std_types::{InterchangeJsonStr, KeystoreJsonStr};
|
||||||
use eth2::{
|
use eth2::{
|
||||||
lighthouse_vc::{
|
lighthouse_vc::{
|
||||||
@@ -309,7 +309,7 @@ pub async fn vc_http_client<P: AsRef<Path>>(
|
|||||||
let token_path = token_path.as_ref();
|
let token_path = token_path.as_ref();
|
||||||
let token_bytes =
|
let token_bytes =
|
||||||
fs::read(&token_path).map_err(|e| format!("Failed to read {:?}: {:?}", token_path, e))?;
|
fs::read(&token_path).map_err(|e| format!("Failed to read {:?}: {:?}", token_path, e))?;
|
||||||
let token_string = String::from_utf8(token_bytes)
|
let token_string = String::from_utf8(strip_off_newlines(token_bytes))
|
||||||
.map_err(|e| format!("Failed to parse {:?} as utf8: {:?}", token_path, e))?;
|
.map_err(|e| format!("Failed to parse {:?} as utf8: {:?}", token_path, e))?;
|
||||||
let http_client = ValidatorClientHttpClient::new(url.clone(), token_string).map_err(|e| {
|
let http_client = ValidatorClientHttpClient::new(url.clone(), token_string).map_err(|e| {
|
||||||
format!(
|
format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user