Conversation
Add proptest-based monotonicity verification for the Stepped decay curve in Dutch auctions, closing the gap in property test coverage. Changes: - tests/curves.rs: Add price_never_increases_stepped proptest for compute_dutch_price with Stepped decay (100 cases) - src/curves.rs: Add stepped_price_never_increases deterministic test for calculate_price - src/curves.rs: Add stepped_price_never_increases_various_intervals testing multiple interval configurations - src/curves.rs: Add stepped_monotonic_proptest for calculate_price with randomized parameters (100 cases) The new tests verify that Stepped decay prices are non-increasing over time, matching the existing coverage for Linear and Exponential decay modes. Closes Creditra#1160
|
@blazesgl 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.
Summary
Add property-based monotonicity tests for the Stepped decay curve in Dutch auctions, closing the coverage gap identified in #1160.
Why this matters
The existing property tests in
tests/curves.rsverify monotonicity for Linear and Exponential decay modes but were missing dedicated coverage for Stepped decay. This gap means regressions in the Stepped decay price calculation could go undetected.Changes
tests/curves.rs(integration tests)price_never_increases_stepped— 100-case proptest verifyingcompute_dutch_priceproduces non-increasing prices over time for Stepped decay with randomizedstart_price,floor_price,step_count, andt.src/curves.rs(unit tests)stepped_price_never_increases— Deterministic test verifyingcalculate_pricewith Stepped decay is non-increasing over 100 time steps.stepped_price_never_increases_various_intervals— Tests the same property across 6 different interval configurations (1, 3, 5, 10, 20, 50).stepped_monotonic_proptest— 100-case proptest verifyingcalculate_pricewith randomizedstart_price,step_size,interval, andt.Test strategy
The new tests verify the fundamental invariant that Dutch auction prices never increase over time for the Stepped decay mode. This property is critical because:
The tests complement the existing Kani formal verification proofs in
proofs/dutch_price.rswhich already prove this property for all decay modes, but the proptests provide an additional runtime safety net with randomized inputs.Validation
cargo fmt --checkpassesCloses #1160