Skip to content

Update block processing tests for v0.9 #614

@michaelsproul

Description

@michaelsproul

Description

In #597 I commented out some of the new block processing tests because they were failing due to the v0.9 update.

Steps to Resolve

Update the commented out tests (tagged with FIXME) in state_processing/src/per_block_processing/tests.rs:

/* FIXME: needs updating for v0.9
#[test]
fn invalid_exit_not_active() {
use std::cmp::max;
let spec = MainnetEthSpec::default_spec();
let num_exits = 1;
let test_task = ExitTestTask::NotActive;
let num_validators = max(VALIDATOR_COUNT, num_exits);
let builder = get_builder(&spec, EXIT_SLOT_OFFSET, num_validators);
let (block, mut state) = builder.build_with_n_exits(num_exits, test_task, None, None, &spec);
let result = per_block_processing(
&mut state,
&block,
None,
BlockSignatureStrategy::VerifyIndividual,
&spec,
);
// Expecting NotActive because we manually set the activation_epoch to be in the future
assert_eq!(
result,
Err(BlockProcessingError::ExitInvalid {
index: 0,
reason: ExitInvalid::NotActive(0),
})
);
}
*/

It would be ideal if the updated tests could be made to depend on a minimum number of "magic numbers". Instead we should use spec constants or fields of the state to mutate operations.

You can start on this before v0.9 is merged by checking out the v0.9 branch.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions