mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 11:25:55 +00:00
Fix builds with slasher-redb (#6077)
* Fix builds with slasher-redb feature * Test redb on CI * Delete unnecessary test * Disable redb in slasher override tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#![cfg(any(feature = "lmdb", feature = "redb"))]
|
||||
#![cfg(feature = "lmdb")]
|
||||
|
||||
use slasher::{config::MDBX_DATA_FILENAME, Config, DatabaseBackend, DatabaseBackendOverride};
|
||||
use std::fs::File;
|
||||
@@ -41,7 +41,7 @@ fn no_override_with_existing_mdbx_db() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(not(feature = "mdbx"), feature = "lmdb", not(feature = "redb")))]
|
||||
#[cfg(all(not(feature = "mdbx"), feature = "lmdb"))]
|
||||
fn failed_override_with_existing_mdbx_db() {
|
||||
let tempdir = tempdir().unwrap();
|
||||
let mut config = Config::new(tempdir.path().into());
|
||||
@@ -55,19 +55,3 @@ fn failed_override_with_existing_mdbx_db() {
|
||||
);
|
||||
assert_eq!(config.backend, DatabaseBackend::Lmdb);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "redb")]
|
||||
fn failed_override_with_existing_mdbx_db() {
|
||||
let tempdir = tempdir().unwrap();
|
||||
let mut config = Config::new(tempdir.path().into());
|
||||
|
||||
let filename = config.database_path.join(MDBX_DATA_FILENAME);
|
||||
File::create(&filename).unwrap();
|
||||
|
||||
assert_eq!(
|
||||
config.override_backend(),
|
||||
DatabaseBackendOverride::Failure(filename)
|
||||
);
|
||||
assert_eq!(config.backend, DatabaseBackend::Redb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user