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.
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 = []

View File

@ -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
);
}

View File

@ -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)]

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>) {
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
)
}