Skip to content

Commit

Permalink
Add a test for calling ProveCommitSectors3 before the required pre-co…
Browse files Browse the repository at this point in the history
…mmit challenge delay has elapsed.
  • Loading branch information
anorth committed May 28, 2024
1 parent ca68aa2 commit fc274c2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions actors/miner/tests/prove_commit2_failures_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ fn reject_mismatched_proof_len() {
h.check_state(&rt);
}

#[test]
fn reject_too_soon() {
let (h, rt, activations) = setup_precommits(&[(0, 0, 0)]);
let epoch = *rt.epoch.borrow();
rt.set_epoch(epoch - 2);
let cfg = ProveCommitSectors2Config::default();
expect_abort_contains_message(
ExitCode::USR_FORBIDDEN,
"too early to prove sector",
h.prove_commit_sectors2(&rt, &activations, false, false, false, cfg),
);
h.check_state(&rt);
}

#[test]
fn reject_expired_precommit() {
let (h, rt, activations) = setup_precommits(&[(0, 0, 0)]);
Expand Down

0 comments on commit fc274c2

Please sign in to comment.