Skip to content

Test/spam deterrence and tests - #169

Open
Tukura11 wants to merge 4 commits into
stellar-vortex-protocol:mainfrom
Tukura11:test/spam-deterrence-and-tests
Open

Test/spam deterrence and tests#169
Tukura11 wants to merge 4 commits into
stellar-vortex-protocol:mainfrom
Tukura11:test/spam-deterrence-and-tests

Conversation

@Tukura11

Copy link
Copy Markdown

Summary

This PR adds spam-deterrence mechanisms for intent cancellation and comprehensive test coverage for the intent settlement contract,
including event assertions and end-to-end integration tests.

Changes

#63 — Add spam-deterrence for repeated intent cancellation

  • Added a 10-second cooldown between consecutive cancellations per user
  • Implemented `CancelCooldown` storage key to track last cancellation time
  • Added `CancelCooldownNotExpired` error type
  • Tests verify cooldown enforcement and independent per-user tracking

#64 — Add fuzz/property tests for compute_intent_id collision resistance

  • Added 6 comprehensive tests asserting no collisions across different intent parameters
  • Tests cover: different users, different amounts, different chains, different timestamps
  • Batch test generates 10 intents with varying parameters to verify uniqueness

#65 — Add tests asserting exact event topics and payloads for every emitted event

  • Added 15 event assertion tests covering all emitted events:
    • set_fee_recipient_updated
    • admin_transferred
    • dst_token_allowed / dst_token_disallowed
    • paused
    • solver_registered / solver_deregistered
    • bond_withdrawn
    • intent_submitted / intent_accepted / intent_filled / intent_cancelled
    • solver_slashed
    • intent_expired
  • Tests verify exact topic structure and payload shape

#66 — Add end-to-end ledger-time integration test for full slash/reopen cycle

  • Complete 6-step integration test exercising: submit → accept → advance time → slash → reopen → second solver fills
  • Verifies intermediate IntentState transitions at each step
  • Tests time-dependent branches together (slash after FILL_WINDOW, deadline reset on reopen, etc.)
  • Validates solver bond penalty, active_intents counter decrements, and fund flows

Notes

  • Code-only delivery: no install/build/test/scripts run during implementation
  • Committer: Tukura11 (Admailo)
  • All tests utilize Soroban SDK testutils for time manipulation and event inspection
  • No external dependencies added

Closes #63, Closes #64, Closes #65, Closes #66

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@Tukura11 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant