test(platform-wallet): fix stale balance assertion in paloma shielded sync example#3831
Conversation
…mple The shielded_sync_paloma example asserted wallet A recovers a 400000-credit balance from genesis-seeded notes, but the genesis test-wallet note seeding was removed (paloma's 1M notes are filler-only), so the example always panicked with balance 0 even when sync worked perfectly. Assert what current SDK_TEST_DATA deployments actually guarantee instead: a clean sync pass (no per-wallet errors, not a cooldown skip) with total_scanned > 0, printing balances informationally. Also update the "What this proves" doc section and drop the stale shielded_test_wallets.rs cross-reference. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Paloma shielded sync example was updated to remove assertions on specific decoded balances and replace them with outcome-based criteria. The example now validates that sync completed with zero errors, produced an enabled/successful wallet state, and scanned a non-zero number of notes. Documentation and imports were adjusted accordingly, and logging was simplified. ChangesPaloma shielded sync example assertion updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 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 |
Issue being fixed or feature implemented
The
shielded_sync_palomaexample asserted wallet A (seed[0x73; 32]) recovers a 400000-credit balance (4 × 100000) from paloma's genesis-seeded shielded notes. That expectation is stale: the genesis test-wallet note seeding was removed (seeShieldedSeedConfig::sdk_test_datainpackages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/shielded.rs— wallet-balance UX no longer comes from seeded notes), so the devnet's 1M notes are filler-only and the example always panicked with balance 0 even when sync worked perfectly.What was done?
packages/rs-platform-wallet/examples/shielded_sync_paloma.rswith what currentSDK_TEST_DATA=truedeployments actually guarantee:ShieldedSyncPassSummary::error_count() == 0),WalletShieldedOutcome::Okand not a cooldown skip (the example forces the pass),notes_result.total_scanned > 0, proving the pass walked the seeded pool.COUNT_A/OWNED_VALUE/EXPECTED_BALANCE_Aconstants and the staleSEED_Across-reference to the deletedshielded_test_wallets.rs.cargo test.How Has This Been Tested?
cargo check -p platform-wallet --example shielded_sync_paloma --features shielded— compiles clean.cargo fmt --all— no formatting drift.cargo run -p platform-wallet --example shielded_sync_paloma --features shielded).Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Tests