Skip to content

Feature/docs and tests batch - #171

Open
favourawaku wants to merge 3 commits into
stellar-vortex-protocol:mainfrom
favourawaku:feature/docs-and-tests-batch
Open

Feature/docs and tests batch#171
favourawaku wants to merge 3 commits into
stellar-vortex-protocol:mainfrom
favourawaku:feature/docs-and-tests-batch

Conversation

@favourawaku

Copy link
Copy Markdown

Summary

This batch addresses four GitHub issues: documentation for intent ID derivation (#82), two test improvements for contract behavior (#79, #81),
and CI infrastructure for mutation testing (#80).

Changes

#82 — Document the intent_id derivation scheme

  • Added Intent ID Derivation section to README with exact preimage field ordering
  • Documented hash function (SHA-256) and field types for off-chain solver tooling
  • Included pseudocode example for reference implementations
  • Cross-linked from lib.rs compute_intent_id implementation

#79 — Add test asserting expire_intent rejects early call

  • Added expire_intent_before_deadline_state_unchanged() test
  • Verifies rejection with Error::DeadlineNotReached when called before deadline
  • Confirms intent state remains Open after failed expiry attempt

#81 — Add test for get_stats reflecting cumulative totals

  • Added get_stats_reflects_cumulative_totals_across_multiple_fills() test
  • Tests multiple submit/accept/fill cycles to verify counter accumulation
  • Includes cancelled and expired intents to confirm they affect TotalIntents but not TotalVolume
  • Verifies both counters accumulate correctly across multiple operations

#80 — Add mutation-testing CI job

  • Added mutants job to .github/workflows/ci.yml
  • Runs cargo-mutants to detect inadequately-tested code
  • Set as non-blocking (continue-on-error) to avoid CI failures on surviving mutants
  • Future iterations can use baseline results to improve test coverage

Test Results

All 57 existing tests pass. New tests verify:

  • Intent expiry rejection before deadline
  • Protocol stats accumulation across multiple fills
  • Cancelled/expired intents don't contribute to volume

Closes #82, Closes #79, Closes #81, Closes #80

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@favourawaku 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