Merge branch '0.5.1-tests' of github.com:sigp/lighthouse into 0.5.1-tests
This commit is contained in:
commit
7aad7f59d9
20
.travis.yml
20
.travis.yml
@ -6,12 +6,13 @@ before_install:
|
|||||||
- sudo mv protoc3/include/* /usr/local/include/
|
- sudo mv protoc3/include/* /usr/local/include/
|
||||||
- sudo chown $USER /usr/local/bin/protoc
|
- sudo chown $USER /usr/local/bin/protoc
|
||||||
- sudo chown -R $USER /usr/local/include/google
|
- sudo chown -R $USER /usr/local/include/google
|
||||||
|
env:
|
||||||
|
- BUILD=--all
|
||||||
|
- BUILD=--release --all
|
||||||
|
- BUILD= --manifest-path eth2/state_processing/Cargo.toml --release --features fake_crypto
|
||||||
script:
|
script:
|
||||||
- cargo build --verbose --all
|
- cargo build --verbose $BUILD
|
||||||
- cargo build --verbose --release --all
|
- cargo test --verbose $BUILD
|
||||||
- cargo test --verbose --all
|
|
||||||
- cargo test --verbose --release --all
|
|
||||||
- cargo test --manifest-path eth2/state_processing/Cargo.toml --verbose --release --features fake_crypto
|
|
||||||
- cargo fmt --all -- --check
|
- cargo fmt --all -- --check
|
||||||
# No clippy until later...
|
# No clippy until later...
|
||||||
#- cargo clippy
|
#- cargo clippy
|
||||||
@ -23,6 +24,15 @@ matrix:
|
|||||||
allow_failures:
|
allow_failures:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
exclude:
|
||||||
|
- rust: beta
|
||||||
|
env: BUILD=--release --all
|
||||||
|
- rust: beta
|
||||||
|
env: BUILD= --manifest-path eth2/state_processing/Cargo.toml --release --features fake_crypto
|
||||||
|
- rust: nightly
|
||||||
|
env: BUILD=--release --all
|
||||||
|
- rust: nightly
|
||||||
|
env: BUILD= --manifest-path eth2/state_processing/Cargo.toml --release --features fake_crypto
|
||||||
install:
|
install:
|
||||||
- rustup component add rustfmt
|
- rustup component add rustfmt
|
||||||
- rustup component add clippy
|
- rustup component add clippy
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![cfg(not(debug_assertions))]
|
||||||
|
|
||||||
use env_logger::{Builder, Env};
|
use env_logger::{Builder, Env};
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use test_harness::BeaconChainHarness;
|
use test_harness::BeaconChainHarness;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#![cfg(not(debug_assertions))]
|
||||||
// Tests the available fork-choice algorithms
|
// Tests the available fork-choice algorithms
|
||||||
|
|
||||||
extern crate beacon_chain;
|
extern crate beacon_chain;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#![cfg(not(debug_assertions))]
|
||||||
|
|
||||||
use serde_derive::Deserialize;
|
use serde_derive::Deserialize;
|
||||||
use serde_yaml;
|
use serde_yaml;
|
||||||
use state_processing::{per_block_processing, per_slot_processing};
|
use state_processing::{per_block_processing, per_slot_processing};
|
||||||
@ -15,7 +17,7 @@ pub struct ExpectedState {
|
|||||||
pub current_epoch_attestations: Option<Vec<PendingAttestation>>,
|
pub current_epoch_attestations: Option<Vec<PendingAttestation>>,
|
||||||
pub historical_roots: Option<Vec<Hash256>>,
|
pub historical_roots: Option<Vec<Hash256>>,
|
||||||
pub finalized_epoch: Option<Epoch>,
|
pub finalized_epoch: Option<Epoch>,
|
||||||
pub latest_block_roots: Option<Vec<Hash256>>,
|
pub latest_block_roots: Option<TreeHashVector<Hash256>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ExpectedState {
|
impl ExpectedState {
|
||||||
@ -26,7 +28,7 @@ impl ExpectedState {
|
|||||||
($field_name:ident) => {
|
($field_name:ident) => {
|
||||||
if self.$field_name.as_ref().map_or(true, |$field_name| {
|
if self.$field_name.as_ref().map_or(true, |$field_name| {
|
||||||
println!(" > Checking {}", stringify!($field_name));
|
println!(" > Checking {}", stringify!($field_name));
|
||||||
&state.$field_name == $field_name
|
$field_name == &state.$field_name
|
||||||
}) {
|
}) {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
|
@ -33,12 +33,6 @@ impl<T> DerefMut for TreeHashVector<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: PartialEq> PartialEq<Vec<T>> for TreeHashVector<T> {
|
|
||||||
fn eq(&self, other: &Vec<T>) -> bool {
|
|
||||||
&self.0 == other
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T> tree_hash::TreeHash for TreeHashVector<T>
|
impl<T> tree_hash::TreeHash for TreeHashVector<T>
|
||||||
where
|
where
|
||||||
T: TreeHash,
|
T: TreeHash,
|
||||||
|
@ -9,7 +9,6 @@ use serde_hex::{encode, PrefixedHexVisitor};
|
|||||||
use ssz::{Decodable, Encodable};
|
use ssz::{Decodable, Encodable};
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::default;
|
use std::default;
|
||||||
use tree_hash::tree_hash_ssz_encoding_as_list;
|
|
||||||
|
|
||||||
/// A BooleanBitfield represents a set of booleans compactly stored as a vector of bits.
|
/// A BooleanBitfield represents a set of booleans compactly stored as a vector of bits.
|
||||||
/// The BooleanBitfield is given a fixed size during construction. Reads outside of the current size return an out-of-bounds error. Writes outside of the current size expand the size of the set.
|
/// The BooleanBitfield is given a fixed size during construction. Reads outside of the current size return an out-of-bounds error. Writes outside of the current size expand the size of the set.
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use quote::{quote, ToTokens};
|
use quote::quote;
|
||||||
use syn::{parse_macro_input, DeriveInput};
|
use syn::{parse_macro_input, DeriveInput};
|
||||||
|
|
||||||
/// Returns a Vec of `syn::Ident` for each named field in the struct.
|
/// Returns a Vec of `syn::Ident` for each named field in the struct.
|
||||||
|
Loading…
Reference in New Issue
Block a user