Skip to content

Commit

Permalink
Merge branch 'v0.3.0-staging' into directory-restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Sep 28, 2020
2 parents 74ed1be + 0a1f1b8 commit 8b70e53
Show file tree
Hide file tree
Showing 100 changed files with 3,384 additions and 2,525 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ jobs:
- uses: actions/checkout@v1
- name: Typecheck benchmark code without running it
run: make check-benches
check-consensus:
name: check-consensus
runs-on: ubuntu-latest
needs: cargo-fmt
steps:
- uses: actions/checkout@v1
- name: Typecheck consensus code in strict mode
run: make check-consensus
clippy:
name: clippy
runs-on: ubuntu-latest
Expand Down
60 changes: 31 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ cargo-fmt:
check-benches:
cargo check --all --benches

# Typechecks consensus code *without* allowing deprecated legacy arithmetic
check-consensus:
cargo check --manifest-path=consensus/state_processing/Cargo.toml --no-default-features

# Runs only the ef-test vectors.
run-ef-tests:
cargo test --release --manifest-path=$(EF_TESTS)/Cargo.toml --features "ef_tests"
Expand Down Expand Up @@ -133,7 +137,11 @@ arbitrary-fuzz:
# Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database)
audit:
cargo install --force cargo-audit
cargo audit
# TODO: we should address this --ignore.
#
# Tracking issue:
# https://github.com/sigp/lighthouse/issues/1669
cargo audit --ignore RUSTSEC-2020-0043

# Runs `cargo udeps` to check for unused dependencies
udeps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Like all Ethereum 2.0 clients, Lighthouse is a work-in-progress.

Current development overview:

- Specification `v0.12.1` implemented, optimized and passing test vectors.
- Specification `v0.12.3` implemented, optimized and passing test vectors.
- Rust-native libp2p with Gossipsub and Discv5.
- RESTful JSON API via HTTP server.
- Events via WebSocket.
Expand Down
2 changes: 1 addition & 1 deletion account_manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "account_manager"
version = "0.2.11"
version = "0.2.12"
authors = ["Paul Hauner <paul@paulhauner.com>", "Luke Anderson <luke@sigmaprime.io>"]
edition = "2018"

Expand Down
23 changes: 20 additions & 3 deletions account_manager/src/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use account_utils::PlainText;
use account_utils::{read_mnemonic_from_user, strip_off_newlines};
use account_utils::{read_input_from_user, strip_off_newlines};
use eth2_wallet::bip39::{Language, Mnemonic};
use std::fs;
use std::path::PathBuf;
Expand All @@ -8,10 +8,11 @@ use std::thread::sleep;
use std::time::Duration;

pub const MNEMONIC_PROMPT: &str = "Enter the mnemonic phrase:";
pub const WALLET_NAME_PROMPT: &str = "Enter wallet name:";

pub fn read_mnemonic_from_cli(
mnemonic_path: Option<PathBuf>,
stdin_password: bool,
stdin_inputs: bool,
) -> Result<Mnemonic, String> {
let mnemonic = match mnemonic_path {
Some(path) => fs::read(&path)
Expand All @@ -31,7 +32,7 @@ pub fn read_mnemonic_from_cli(
eprintln!("");
eprintln!("{}", MNEMONIC_PROMPT);

let mnemonic = read_mnemonic_from_user(stdin_password)?;
let mnemonic = read_input_from_user(stdin_inputs)?;

match Mnemonic::from_phrase(mnemonic.as_str(), Language::English) {
Ok(mnemonic_m) => {
Expand All @@ -48,3 +49,19 @@ pub fn read_mnemonic_from_cli(
};
Ok(mnemonic)
}

/// Reads in a wallet name from the user. If the `--wallet-name` flag is provided, use it. Otherwise
/// read from an interactive prompt using tty unless the `--stdin-inputs` flag is provided.
pub fn read_wallet_name_from_cli(
wallet_name: Option<String>,
stdin_inputs: bool,
) -> Result<String, String> {
match wallet_name {
Some(name) => Ok(name),
None => {
eprintln!("{}", WALLET_NAME_PROMPT);

read_input_from_user(stdin_inputs)
}
}
}
Loading

0 comments on commit 8b70e53

Please sign in to comment.