Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 5, 2020
1 parent 01bf1e4 commit 56aa87c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,19 @@ impl ApiTester {

let (next_block, _next_state) = harness.get_block();
let head = harness.chain.head().unwrap();

assert_eq!(
harness.chain.slot().unwrap(),
head.beacon_block.slot() + 1,
"precondition: current slot is one after head"
);

let attestations = harness
.get_unaggregated_attestations(
&AttestationStrategy::AllValidators,
&head.beacon_state,
head.beacon_block_root,
head.beacon_state.slot + 1,
harness.chain.slot().unwrap(),
)
.into_iter()
.map(|vec| vec.into_iter().map(|(attestation, _subnet_id)| attestation))
Expand Down Expand Up @@ -717,7 +724,7 @@ impl ApiTester {
.is_err());

assert!(
self.network_rx.try_recv().is_ok(),
self.network_rx.try_recv().is_err(),
"invalid attestation should not be sent to network"
);
}
Expand Down

0 comments on commit 56aa87c

Please sign in to comment.