Skip to content

Commit

Permalink
Add (failing) skip slots tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 17, 2020
1 parent 6aa9f30 commit 2e9afb8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ impl ApiTester {
}
}

fn skip_slots(self, count: u64) -> Self {
for _ in 0..count {
self.chain
.slot_clock
.set_slot(self.chain.slot().unwrap().as_u64() + 1);
}

self
}

fn interesting_state_ids(&self) -> Vec<StateId> {
let mut ids = vec![
StateId::Head,
Expand Down Expand Up @@ -1644,11 +1654,27 @@ async fn get_validator_duties_attester() {
ApiTester::new().test_get_validator_duties_attester().await;
}

#[tokio::test(core_threads = 2)]
async fn get_validator_duties_attester_with_skip_slots() {
ApiTester::new()
.skip_slots(E::slots_per_epoch() * 2)
.test_get_validator_duties_attester()
.await;
}

#[tokio::test(core_threads = 2)]
async fn get_validator_duties_proposer() {
ApiTester::new().test_get_validator_duties_proposer().await;
}

#[tokio::test(core_threads = 2)]
async fn get_validator_duties_proposer_with_skip_slots() {
ApiTester::new()
.skip_slots(E::slots_per_epoch() * 2)
.test_get_validator_duties_proposer()
.await;
}

#[tokio::test(core_threads = 2)]
async fn block_production() {
ApiTester::new().test_block_production().await;
Expand Down

0 comments on commit 2e9afb8

Please sign in to comment.