From 2155e3e293390539d2391eeda906f573a65fa59f Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 17 Apr 2019 18:54:21 +1000 Subject: [PATCH 1/6] Fix non-compiling tests --- eth2/state_processing/tests/tests.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/eth2/state_processing/tests/tests.rs b/eth2/state_processing/tests/tests.rs index ccad198bb..dd611b459 100644 --- a/eth2/state_processing/tests/tests.rs +++ b/eth2/state_processing/tests/tests.rs @@ -1,6 +1,5 @@ use serde_derive::Deserialize; use serde_yaml; -#[cfg(not(debug_assertions))] use state_processing::{per_block_processing, per_slot_processing}; use std::{fs::File, io::prelude::*, path::PathBuf}; use types::*; From 5e81a995ea4b9d7e623c3d7720aa935be58a2aca Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 17 Apr 2019 18:54:39 +1000 Subject: [PATCH 2/6] Use signed_root for canonical header ID --- eth2/types/src/beacon_block_header.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth2/types/src/beacon_block_header.rs b/eth2/types/src/beacon_block_header.rs index fa71bd26b..e4db3a721 100644 --- a/eth2/types/src/beacon_block_header.rs +++ b/eth2/types/src/beacon_block_header.rs @@ -5,7 +5,7 @@ use rand::RngCore; use serde_derive::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; -use tree_hash::TreeHash; +use tree_hash::{SignedRoot, TreeHash}; use tree_hash_derive::{SignedRoot, TreeHash}; /// A header of a `BeaconBlock`. @@ -37,7 +37,7 @@ impl BeaconBlockHeader { /// /// Spec v0.5.1 pub fn canonical_root(&self) -> Hash256 { - Hash256::from_slice(&self.tree_hash_root()[..]) + Hash256::from_slice(&self.signed_root()[..]) } /// Given a `body`, consumes `self` and returns a complete `BeaconBlock`. From ab75f7cbc713f85fa56d2f41e7c928818c8d005c Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 24 Apr 2019 11:37:19 +1000 Subject: [PATCH 3/6] Fix cargo cmd in Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 48a07e1e7..845cd357f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,7 @@ pipeline { sh 'cargo test --verbose --all' sh 'cargo test --verbose --all --release' sh 'cargo test --manifest-path eth2/state_processing/Cargo.toml --verbose \ - --release --features fake_crypto --ignored' + --release --features fake_crypto -- --include-ignored' } } From 6ae00838437a932add676cbb821763d99c99d5af Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 24 Apr 2019 11:41:33 +1000 Subject: [PATCH 4/6] Add travis caching. Reference for commands: https://levans.fr/rust_travis_cache.html --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 70b9d2133..f89db54c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: rust +cache: + directories: + - /home/travis/.cargo +before_cache: + - rm -rf /home/travis/.cargo/registry before_install: - curl -OL https://github.com/google/protobuf/releases/download/v3.4.0/protoc-3.4.0-linux-x86_64.zip - unzip protoc-3.4.0-linux-x86_64.zip -d protoc3 From 0bb9c59b4764f95ab07bbc4cacb0f2b95fae57b7 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 25 Apr 2019 12:24:45 +1000 Subject: [PATCH 5/6] Add ignored and non-ignored state-trans tests --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 845cd357f..11cbf0abe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,7 +24,9 @@ pipeline { sh 'cargo test --verbose --all' sh 'cargo test --verbose --all --release' sh 'cargo test --manifest-path eth2/state_processing/Cargo.toml --verbose \ - --release --features fake_crypto -- --include-ignored' + --release --features fake_crypto' + sh 'cargo test --manifest-path eth2/state_processing/Cargo.toml --verbose \ + --release --features fake_crypto -- --ignored' } } From a76b24e274a30694004f919372698e707cfb9dff Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 25 Apr 2019 12:25:01 +1000 Subject: [PATCH 6/6] Disable running docs example for test harness --- beacon_node/beacon_chain/test_harness/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon_node/beacon_chain/test_harness/src/lib.rs b/beacon_node/beacon_chain/test_harness/src/lib.rs index 0703fd4a5..e93fa7003 100644 --- a/beacon_node/beacon_chain/test_harness/src/lib.rs +++ b/beacon_node/beacon_chain/test_harness/src/lib.rs @@ -8,7 +8,7 @@ //! producing blocks and attestations. //! //! Example: -//! ``` +//! ```rust,no_run //! use test_harness::BeaconChainHarness; //! use types::ChainSpec; //!