Skip to content

refactor: unify internal timestamp casting to u64#243

Merged
hman38705 merged 3 commits into
solutions-plug:mainfrom
dreamgene:refactor/157-unify-timestamp-casting-u64
Mar 26, 2026
Merged

refactor: unify internal timestamp casting to u64#243
hman38705 merged 3 commits into
solutions-plug:mainfrom
dreamgene:refactor/157-unify-timestamp-casting-u64

Conversation

@dreamgene

Copy link
Copy Markdown
Contributor

Closes #157

Summary

  • unify oracle timestamp handling to u64 internally
  • add safe conversion for external i64 publish times using try_into()
  • centralize age validation behind an is_stale helper using saturating_sub
  • reject invalid negative external timestamps explicitly

Testing

  • cargo fmt --all
  • cargo test -p predict-iq modules::oracles_test -- --nocapture (blocked by unrelated pre-existing compile failures in other modules such as lib.rs, bets.rs, fees.rs, and voting.rs before oracle tests can run)

Notes

  • this change also restores the oracle config shape expected by the repo and wires the oracle test module into the crate test tree
  • no raw as u64 casts remain for external oracle publish times in the oracle module

@drips-wave

drips-wave Bot commented Mar 26, 2026

Copy link
Copy Markdown

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

@hman38705 hman38705 merged commit 5d317ff into solutions-plug:main Mar 26, 2026
1 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify Internal Timestamp Casting to u64

2 participants