Fix get freshness lag calculation#1659
Merged
Baskarayelu merged 2 commits intoJun 27, 2026
Merged
Conversation
|
@samlogy1 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! 🚀 |
Contributor
|
Fix get freshness lag calculation — great addition. merging 👍 |
5 tasks
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.
closes #1541
📝 Description
Adds a test suite for
get_freshnesslag calculations (Issue #1541). Covers lag at zero, lag at positive, and lag during pause. All tests use plain#[cfg(test)]— no feature gate — so they run on every CI matrix entry.🎯 Type of Change
get_freshnesslag calculation lock-in🔧 Changes Made
Files Modified
quicklendx-contracts/src/lib.rs— registered new test moduleNew Files Added
quicklendx-contracts/src/test_freshness_lag.rs— 13 tests for lag at zero, positive, and during pauseKey Changes
get_freshnessremains callable while paused and returns correct lag🧪 Testing
Test Coverage
13 deterministic tests — no
Date.now()or random values. Ledger timestamp is fixed in every test viaenv.ledger().set_timestamp().📋 Contract-Specific Checks
Contract Testing Details
Pause tests call
initialize_adminthenclient.pause(&admin)to exercise the real pause path. Nostd::calls introduced.#![no_std]discipline preserved.🔍 Code Quality
🔗 Related Issues
Closes #1541
🧪 How to Test
None. Only new test code added — no production logic or APIs modified.