mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
Ensure password dir exists in val dir builder
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::{Error as DirError, ValidatorDir};
|
||||
use bls::get_withdrawal_credentials;
|
||||
use deposit_contract::{encode_eth1_tx_data, Error as DepositError};
|
||||
use directory::ensure_dir_exists;
|
||||
use eth2_keystore::{Error as KeystoreError, Keystore, KeystoreBuilder, PlainText};
|
||||
use filesystem::create_with_600_perms;
|
||||
use rand::{distributions::Alphanumeric, Rng};
|
||||
@@ -41,6 +42,7 @@ pub enum Error {
|
||||
#[cfg(feature = "insecure_keys")]
|
||||
InsecureKeysError(String),
|
||||
MissingPasswordDir,
|
||||
UnableToCreatePasswordDir(String),
|
||||
}
|
||||
|
||||
impl From<KeystoreError> for Error {
|
||||
@@ -160,6 +162,10 @@ impl<'a> Builder<'a> {
|
||||
create_dir_all(&dir).map_err(Error::UnableToCreateDir)?;
|
||||
}
|
||||
|
||||
if let Some(password_dir) = &self.password_dir {
|
||||
ensure_dir_exists(password_dir).map_err(Error::UnableToCreatePasswordDir)?;
|
||||
}
|
||||
|
||||
// The withdrawal keystore must be initialized in order to store it or create an eth1
|
||||
// deposit.
|
||||
if (self.store_withdrawal_keystore || self.deposit_info.is_some())
|
||||
|
||||
Reference in New Issue
Block a user