Avoid changing slasher schema for Electra

This commit is contained in:
Michael Sproul
2024-06-21 12:02:23 +10:00
parent 27ed90e4dc
commit b6913ae542
13 changed files with 178 additions and 60 deletions

View File

@@ -2,7 +2,7 @@
use logging::test_logger;
use slasher::{
test_utils::{block as test_block, E},
test_utils::{block as test_block, chain_spec, E},
Config, Slasher,
};
use tempfile::tempdir;
@@ -12,7 +12,8 @@ use types::{Epoch, EthSpec};
fn empty_pruning() {
let tempdir = tempdir().unwrap();
let config = Config::new(tempdir.path().into());
let slasher = Slasher::<E>::open(config, test_logger()).unwrap();
let spec = chain_spec();
let slasher = Slasher::<E>::open(config, spec, test_logger()).unwrap();
slasher.prune_database(Epoch::new(0)).unwrap();
}
@@ -24,8 +25,9 @@ fn block_pruning() {
let mut config = Config::new(tempdir.path().into());
config.chunk_size = 2;
config.history_length = 2;
let spec = chain_spec();
let slasher = Slasher::<E>::open(config.clone(), test_logger()).unwrap();
let slasher = Slasher::<E>::open(config.clone(), spec, test_logger()).unwrap();
let current_epoch = Epoch::from(2 * config.history_length);
// Pruning the empty database should be safe.