diff --git a/bolt-cli/src/cli.rs b/bolt-cli/src/cli.rs index 6dfc5ad0d..ffdeb11a2 100644 --- a/bolt-cli/src/cli.rs +++ b/bolt-cli/src/cli.rs @@ -40,11 +40,11 @@ impl Cmd { /// Run the command. pub async fn run(self) -> eyre::Result<()> { match self { - Cmd::Delegate(cmd) => cmd.run().await, - Cmd::Pubkeys(cmd) => cmd.run().await, - Cmd::Send(cmd) => cmd.run().await, - Cmd::Validators(cmd) => cmd.run().await, - Cmd::Operators(cmd) => cmd.run().await, + Self::Delegate(cmd) => cmd.run().await, + Self::Pubkeys(cmd) => cmd.run().await, + Self::Send(cmd) => cmd.run().await, + Self::Validators(cmd) => cmd.run().await, + Self::Operators(cmd) => cmd.run().await, } } } @@ -406,10 +406,10 @@ impl Chain { /// Get the fork version for the given chain. pub fn fork_version(&self) -> [u8; 4] { match self { - Chain::Mainnet => [0, 0, 0, 0], - Chain::Holesky => [1, 1, 112, 0], - Chain::Helder => [16, 0, 0, 0], - Chain::Kurtosis => [16, 0, 0, 56], + Self::Mainnet => [0, 0, 0, 0], + Self::Holesky => [1, 1, 112, 0], + Self::Helder => [16, 0, 0, 0], + Self::Kurtosis => [16, 0, 0, 56], } } diff --git a/bolt-cli/src/common/keystore.rs b/bolt-cli/src/common/keystore.rs index 76e8ce061..3a6ee33ac 100644 --- a/bolt-cli/src/common/keystore.rs +++ b/bolt-cli/src/common/keystore.rs @@ -39,9 +39,9 @@ impl KeystoreSecret { /// Create a new [`KeystoreSecret`] from the provided [`LocalKeystoreOpts`]. pub fn from_keystore_options(opts: &LocalKeystoreOpts) -> Result { if let Some(password_path) = &opts.password_path { - Ok(KeystoreSecret::from_directory(password_path)?) + Ok(Self::from_directory(password_path)?) } else if let Some(password) = &opts.password { - Ok(KeystoreSecret::from_unique_password(password.clone())) + Ok(Self::from_unique_password(password.clone())) } else { // This case is prevented upstream by clap's validation. bail!("Either `password_path` or `password` must be provided") @@ -61,19 +61,19 @@ impl KeystoreSecret { let secret = fs::read_to_string(&path).wrap_err("Failed to read secret file")?; secrets.insert(filename.trim_start_matches("0x").to_string(), secret); } - Ok(KeystoreSecret::Directory(secrets)) + Ok(Self::Directory(secrets)) } /// Set a unique password for all validators in the keystore. pub fn from_unique_password(password: String) -> Self { - KeystoreSecret::Unique(password) + Self::Unique(password) } /// Get the password for the given validator public key. pub fn get(&self, validator_pubkey: &str) -> Option<&str> { match self { - KeystoreSecret::Unique(password) => Some(password.as_str()), - KeystoreSecret::Directory(secrets) => secrets.get(validator_pubkey).map(|s| s.as_str()), + Self::Unique(password) => Some(password.as_str()), + Self::Directory(secrets) => secrets.get(validator_pubkey).map(|s| s.as_str()), } } } @@ -83,13 +83,13 @@ impl KeystoreSecret { impl Drop for KeystoreSecret { fn drop(&mut self) { match self { - KeystoreSecret::Unique(password) => { + Self::Unique(password) => { let bytes = unsafe { password.as_bytes_mut() }; for b in bytes.iter_mut() { *b = 0; } } - KeystoreSecret::Directory(secrets) => { + Self::Directory(secrets) => { for secret in secrets.values_mut() { let bytes = unsafe { secret.as_bytes_mut() }; for b in bytes.iter_mut() { diff --git a/bolt-cli/src/contracts/mod.rs b/bolt-cli/src/contracts/mod.rs index 52603efff..bceb293b4 100644 --- a/bolt-cli/src/contracts/mod.rs +++ b/bolt-cli/src/contracts/mod.rs @@ -72,11 +72,11 @@ pub enum EigenLayerStrategy { impl std::fmt::Display for EigenLayerStrategy { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let output = match self { - EigenLayerStrategy::StEth => "stETH", - EigenLayerStrategy::REth => "rETH", - EigenLayerStrategy::WEth => "wETH", - EigenLayerStrategy::CbEth => "cbETH", - EigenLayerStrategy::MEth => "mETH", + Self::StEth => "stETH", + Self::REth => "rETH", + Self::WEth => "wETH", + Self::CbEth => "cbETH", + Self::MEth => "mETH", }; write!(f, "{}", output) }