Skip to content

Commit

Permalink
Add more skip slots tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 17, 2020
1 parent 3b22a83 commit e754995
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,9 @@ impl ApiTester {
let epoch = self.chain.epoch().unwrap();

let mut head = self.chain.head().unwrap();
while head.beacon_state.current_epoch() < epoch {
per_slot_processing(&mut head.beacon_state, None, &self.chain.spec).unwrap();
}
head.beacon_state
.build_committee_cache(RelativeEpoch::Current, &self.chain.spec)
.unwrap();
Expand Down Expand Up @@ -1686,32 +1689,72 @@ async fn block_production() {
ApiTester::new().test_block_production().await;
}

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

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

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

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

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

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

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

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

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

#[tokio::test(core_threads = 2)]
async fn get_validator_beacon_committee_subscriptions() {
ApiTester::new()
Expand Down

0 comments on commit e754995

Please sign in to comment.