Fix compilation errors

This commit is contained in:
adria0 2020-07-29 08:42:17 +02:00 committed by Artem Vorotnikov
parent 26e253e554
commit 544725a018
No known key found for this signature in database
GPG Key ID: E0148C3F2FBB7A20
4 changed files with 24 additions and 10 deletions

View File

@ -112,7 +112,7 @@ ci-skip-tests = []
# Run memory/cpu heavy tests. # Run memory/cpu heavy tests.
test-heavy = [] test-heavy = []
# Compile test helpers # 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. # Enables slow 'to-pod-full' method for use in tests and evmbin.
to-pod-full = [] to-pod-full = []

View File

@ -303,7 +303,7 @@ impl<'x> OpenBlock<'x> {
warn!( warn!(
"Heavy ({} ms) transaction in block {:?}: {:?}", "Heavy ({} ms) transaction in block {:?}: {:?}",
took_ms, took_ms,
self.block.header().number(), self.block.header.number(),
hash hash
); );
} }

View File

@ -113,6 +113,8 @@ extern crate env_logger;
extern crate ethcore_accounts as accounts; extern crate ethcore_accounts as accounts;
#[cfg(feature = "stratum")] #[cfg(feature = "stratum")]
extern crate ethcore_stratum; extern crate ethcore_stratum;
#[cfg(any(test, feature = "test-helpers"))]
extern crate kvdb_memorydb;
#[cfg(any(test, feature = "kvdb-rocksdb"))] #[cfg(any(test, feature = "kvdb-rocksdb"))]
extern crate kvdb_rocksdb; extern crate kvdb_rocksdb;
#[cfg(test)] #[cfg(test)]

View File

@ -128,20 +128,32 @@ pub fn request(address: &SocketAddr, request: &str) -> Response {
pub fn assert_security_headers_present(headers: &[String], port: Option<u16>) { pub fn assert_security_headers_present(headers: &[String], port: Option<u16>) {
if port.is_none() { if port.is_none() {
assert!( assert!(
headers.iter().any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN") headers
"X-Frame-Options: SAMEORIGIN missing: {:?}", headers .iter()
.any(|header| header.as_str() == "X-Frame-Options: SAMEORIGIN"),
"X-Frame-Options: SAMEORIGIN missing: {:?}",
headers
); );
} }
assert!( assert!(
headers.iter().any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block") headers
"X-XSS-Protection missing: {:?}", headers .iter()
.any(|header| header.as_str() == "X-XSS-Protection: 1; mode=block"),
"X-XSS-Protection missing: {:?}",
headers
); );
assert!( assert!(
headers.iter().any(|header| header.as_str() == "X-Content-Type-Options: nosniff") headers
"X-Content-Type-Options missing: {:?}", headers .iter()
.any(|header| header.as_str() == "X-Content-Type-Options: nosniff"),
"X-Content-Type-Options missing: {:?}",
headers
); );
assert!( assert!(
headers.iter().any(|header| header.starts_with("Content-Security-Policy: ")) headers
"Content-Security-Policy missing: {:?}", headers .iter()
.any(|header| header.starts_with("Content-Security-Policy: ")),
"Content-Security-Policy missing: {:?}",
headers
) )
} }