Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator manager commands for standard key-manager APIs #5347

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0fa74cd
Validator manager commands for standard key-manager APIs
pahor167 Mar 4, 2024
f6d11bc
Merge latest unstable
chong-he Jul 29, 2024
83967a5
Fix Some in lib.rs
chong-he Jul 31, 2024
bf6e3b7
Replace Arg::with_name with Arg::new
chong-he Jul 31, 2024
1337a2f
Update takes_value
chong-he Jul 31, 2024
1082426
Remove clap::App
chong-he Jul 31, 2024
526603c
Change App to Command
chong-he Jul 31, 2024
0075fdd
Add command in use
chong-he Jul 31, 2024
6803092
Remove generic in ArgMatches
chong-he Jul 31, 2024
1630435
Fix matches.get_flag
chong-he Aug 1, 2024
1c8b3b3
Fixes
chong-he Aug 1, 2024
b80d16e
fix error handling
chong-he Aug 1, 2024
509d590
SetTrue in import
chong-he Aug 2, 2024
bb283a2
Fix
chong-he Aug 2, 2024
e1452f8
Fix builder-proposal flag (will delete the flag later)
chong-he Aug 2, 2024
e0918a8
Minor fix
chong-he Aug 2, 2024
97afc09
Fix prefer_builder_proposals
chong-he Aug 2, 2024
2212dd4
Remove unwrap
chong-he Aug 5, 2024
47382a7
Error handling from Michael
chong-he Aug 6, 2024
5f56ba5
Add cli help text
chong-he Aug 7, 2024
c6c8954
Use None in import to simplify
chong-he Aug 7, 2024
82d578f
Delete unwrap
chong-he Aug 7, 2024
d71cca9
Revert flags option
chong-he Aug 7, 2024
98ac81b
Simplify help command code
chong-he Aug 7, 2024
ad7cb23
Remove flag header in move
chong-he Aug 7, 2024
2f9f0dd
Merge remote-tracking branch 'origin/unstable' into pahor/validator-m…
michaelsproul Aug 8, 2024
6069c94
Add log in VC when keystore is deleted
chong-he Aug 12, 2024
ff0c841
Delete duplicated log when validator does not exist
chong-he Aug 12, 2024
0e4e9a4
Simplify log code
chong-he Aug 12, 2024
eadec07
Rename remove to delete
chong-he Aug 13, 2024
97196cc
cargo-fmt
chong-he Aug 13, 2024
6fb9f83
Try to remove a function
chong-he Aug 13, 2024
bed168c
make-cli
chong-he Aug 13, 2024
a55cc5b
Error handling
chong-he Aug 13, 2024
b5b9537
Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
chong-he Aug 13, 2024
100ee22
Update CLI hel text
chong-he Aug 13, 2024
610f971
make-cli
chong-he Aug 13, 2024
64a4f67
Fix checks
chong-he Aug 15, 2024
9ba60be
Merge branch 'vm' of https://github.com/chong-he/lighthouse into vm
chong-he Aug 15, 2024
e079eb4
Try to fix check errors
chong-he Aug 15, 2024
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
10 changes: 9 additions & 1 deletion common/account_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use eth2_wallet::{
use filesystem::{create_with_600_perms, Error as FsError};
use rand::{distributions::Alphanumeric, Rng};
use serde::{Deserialize, Serialize};
use std::fs::{self, File};
use std::{fs::{self, File}, str::FromStr};
use std::io;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -213,6 +213,14 @@ pub fn mnemonic_from_phrase(phrase: &str) -> Result<Mnemonic, String> {
#[serde(transparent)]
pub struct ZeroizeString(String);

impl FromStr for ZeroizeString {
type Err = String;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.to_owned()))
}
}

impl From<String> for ZeroizeString {
fn from(s: String) -> Self {
Self(s)
Expand Down
5 changes: 5 additions & 0 deletions crypto/eth2_keystore/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ impl Keystore {
serde_json::from_reader(reader).map_err(|e| Error::ReadError(format!("{}", e)))
}

/// Instantiates `self` from a `JsonKeystore`.
pub fn from_json_keystore(json_keystore: JsonKeystore) -> Result<Self, Error> {
Ok(Keystore { json: json_keystore })
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably can delete this since the import_validator.rs now uses from_json_file function

Suggested change
/// Instantiates `self` from a `JsonKeystore`.
pub fn from_json_keystore(json_keystore: JsonKeystore) -> Result<Self, Error> {
Ok(Keystore { json: json_keystore })
}

/// Instantiates `self` by reading a JSON file at `path`.
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
File::options()
Expand Down
Loading
Loading