Skip to content

Commit

Permalink
Test ProveCommitSectors3 before the required pre-commit challenge del…
Browse files Browse the repository at this point in the history
…ay has elapsed. (#1547)

Add a test for calling ProveCommitSectors3 before the required pre-commit challenge delay has elapsed.
  • Loading branch information
anorth authored May 28, 2024
1 parent 1cdf005 commit 84d40fc
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 84d40fc

Please sign in to comment.