dd contributor guide for deterministic quote tests#188
Merged
Conversation
|
@nayt9 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 4 new quote monotonicity tests and comprehensive contributor documentation for CI, storage invariants, and testing best practices.
Changes
Tests (
buy_quote_monotonicity.rs
)
Added 4 tests verifying quote stability under the fixed price model:
test_buy_quote_monotonic_with_zero_creator_fee - 50/50 fee split edge case
test_buy_quote_monotonic_with_zero_protocol_fee - 100% creator fee edge case
test_buy_quote_stable_across_50_sequential_purchases - High-volume stability test
test_buy_quote_multiple_creators_independent_monotonicity - Multi-creator independence
All tests verify that quotes remain constant after purchases (fixed price model).
Documentation
ci-contract-checks.md
storage-key-invariants.md
deterministic-quote-tests.md
Updated CONTRIBUTING.md - Added links to new documentation
Key Fixes
Fee configs now sum to 10,000 bps (100%) with protocol ≤ 5,000 bps (50%)
Tests use total_amount for payments, not just price
Tests reflect global price model (shared across creators)
Test Results
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Verification
cargo test --test buy_quote_monotonicity
cargo fmt --all -- --check
cargo clippy --workspace --all-targets
closes #149
closes #151
closes #155
closes #176