diff --git a/ethcore/Cargo.toml b/ethcore/Cargo.toml index c3761ba9f..7569c6a9a 100644 --- a/ethcore/Cargo.toml +++ b/ethcore/Cargo.toml @@ -112,7 +112,7 @@ ci-skip-tests = [] # Run memory/cpu heavy tests. test-heavy = [] # Compile test helpers -test-helpers = ["tempdir", "kvdb-rocksdb", "blooms-db"] +test-helpers = ["tempdir", "kvdb-rocksdb", "blooms-db", "common-types/test-helpers"] # Enables slow 'to-pod-full' method for use in tests and evmbin. to-pod-full = [] diff --git a/ethcore/src/block.rs b/ethcore/src/block.rs index 6761d0448..c7036bded 100644 --- a/ethcore/src/block.rs +++ b/ethcore/src/block.rs @@ -303,7 +303,7 @@ impl<'x> OpenBlock<'x> { warn!( "Heavy ({} ms) transaction in block {:?}: {:?}", took_ms, - self.block.header().number(), + self.block.header.number(), hash ); } diff --git a/ethcore/src/lib.rs b/ethcore/src/lib.rs index 685ec4fdb..e05ed2584 100644 --- a/ethcore/src/lib.rs +++ b/ethcore/src/lib.rs @@ -113,6 +113,8 @@ extern crate env_logger; extern crate ethcore_accounts as accounts; #[cfg(feature = "stratum")] extern crate ethcore_stratum; +#[cfg(any(test, feature = "test-helpers"))] +extern crate kvdb_memorydb; #[cfg(any(test, feature = "kvdb-rocksdb"))] extern crate kvdb_rocksdb; #[cfg(test)] diff --git a/rpc/src/tests/http_client.rs b/rpc/src/tests/http_client.rs index c23056bd5..8f4e447b4 100644 --- a/rpc/src/tests/http_client.rs +++ b/rpc/src/tests/http_client.rs @@ -128,20 +128,32 @@ pub fn request(address: &SocketAddr, request: &str) -> Response { pub fn assert_security_headers_present(headers: &[String], port: Option) { if port.is_none() { assert!( - headers.iter().any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN") - "X-Frame-Options: SAMEORIGIN missing: {:?}", headers + headers + .iter() + .any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN"), + "X-Frame-Options: SAMEORIGIN missing: {:?}", + headers ); } assert!( - headers.iter().any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block") - "X-XSS-Protection missing: {:?}", headers + headers + .iter() + .any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block"), + "X-XSS-Protection missing: {:?}", + headers ); assert!( - headers.iter().any(|header| header.as_str() == "X-Content-Type-Options: nosniff") - "X-Content-Type-Options missing: {:?}", headers + headers + .iter() + .any(|header| header.as_str() == "X-Content-Type-Options: nosniff"), + "X-Content-Type-Options missing: {:?}", + headers ); assert!( - headers.iter().any(|header| header.starts_with("Content-Security-Policy: ")) - "Content-Security-Policy missing: {:?}", headers + headers + .iter() + .any(|header| header.starts_with("Content-Security-Policy: ")), + "Content-Security-Policy missing: {:?}", + headers ) }