Skip to content

test(privacy): fold the block-timestamp cheat into the apply helpers - #948

Open
avi-starkware wants to merge 1 commit into
avi/screening-v3/test-fixturesfrom
avi/screening-v3/timestamp-cheat-helpers
Open

test(privacy): fold the block-timestamp cheat into the apply helpers#948
avi-starkware wants to merge 1 commit into
avi/screening-v3/test-fixturesfrom
avi/screening-v3/timestamp-cheat-helpers

Conversation

@avi-starkware

@avi-starkware avi-starkware commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

apply_actions_screened_at and assert_apply_fails_at wrap the start_cheat_block_timestamp / apply /
stop_cheat_block_timestamp sequence that each attestation-freshness test spelled out. Those tests need
a moved clock because a fresh test starts at timestamp 0, where "one second past the max age" is not
expressible, so they set a now and sign relative to it.

The helpers stop the cheat before asserting, which is what the four tests already did by hand — the
gain is that the ordering is now structural rather than per-test discipline, and a new freshness test
cannot leave the pool's clock frozen by forgetting the stop.

Also adopts the fixtures from the preceding commit at the two-user funding preamble they missed.

test_server.cairo loses 23 more lines. 77 tests, none renamed, no assertion changed.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com


This change is Reviewable

`apply_actions_screened_at` and `assert_apply_fails_at` wrap the start_cheat_block_timestamp / apply /
stop_cheat_block_timestamp sequence that each attestation-freshness test spelled out. Those tests need
a moved clock because a fresh test starts at timestamp 0, where "one second past the max age" is not
expressible, so they set a `now` and sign relative to it.

The helpers stop the cheat before asserting, which is what the four tests already did by hand — the
gain is that the ordering is now structural rather than per-test discipline, and a new freshness test
cannot leave the pool's clock frozen by forgetting the stop.

Also adopts the fixtures from the preceding commit at the two-user funding preamble they missed.

test_server.cairo loses 23 more lines. 77 tests, none renamed, no assertion changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@avi-starkware
avi-starkware force-pushed the avi/screening-v3/test-fixtures branch from 76d1fca to 07ad60b Compare August 18, 2026 14:31
@avi-starkware
avi-starkware force-pushed the avi/screening-v3/timestamp-cheat-helpers branch from b0a31b3 to 3ef7d2b Compare August 18, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant