Problem Statement
The contract supports soroban_sdk::events as the only observability
surface. Tests collapse all events into a single stream and a failing
assertion cannot easily be tied to a specific event sequence.
Why it matters
For property-based invariant testing and fuzzing, deterministic replay
of failed sequences is essential.
Expected Outcome
Tests can be replayed with --nocapture --test-threads=1 against a
deterministic ledger so any invariant failure reproduces bit-for-bit.
Acceptance Criteria
- Jest-style test artifacts (CARGO_TARGET_TMPDIR/timing) are published.
- An example test (
swap_invariant) demonstrates the harness.
Implementation Notes
Use env.ledger().with_mut(|l| { l.timestamp = … }) — already exercised
in rate_limit.rs:sensitive_tests.
Files Affected
peerx-contracts/counter/Cargo.toml ([features] test-determinism).
- Several
*_tests.rs modules.
Dependencies Issue #1.
Difficulty / Effort 🥈 / S
Labels ci, testing, dx
Problem Statement
The contract supports
soroban_sdk::eventsas the only observabilitysurface. Tests collapse all events into a single stream and a failing
assertion cannot easily be tied to a specific event sequence.
Why it matters
For property-based invariant testing and fuzzing, deterministic replay
of failed sequences is essential.
Expected Outcome
Tests can be replayed with
--nocapture --test-threads=1against adeterministic ledger so any invariant failure reproduces bit-for-bit.
Acceptance Criteria
swap_invariant) demonstrates the harness.Implementation Notes
Use
env.ledger().with_mut(|l| { l.timestamp = … })— already exercisedin
rate_limit.rs:sensitive_tests.Files Affected
peerx-contracts/counter/Cargo.toml([features] test-determinism).*_tests.rsmodules.Dependencies Issue #1.
Difficulty / Effort 🥈 / S
Labels
ci,testing,dx