fix(price): repair test-only price seeding broken by #753/#770 merge skew#774
Conversation
…skew PR #753 removed the BITCOIN_PRICES static when it migrated price reads to the PriceManager, while PR #770 (merged independently) added BitcoinPriceManager::set_price_for_test writing to that static — the combination doesn't compile under cargo test on main. Re-point the test seam at a small cfg(test) override map consulted by price::get_bitcoin_price before the global manager, so unit tests keep seeding deterministic prices without installing the global PriceManager (whose OnceLock would leak one test's configuration into the rest of the binary). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR consolidates Bitcoin price test overrides into a centralized, thread-safe shared map. The new infrastructure in ChangesTest price override consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
maindoes not compile undercargo test(cargo check --all-targets/cargo clippy --all-targets) since the last two merges crossed:BITCOIN_PRICESstatic when it migrated price reads to the newPriceManager.BitcoinPriceManager::set_price_for_test, which writes to that now-removed static, plus autil.rstest that calls it.Fix
Re-point the test seam at a small
#[cfg(test)]override map (price::test_price_overrides) consulted byprice::get_bitcoin_pricebefore the global manager:PriceManagerinstall in tests — itsOnceLockwould leak one test's configuration into every other test in the binary.cfg(test).Checks
cargo test: 426 passedcargo clippy --all-targets --all-features: cleancargo fmt: clean🤖 Generated with Claude Code
Summary by CodeRabbit