Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/cli/src/commands/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub struct RelayLogFlags {
default_value = "",
help = "Path in which to write on-disk logs."
)]
pub log_output_path: String,
pub log_output_path: PathBuf,
}

#[derive(clap::ValueEnum, Clone, Default)]
Expand Down Expand Up @@ -350,7 +350,7 @@ async fn run_with_config(
#[cfg(test)]
mod tests {
use backon::{BackoffBuilder, Retryable};
use std::{str::FromStr, time};
use std::{path::PathBuf, str::FromStr, time};
use tokio::net;
use tokio_util::sync::CancellationToken;

Expand Down Expand Up @@ -547,7 +547,7 @@ mod tests {
format: "console".into(),
level: "error".into(),
color: super::ConsoleColor::Disable,
log_output_path: "".into(),
log_output_path: PathBuf::new(),
},
loki: super::RelayLokiArgs {
loki_addresses: vec![],
Expand Down
30 changes: 16 additions & 14 deletions crates/eth2util/src/keystore/error.rs
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
use std::path::PathBuf;

use pluto_crypto::types::PRIVATE_KEY_LENGTH;

/// Error type for keystore operations.
#[derive(Debug, thiserror::Error)]
pub enum KeystoreError {
/// Keystore directory does not exist.
#[error("keystore dir does not exist: {path}")]
#[error("keystore dir does not exist: {}", path.display())]
DirNotExist {
/// Path that was checked.
path: String,
path: PathBuf,
},

/// Path is not a directory.
#[error("keystore dir is not a directory: {path}")]
#[error("keystore dir is not a directory: {}", path.display())]
NotADirectory {
/// Path that was checked.
path: String,
path: PathBuf,
},

/// No keystore files found in directory.
#[error("no keys found")]
NoKeysFound,

/// Keystore password file not found.
#[error("keystore password file not found {path}")]
#[error("keystore password file not found {}", path.display())]
PasswordNotFound {
/// Password file path.
path: String,
path: PathBuf,
},

/// Out of sequence keystore index.
#[error("out of sequence keystore index {index} in file {filename}")]
#[error("out of sequence keystore index {index} in file {}", filename.display())]
OutOfSequence {
/// The index found.
index: usize,
/// The filename.
filename: String,
filename: PathBuf,
},

/// Duplicate keystore index.
#[error("duplicate keystore index {index} in file {filename}")]
#[error("duplicate keystore index {index} in file {}", filename.display())]
DuplicateIndex {
/// The duplicated index.
index: usize,
/// The filename.
filename: String,
filename: PathBuf,
},

/// Unknown keystore index.
#[error("unknown keystore index, filename not 'keystore-%d.json': {filename}")]
#[error("unknown keystore index, filename not 'keystore-%d.json': {}", filename.display())]
UnknownIndex {
/// The filename.
filename: String,
filename: PathBuf,
},

/// Encryption error.
Expand Down Expand Up @@ -117,10 +119,10 @@ pub enum KeystoreError {
WalkDir(String),

/// Keystore not found during recursive load.
#[error("keystore not found: {path}")]
#[error("keystore not found: {}", path.display())]
KeystoreNotFound {
/// The path that was looked up.
path: String,
path: PathBuf,
},

/// Unexpected regex error when extracting keystore file index.
Expand Down
Loading
Loading