Skip to content

test: added coverage for warp_to_slot - #452

Merged
Aursen merged 1 commit into
LiteSVM:masterfrom
Lightx0x:test/warp-to-slot
Oct 29, 2026
Merged

Aursen merged 1 commit into
LiteSVM:masterfrom
Lightx0x:test/warp-to-slot

Conversation

@Lightx0x

@Lightx0x Lightx0x commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds tests for warp_to_slot's documented behaviour. warp_to_slot sets Clock.slot and leaves the rest of the Clock unchanged. One test warps forward, one backward, and both compare the whole Clock against the one read before the warp.

Five existing tests call warp_to_slot, and two would catch it not setting the slot, but none check the other fields. A version that also changes the epoch passes them all. Mutation check, with clock.epoch += 1 added inside
warp_to_slot:

test result
compute_budget 9 passed
stake_program 1 passed
persistence roundtrip 20 passed
warp_to_slot (this PR) 2 failed

Tested: cargo test --features precompiles, all passed; fmt --check and clippy --all-features --all-targets clean.

Related: #451, which fixes a test helper that undid its own warp.

@Aursen
Aursen merged commit 897f389 into LiteSVM:master Oct 29, 2026
23 checks passed
@Lightx0x
Lightx0x deleted the test/warp-to-slot branch October 29, 2026 13:40
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.

2 participants