feat: enhance HoS credit confirmation policy#295
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a configurable purchase confirmation freshness window for House-of-Stake (HoS) credit purchases, replacing the hardcoded 15-minute window with a default of 24 hours that can be overridden per provider. It also optimizes on-chain calls by removing redundant price checks during subscription changes and fetching purchase and price data concurrently during purchase confirmation. Comprehensive unit tests have been added to verify the new freshness validation logic and configuration deserialization. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
fd4be87 to
df3b19d
Compare
Summary
Follow-up to #294 / PR #275 review notes.
user_id,purchase_id,age_ns,confirm_window_ns)./v1/credits/confirmOpenAPI 400 text to mention stale purchases.Validation
cargo fmtgit diff --checkcargo test -p services subscription::servicecargo test -p services system_configs::portscargo clippy -p services --all-targets -- -D warningsAlso ran
cargo test --test credits_tests --features test test_confirm_house_of_stake_credit_purchase; it compiled, then failed locally because Postgres is not running (Connection refusedduring test migrations).cargo clippy -p services --all-targets --all-features -- -D warningsstill fails on pre-existingutoipa::ToSchemaerrors forUuid/DateTimein analytics/user ports, unrelated to this change.