Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Mar 3, 2022
1 parent fea5341 commit 4abefcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions beacon_node/execution_layer/src/engine_api/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl JwtKey {
));
}
let mut res = [0; JWT_SECRET_LENGTH];
res.copy_from_slice(&key);
res.copy_from_slice(key);
Ok(Self(res))
}

Expand All @@ -52,7 +52,7 @@ impl JwtKey {
}

/// Returns the hex encoded `String` for the secret.
pub fn to_string(&self) -> String {
pub fn hex_string(&self) -> String {
hex::encode(self.0)
}
}
Expand Down
3 changes: 1 addition & 2 deletions beacon_node/execution_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ pub enum Error {
MissingLatestValidHash,
InvalidJWTSecret(String),
NoAuthProvided(String),
MissingLatestValidHash,
}

impl From<ApiError> for Error {
Expand Down Expand Up @@ -176,7 +175,7 @@ impl ExecutionLayer {
})
.and_then(|mut f| {
let secret = auth::JwtKey::random();
f.write_all(secret.to_string().as_bytes()).map_err(|e| {
f.write_all(secret.hex_string().as_bytes()).map_err(|e| {
format!("Failed to write to JWT secret file: {:?}", e)
})?;
Ok((secret, p.to_path_buf()))
Expand Down

0 comments on commit 4abefcc

Please sign in to comment.