Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Jan 29, 2026

Add the height management to the interface to make it more accessible and rename it in the same go to synced_height since it's more to the point.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Updated wallet synchronization height tracking to use synced height for better state management consistency.
  • Tests

    • Updated integration and unit tests to reflect synchronized height tracking changes.

✏️ Tip: You can customize this high-level summary in your review settings.

Add the height management to the interface to make it more accessible and rename it in the same go to `synced_height` since it's more to the point.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This PR refactors wallet height tracking APIs from current_height to synced_height throughout the wallet system, including replacing related method calls (update_heightupdate_synced_height) in multiple layers of the codebase. The changes affect trait definitions, trait implementations, FFI bindings, and test utilities.

Changes

Cohort / File(s) Summary
dash-spv message handling
dash-spv/src/sync/legacy/message_handlers.rs, dash-spv/src/sync/legacy/post_sync.rs
Added update_synced_height(height) calls after storing filters to synchronize wallet state with verified filter height.
WalletInterface trait
key-wallet-manager/src/wallet_interface.rs
Added two new public methods: synced_height() -> CoreBlockHeight and update_synced_height(height: CoreBlockHeight) to the trait.
WalletManager internal implementation
key-wallet-manager/src/wallet_manager/mod.rs, key-wallet-manager/src/wallet_manager/process_block.rs
Renamed internal field from current_height to synced_height, removed public current_height() and update_height() methods, added private synced_height() and update_synced_height() methods implementing the trait, and updated field initialization and height propagation logic.
Test utilities and mocks
key-wallet-manager/src/test_utils/wallet.rs, key-wallet-manager/tests/integration_test.rs, key-wallet-manager/tests/spv_integration_tests.rs, key-wallet-ffi/src/wallet_manager_tests.rs
Updated MockWallet and NonMatchingMockWallet to include synced_height field and methods; updated all test assertions and calls to use synced_height() instead of current_height() and update_synced_height() instead of update_height().
FFI bindings
key-wallet-ffi/src/wallet_manager.rs
Replaced height retrieval call in wallet_manager_current_height from current_height() to synced_height().
Example code
key-wallet-manager/examples/wallet_creation.rs
Updated to use synced_height() and update_synced_height() instead of deprecated height methods.
WalletInfoInterface
key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs
Updated synced_height() method signature on WalletInfoInterface trait (no parameter changes but documentation clarified).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • ZocoLini

Poem

🐰 Heights were renamed with careful care,
From current to synced, everywhere!
Each trait updated, each field replaced,
The wallet's state now properly traced! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding synced height tracking to the wallet interface and renaming related height management methods.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@xdustinface xdustinface merged commit c5e21f2 into v0.42-dev Jan 30, 2026
53 checks passed
@xdustinface xdustinface deleted the feat/update-synced-height branch January 30, 2026 00:04
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.

3 participants