Skip to content

Commit

Permalink
adjust pauls test to only run for altair and to, and to assert the he…
Browse files Browse the repository at this point in the history
…ad remains unchanged
  • Loading branch information
realbigsean committed May 9, 2022
1 parent 365d58c commit 2ae43cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
19 changes: 7 additions & 12 deletions beacon_node/beacon_chain/tests/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const VALIDATOR_COUNT: usize = 24;
#[test]
fn chooses_highest_justified_checkpoint() {
let slots_per_epoch = MainnetEthSpec::slots_per_epoch();
let mut spec = MainnetEthSpec::default_spec();
spec.altair_fork_epoch = Some(Epoch::new(0));
let harness = BeaconChainHarness::builder(MainnetEthSpec)
.default_spec()
.spec(spec)
.deterministic_keypairs(VALIDATOR_COUNT)
.fresh_ephemeral_store()
.mock_execution_layer()
Expand Down Expand Up @@ -56,15 +58,12 @@ fn chooses_highest_justified_checkpoint() {
let fork_parent_slot = slot_a - reorg_distance;
let fork_parent_block = harness
.chain
.block_at_slot(fork_parent_slot.into(), WhenSlotSkipped::None)
.block_at_slot(fork_parent_slot, WhenSlotSkipped::None)
.unwrap()
.unwrap();
let fork_parent_state = harness
.chain
.get_state(
&fork_parent_block.state_root(),
Some(fork_parent_slot.into()),
)
.get_state(&fork_parent_block.state_root(), Some(fork_parent_slot))
.unwrap()
.unwrap();
let (fork_block, fork_state) = harness.make_block(fork_parent_state, slot_a + 1);
Expand Down Expand Up @@ -105,11 +104,7 @@ fn chooses_highest_justified_checkpoint() {

let head = harness.chain.head().unwrap();
assert_eq!(
head.beacon_block_root, fork_block_root,
"the fork block has become the head"
);
assert_eq!(
head.beacon_block_root, fork_block_root,
"the fork block has become the head"
head.beacon_block_root, slot_a_root,
"the fork block has not become the head"
);
}
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/tests/payload_invalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ fn invalid_parent() {
// Produce another block atop the parent, but don't import yet.
let slot = parent_block.slot() + 1;
rig.harness.set_current_slot(slot);
let (block, state) = rig.harness.make_block(parent_state, slot);
let (block, mut state) = rig.harness.make_block(parent_state, slot);
let block_root = block.canonical_root();
assert_eq!(block.parent_root(), parent_root);

Expand Down Expand Up @@ -819,7 +819,7 @@ fn invalid_parent() {
&block,
block_root,
Duration::from_secs(0),
&state,
&mut state,
PayloadVerificationStatus::Optimistic,
&rig.harness.chain.spec
),
Expand Down

0 comments on commit 2ae43cd

Please sign in to comment.