Skip to content

Conversation

@xdustinface
Copy link
Collaborator

@xdustinface xdustinface commented Dec 28, 2025

This fixes a bunch of memory leaks in tests detected by sanitizer in CI overhaul PR #253. Not that the leaks in tests matter much but with this we can run the sanitizer for all FFI PRs to make sure we don't introduce actual leaks somewhere in the FFI code.

See individual commit messages for more details about what was changed.

Summary by CodeRabbit

  • Bug Fixes

    • Improved memory management and resource cleanup across FFI test suites to prevent potential memory leaks.
  • Chores

    • Enhanced internal memory management infrastructure with explicit cleanup of error messages and array destruction patterns in tests.
    • Strengthened resource deallocation practices across test utilities to ensure proper cleanup of allocated FFI objects.

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

The tests were wrapping `FFIArray` in a `Box` before passing to
`dash_spv_ffi_array_destroy`, but that function only frees the internal
data buffer, not the struct itself. This caused the `Box` allocations to leak.
- Properly keep track of all create wallets and wallet infos and clean them up at the end.
- Head allocate wallet infos like it would happen in real FFI usage and
  free them properly at the end.
- Modified `set_error`, `set_success`, and `ffi_error_set` macro to
  free previous error messages before setting new ones
- Added `FFIError::free_message` helper for test cleanup
- Added cleanup in all relevalt tests
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 28, 2025

📝 Walkthrough

Walkthrough

This pull request refactors memory management and resource cleanup across multiple test suites and the FFI error module. Changes include introducing a new free_message() method on FFIError, adjusting FFIArray destruction patterns from box-based to mutable reference-based approaches, and adding explicit error message cleanup calls throughout test files in both dash-spv-ffi and key-wallet-ffi modules.

Changes

Cohort / File(s) Summary
dash-spv-ffi FFIArray Destruction
dash-spv-ffi/tests/test_types.rs, dash-spv-ffi/tests/unit/test_memory_management.rs, dash-spv-ffi/tests/unit/test_type_conversions.rs
Changed FFIArray destruction from Box::into_raw(Box::new(...)) pattern to mutable local bindings with raw pointer from mutable references (&mut ... as *mut FFIArray). Introduces mutability in array declarations and adjusts iteration patterns for proper mutable reference handling.
dash-spv-ffi Auxiliary Resource Cleanup
dash-spv-ffi/tests/unit/test_client_lifecycle.rs
Captures results from dash_spv_ffi_client_get_sync_progress and dash_spv_ffi_client_get_stats into variables and explicitly destroys them with corresponding destroy functions before client cleanup.
key-wallet-ffi Error Message Cleanup
key-wallet-ffi/src/account_derivation_tests.rs, key-wallet-ffi/src/account_tests.rs, key-wallet-ffi/src/address_pool.rs, key-wallet-ffi/src/address_tests.rs, key-wallet-ffi/src/derivation_tests.rs, key-wallet-ffi/src/keys_tests.rs, key-wallet-ffi/src/mnemonic_tests.rs, key-wallet-ffi/src/transaction_tests.rs, key-wallet-ffi/src/wallet_tests.rs, key-wallet-ffi/tests/integration_test.rs, key-wallet-ffi/tests/test_managed_account_collection.rs
Adds explicit calls to error.free_message() across numerous test cleanup paths to release allocated error message buffers. Changes ensure consistent resource deallocation without altering test logic or control flow.
key-wallet-ffi Managed Wallet Pointer Pattern
key-wallet-ffi/src/managed_wallet.rs, key-wallet-ffi/src/utxo_tests.rs
Updates test code to pass heap-allocated raw pointers (Box::into_raw(Box::new(...))) instead of mutable references for FFIManagedWalletInfo. Adds corresponding cleanup calls to managed_wallet_free() and error message deallocation.
key-wallet-ffi Error Type Enhancement
key-wallet-ffi/src/error.rs
Adds new public unsafe method FFIError::free_message() to explicitly deallocate message buffers. Improves memory management in set_error, set_success, and ffi_error_set macro by freeing previously stored C strings before overwriting.
key-wallet-ffi Manager Lifecycle & Serialization
key-wallet-ffi/src/managed_wallet_tests.rs, key-wallet-ffi/src/wallet_manager_serialization_tests.rs, key-wallet-ffi/src/wallet_manager_tests.rs
Introduces distinct manager variables to avoid reuse across sequential operations. Expands cleanup blocks with error message deallocation alongside existing resource frees for wallets, managers, and serialized bytes.
key-wallet-ffi Error Conversion Tests
key-wallet-ffi/tests/test_error_conversions.rs
Adds helper function assert_ffi_error_code() to test FFIError codes and clean up messages, replacing repetitive assertion patterns with centralized cleanup logic.
key-wallet-ffi Import & Null Safety Tests
key-wallet-ffi/tests/test_import_wallet.rs, key-wallet-ffi/tests/test_managed_account_collection.rs
Adds import of wallet_free_const and introduces explicit error message and wallet cleanup calls in test teardown sequences.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hoppy hops through memory's garden fair,
Freeing each message with utmost care,
From mutant arrays to errors so bright,
Cleanup at last—no leaks in sight! 🌿

Pre-merge checks and finishing touches

✅ 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 'fix: prevent memory leaks in FFI tests' directly and clearly summarizes the main changes—adding explicit memory cleanup calls and fixing memory management patterns in FFI-related test code to prevent leaks detected by a sanitizer.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ffi-test-memory-leaks

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3884314 and e0053f1.

📒 Files selected for processing (23)
  • dash-spv-ffi/tests/test_types.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CLAUDE.md)

Never hardcode network parameters, addresses, or keys

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Use proper error types (thiserror) and propagate errors appropriately
Use tokio runtime for async operations
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality
Use secure random number generation for keys
Never log or expose private keys
Code must target Rust 1.89 minimum supported version (MSRV)
Format code using cargo fmt
Pass clippy linting without warnings

**/*.rs: MSRV (Minimum Supported Rust Version) is 1.89; ensure compatibility with this version for all builds
Unit tests should live alongside code with #[cfg(test)] annotation; integration tests use the tests/ directory
Use snake_case for function and variable names
Use UpperCamelCase for types and traits
Use SCREAMING_SNAKE_CASE for constants
Format code with rustfmt before commits; ensure cargo fmt --all is run
Run cargo clippy --workspace --all-targets -- -D warnings for linting; avoid warnings in CI
Prefer async/await via tokio for asynchronous operations

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/*-ffi/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*-ffi/**/*.rs: Exercise careful handling at FFI boundaries for memory safety
Be careful with FFI memory management

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
dash-spv-ffi/tests/unit/**/*.rs

📄 CodeRabbit inference engine (dash-spv-ffi/CLAUDE.md)

Add corresponding unit tests in tests/unit/ for each new FFI function

Files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/tests/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/tests/**/*.rs: Create integration tests for network operations
Test both mainnet and testnet configurations
Use proptest for property-based testing where appropriate

**/tests/**/*.rs: Use descriptive test names (e.g., test_parse_address_mainnet)
Mark network-dependent or long-running tests with #[ignore] and run with -- --ignored

Files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
🧠 Learnings (46)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : All FFI types must have corresponding `_destroy()` functions for explicit memory management
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use thread-local storage for error propagation via `dash_spv_ffi_get_last_error()` function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Be careful with FFI memory management
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/c_tests/**/*.{c,h} : Add corresponding C tests in `tests/c_tests/` for each new FFI function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Exercise careful handling at FFI boundaries for memory safety
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Be careful with FFI memory management

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Exercise careful handling at FFI boundaries for memory safety

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : All FFI types must have corresponding `_destroy()` functions for explicit memory management

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use the `?` operator for error propagation, provide context in error messages, never panic in library code, and return `Result<T>` for all fallible operations

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/tests/**/*.rs : Use descriptive test names (e.g., `test_parse_address_mainnet`)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to src/**/*.rs : Avoid `unwrap()` and `expect()` in library code; use proper error types (e.g., `thiserror`)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-06-26T15:48:36.342Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:48:36.342Z
Learning: In Rust FFI code, unwrap() must not be used on CString::new, especially for error messages or untrusted input, as it can panic if the string contains null bytes. Instead, use unwrap_or_else with a fallback to a known-safe, hardcoded string to prevent panics across FFI boundaries.

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Always validate network consistency when deriving or validating addresses; never mix mainnet and testnet operations

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-06-26T15:49:53.811Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:49:53.811Z
Learning: In Rust FFI code, using thread-local storage for error reporting is unsafe in multi-threaded contexts, as callbacks may execute on different threads than the caller, leading to lost or invisible errors. FFI error handling should use global, thread-safe storage or return errors directly via return values or out parameters.

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Separate immutable structures (`Account`, `Wallet`) containing only identity information from mutable wrappers (`ManagedAccount`, `ManagedWalletInfo`) with state management

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/account/**/*.rs : Use enum-based type system for `AccountType` with specific variants (Standard, IdentityAuthentication, IdentityEncryption, MasternodeOperator, etc.) to provide compile-time safety and clear semantics

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use `BTreeMap` for ordered data (accounts, transactions) and `HashMap` for lookups (address mappings); apply memory management strategies for old transaction data

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/managed_account/**/*.rs : Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Organize unit tests by functionality: separate test files for BIP32, mnemonics, addresses, derivation paths, and PSBT operations

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Use property-based testing for complex invariants such as gap limit constraints

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Applied to files:

  • key-wallet-ffi/src/transaction_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Add cbindgen annotations for complex types in FFI functions

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use `#[no_mangle] extern "C"` attribute when implementing new FFI functions in Rust

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/tests/**/*.rs : Organize tests into unit tests (in-module), integration tests (tests/ directory), real network tests (with live Dash Core nodes), and performance benchmarks

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use thread-local storage for error propagation via `dash_spv_ffi_get_last_error()` function

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: FFI bindings are organized in `*-ffi` crates; shared helpers in `internals/` and `test-utils/`

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Generate addresses in batches using gap limit and staged generation instead of unbounded address generation to prevent memory and performance issues

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Pre-generate addresses in batches (typically 20-100) and store them in pools; only derive on-demand when the pool is exhausted

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Use staged gap limit management with `GapLimitStage` tracking `last_used_index` and `used_indices` to enable efficient address discovery without loading entire chains into memory

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Support multiple `KeySource` variants (Private, Public, NoKeySource) to enable both full wallets and watch-only wallets with the same interface

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: When adding new features, define traits for abstractions, implement concrete types following existing patterns, add comprehensive unit tests, add integration tests for network interaction, and update error types in error.rs

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/derivation_tests.rs
📚 Learning: 2025-08-21T05:01:58.949Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 108
File: key-wallet-ffi/src/wallet_manager.rs:270-318
Timestamp: 2025-08-21T05:01:58.949Z
Learning: In the key-wallet-ffi design, wallets retrieved from the wallet manager via lookup functions should return const pointers (*const FFIWallet) to enforce read-only access and prevent unintended modifications. The wallet manager should control wallet lifecycle and mutations through specific APIs rather than allowing external mutation of retrieved wallet references.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-06-15T16:42:18.187Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 74
File: key-wallet-ffi/src/lib_tests.rs:41-48
Timestamp: 2025-06-15T16:42:18.187Z
Learning: In key-wallet-ffi, the HDWallet::derive_xpriv method returns Result<String, KeyWalletError>, not an ExtPrivKey wrapper. When unwrapped, it yields a String that can have .is_empty() called on it.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-06-15T15:31:44.136Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 74
File: key-wallet/src/address.rs:30-40
Timestamp: 2025-06-15T15:31:44.136Z
Learning: In the key-wallet crate, QuantumExplorer prefers keeping wildcard arms that default unknown Network variants to testnet prefixes rather than using exhaustive matches or panics. This fallback behavior is intentional.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Use deterministic testing with known test vectors and fixed seeds for reproducible results

Applied to files:

  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-02-27T05:39:16.767Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 56
File: dash/src/sml/masternode_list_engine/message_request_verification.rs:91-91
Timestamp: 2025-02-27T05:39:16.767Z
Learning: In the Dash Rust codebase, unwrap() on try_into() for byte slices from hash types like QuorumSigningRequestId is safe because hash types guarantee fixed-size byte arrays (32 bytes), ensuring the slice operations and conversions will never fail.

Applied to files:

  • dash-spv-ffi/tests/unit/test_memory_management.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Verify FFI callback functions may be invoked from any thread and must be thread-safe

Applied to files:

  • dash-spv-ffi/tests/unit/test_memory_management.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Use proper error types (thiserror) and propagate errors appropriately

Applied to files:

  • key-wallet-ffi/tests/integration_test.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations

Applied to files:

  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/tests/**/*.rs : Test both mainnet and testnet configurations

Applied to files:

  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/tests/**/*.rs : Create integration tests for network operations

Applied to files:

  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/src/client/**/*.rs : Use the DashSpvClient high-level API with proper configuration via ClientConfig for client initialization

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/tests/**/*.rs : Integration tests should gracefully handle unavailable Dash Core nodes at 127.0.0.1:9999 without failing the test suite

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-06-26T16:01:37.609Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:01:37.609Z
Learning: The mempool tracking infrastructure (UnconfirmedTransaction, MempoolState, configuration, and mempool_filter.rs) is fully implemented and integrated in the Dash SPV client as of this PR, including client logic, FFI APIs, and tests.

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/**/*.rs : Use async/await throughout the codebase, built on tokio runtime

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-11-27T10:30:54.015Z
Learnt from: xdustinface
Repo: dashpay/rust-dashcore PR: 214
File: dash-spv/examples/filter_sync.rs:48-51
Timestamp: 2025-11-27T10:30:54.015Z
Learning: The DashSpvClient::run method in dash-spv internally handles Ctrl-C shutdown by spawning a task that listens for tokio::signal::ctrl_c() and cancels the provided CancellationToken. Examples and callers should create a CancellationToken without explicitly cancelling it, as the cancellation is managed internally by the run method.

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/{dash-network,dash-spv,key-wallet}/**/*.rs : Use async/await for async operations in network and wallet modules

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
🧬 Code graph analysis (21)
key-wallet-ffi/src/address_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/account_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/error.rs (2)
key-wallet-ffi/src/managed_account.rs (4)
  • error (64-74)
  • success (55-61)
  • std (609-609)
  • std (667-667)
key-wallet-ffi/src/types.rs (2)
  • error (121-132)
  • success (112-118)
key-wallet-ffi/src/transaction_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
dash-spv-ffi/tests/unit/test_type_conversions.rs (1)
dash-spv-ffi/src/types.rs (3)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
key-wallet-ffi/src/address_pool.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/account_derivation_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
dash-spv-ffi/tests/unit/test_memory_management.rs (1)
dash-spv-ffi/src/types.rs (5)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
  • std (310-310)
  • std (311-311)
key-wallet-ffi/src/derivation_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/tests/integration_test.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/managed_wallet.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (2)
  • error (121-132)
  • new (82-86)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
dash-spv-ffi/tests/test_types.rs (2)
dash-spv-ffi/tests/unit/test_memory_management.rs (1)
  • array (433-433)
dash-spv-ffi/src/types.rs (3)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
key-wallet-ffi/src/managed_wallet_tests.rs (3)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager_tests.rs (5)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager.rs (5)
  • wallet_manager_get_wallet (551-592)
  • wallet_manager_get_managed_wallet_info (606-645)
  • wallet_manager_free_wallet_ids (891-898)
  • wallet_manager_free (874-880)
  • wallet_manager_free_wallet_bytes (390-398)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
key-wallet-ffi/src/managed_wallet.rs (1)
  • managed_wallet_info_free (612-619)
key-wallet-ffi/src/utxo_tests.rs (1)
key-wallet-ffi/src/managed_wallet.rs (2)
  • new (26-30)
  • managed_wallet_free (595-603)
key-wallet-ffi/tests/test_managed_account_collection.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/tests/test_import_wallet.rs (4)
dash-spv/src/client/core.rs (1)
  • wallet (158-160)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free_const (449-457)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/keys_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/mnemonic_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager_serialization_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager.rs (3)
  • wallet_manager_create (105-126)
  • wallet_manager_import_wallet_from_bytes (415-486)
  • wallet_manager_free (874-880)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: SPV Components Tests
  • GitHub Check: Core Components Tests
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Pre-commit (ubuntu-latest)
🔇 Additional comments (35)
dash-spv-ffi/tests/unit/test_client_lifecycle.rs (2)

145-149: LGTM! Proper FFI resource cleanup.

The changes correctly fix the memory leak by capturing the FFI resources returned by dash_spv_ffi_client_get_sync_progress and dash_spv_ffi_client_get_stats, then explicitly destroying them. This ensures proper cleanup as expected by the sanitizer.

Based on learnings and PR objectives for FFI memory leak prevention.


35-38: No cleanup needed for dash_spv_ffi_get_last_error() — error strings are managed internally.

The error pointer returned by dash_spv_ffi_get_last_error() is backed by thread-local storage and should not be freed by the caller. The codebase explicitly documents this (see test_platform_integration_safety.rs:341-342). Errors are cleared using dash_spv_ffi_clear_error(), not individual free calls. All existing tests follow this pattern consistently.

Likely an incorrect or invalid review comment.

dash-spv-ffi/tests/unit/test_type_conversions.rs (2)

61-96: LGTM! Memory leak fix correctly applied.

The change from boxing FFIArray instances to using mutable stack-allocated bindings properly prevents the memory leak. Since dash_spv_ffi_array_destroy only deallocates the internal buffer (not the struct itself), the previous boxing pattern would leak the Box allocation. The new pattern correctly frees the buffer via the destroy call, then automatically cleans up the stack-allocated struct.


99-119: LGTM! Consistent memory management across alignment tests.

The memory leak fix is correctly applied to arrays of different types and alignments.

dash-spv-ffi/tests/test_types.rs (1)

43-74: LGTM! Integration tests properly updated.

Both test_ffi_array_new_and_destroy and test_ffi_array_empty correctly adopt the new memory management pattern, consistent with the unit test changes.

dash-spv-ffi/tests/unit/test_memory_management.rs (1)

44-440: LGTM! Comprehensive memory leak fixes across all test scenarios.

The FFIArray destruction pattern has been correctly updated throughout the memory management test suite:

  • Basic lifecycle tests properly use mutable stack bindings
  • Concurrent operations safely destroy per-thread arrays
  • Stress tests with large allocations apply the fix consistently
  • Edge cases (null arrays, empty arrays, double-free scenarios) are handled correctly
  • The for mut a in arrays pattern at lines 410-412 correctly takes mutable ownership for destruction

All changes align with the fix pattern and prevent the memory leaks that were detected by the sanitizer.

key-wallet-ffi/src/address_pool.rs (1)

1042-1140: FFI error message cleanup in address pool tests looks correct

The added error.free_message() calls at the end of test_address_pool_get_address_at_index and test_address_pool_get_addresses_in_range run after all FFI resources (pools, accounts, wallet IDs, manager) are freed, and each FFIError instance is cleaned exactly once. This neatly eliminates the remaining error-message leaks in these tests without introducing double-frees.

Also applies to: 1142-1270

key-wallet-ffi/src/account_derivation_tests.rs (1)

18-64: Added error.free_message() calls correctly clean FFIError messages

Across the derivation-account tests, the new error.free_message() invocations are executed once per FFIError at the end of each test, after all FFI calls and other resource frees. This matches the intended semantics of the new error-message lifetime management and removes the sanitizer-detected message leaks without altering test behavior.

Also applies to: 66-223

key-wallet-ffi/src/derivation_tests.rs (1)

15-979: Consistent FFIError message cleanup across derivation tests

All newly added error.free_message() calls in this file are invoked once per FFIError at the end of each test, after any xpriv/xpub/string buffers are freed. This systematically addresses the FFIError message leaks detected by the sanitizer and keeps the error object usable throughout each test. No double-frees or ordering issues are apparent.

key-wallet-ffi/src/keys_tests.rs (1)

13-215: Key-derivation tests now clean up FFIError messages correctly

The added error.free_message() calls (and (*error).free_message() where error is a raw pointer) run after all key, path, and wallet resources are freed in each test. This is in line with the FFI memory-management guidelines for *-ffi code and resolves the remaining FFIError message leaks without impacting test assertions.

Also applies to: 217-327, 345-383, 387-607

key-wallet-ffi/src/wallet_tests.rs (1)

15-383: Wallet FFI tests: error message frees are correctly wired

Each test that passes an FFIError pointer into wallet FFI functions now calls (*error).free_message() exactly once in teardown, after freeing any wallets or other FFI resources. This pattern is consistent and removes the FFIError message leaks in line with the FFI memory-management guidance.

Also applies to: 385-423

key-wallet-ffi/src/managed_wallet_tests.rs (1)

15-457: Managed wallet tests now fully clean up error messages

The added error.free_message() calls in the managed wallet tests are placed after managed_wallet_free and wallet_free where those apply, and run once per local FFIError. This tightens FFI memory hygiene for these tests without altering behavior, and is consistent with the broader PR aim of eliminating sanitizer-reported leaks.

key-wallet-ffi/src/wallet_manager_serialization_tests.rs (1)

15-214: Serialization tests: manager split and error cleanup look sound

  • The switch to manager1/manager2 (and additional managers in the more complex tests) cleanly separates creation and import scenarios and avoids reusing a single manager across logically distinct flows.
  • All serialized buffers obtained via wallet_manager_add_wallet_from_mnemonic_return_serialized_bytes are either copied into a Vec (for cross-manager tests) and then freed with wallet_manager_free_wallet_bytes, or freed directly.
  • The new (*error).free_message() calls in each test run after all manager and buffer frees, giving each FFIError a single, well-defined teardown point.

This aligns well with the FFI memory-management requirements and should satisfy the sanitizer for these paths.

Also applies to: 215-324, 326-430

key-wallet-ffi/src/wallet_manager_tests.rs (1)

17-207: Wallet-manager tests: comprehensive FFIError and resource cleanup

The wallet-manager test suite now:

  • Frees error messages via (*error).free_message() once per test after all manager/wallet/wallet-id operations.
  • Explicitly frees wallets returned from wallet_manager_get_wallet and managed wallet infos from wallet_manager_get_managed_wallet_info, while leaving null/NotFound results untouched.
  • Ensures all wallet_ids and serialized wallet-byte buffers are freed with the appropriate wallet_manager_free_* functions, and that every created manager is released exactly once.

These changes significantly tighten FFI resource management in the tests and are consistent with the “be careful with FFI memory management” guidance for *-ffi modules.

Also applies to: 210-271, 273-304, 306-357, 359-417, 421-460, 470-497, 499-617, 619-777, 779-885, 888-1084, 1086-1184

key-wallet-ffi/src/managed_wallet.rs (2)

660-661: LGTM! Proper error message cleanup added.

The addition of error.free_message() calls ensures FFI error messages are freed in test cleanup paths, preventing memory leaks detected by the sanitizer.

Also applies to: 680-681, 708-709, 736-737, 808-808, 990-990, 1086-1087, 1129-1129


759-762: LGTM! Heap allocation matches C FFI usage patterns.

The change from passing a mutable reference to allocating FFIManagedWalletInfo on the heap via Box::into_raw(Box::new(...)) correctly simulates how C code would use this FFI, where the caller allocates the structure and passes ownership to the FFI layer.

Also applies to: 882-883

key-wallet-ffi/tests/test_import_wallet.rs (1)

70-71: LGTM! Proper cleanup of wallet and error resources.

The addition of error.free_message() and wallet_free_const(wallet_ptr) ensures proper cleanup of FFI resources, preventing test-side memory leaks.

key-wallet-ffi/src/address_tests.rs (1)

33-33: LGTM! Systematic error message cleanup.

The consistent addition of error.free_message() calls after error assertions ensures all allocated error messages are properly freed, preventing test-side memory leaks.

Also applies to: 49-49, 63-63, 78-78, 90-90, 111-111, 126-126, 139-139, 197-197, 222-222

key-wallet-ffi/tests/test_managed_account_collection.rs (1)

406-406: LGTM! Error message cleanup added.

Proper cleanup of the error message after validating the InvalidInput error code.

key-wallet-ffi/tests/integration_test.rs (1)

215-215: LGTM! Error message cleanup at end of test.

The addition of error.free_message() ensures the error message buffer is freed after all error validations in the test complete.

key-wallet-ffi/tests/test_error_conversions.rs (3)

5-9: LGTM! Helper function improves test maintainability.

The assert_ffi_error_code helper consolidates error code assertions and cleanup, reducing duplication and ensuring consistent memory management across error conversion tests.


17-17: LGTM! Consistent use of helper function.

All KeyWalletError conversions now properly use the helper to verify error codes and free messages.

Also applies to: 21-21, 25-25, 29-29, 33-33, 37-37, 41-41, 45-45, 49-49, 53-53


63-63: LGTM! Consistent use of helper function.

All WalletError conversions now properly use the helper to verify error codes and free messages.

Also applies to: 67-67, 71-71, 75-75, 79-79, 83-83, 87-87, 91-91, 95-95, 99-99, 103-103

key-wallet-ffi/src/mnemonic_tests.rs (1)

42-42: LGTM! Comprehensive error message cleanup.

Systematic addition of error.free_message() calls across all mnemonic tests ensures proper cleanup of FFI error messages, preventing test-side memory leaks.

Also applies to: 84-84, 129-129, 153-153, 170-170, 209-209, 246-246, 287-287, 311-311, 362-362, 387-387, 400-400, 419-419, 468-468, 491-491, 528-528, 547-547, 564-564, 592-592, 631-631, 677-677, 723-723

key-wallet-ffi/src/transaction_tests.rs (1)

43-43: LGTM! Proper error message cleanup in transaction tests.

The addition of error.free_message() calls ensures FFI error messages are freed after assertions, maintaining proper resource cleanup order.

Also applies to: 86-86, 112-112, 152-152, 210-210, 253-253

key-wallet-ffi/src/account_tests.rs (3)

80-81: LGTM! Proper error message cleanup.

The explicit free_message() call prevents memory leaks when an error message is set by the FFI function. This aligns with the PR's objective to fix sanitizer-detected leaks.


107-111: LGTM! Consistent cleanup pattern.

The cleanup properly frees both the wallet and the error message. The order of operations is correct.


193-196: LGTM! Complete resource cleanup.

The cleanup section properly frees all FFI resources including the wallet and error message.

key-wallet-ffi/src/error.rs (4)

51-65: LGTM! Prevents memory leaks on repeated error sets.

The added cleanup logic correctly frees any previous error message before setting a new one. The pattern using CString::from_raw is safe and appropriate.


67-81: LGTM! Consistent cleanup before success state.

The cleanup of previous error messages before setting success state is correct and consistent with the set_error implementation.


83-94: LGTM! Safe idempotent cleanup method.

The implementation correctly frees the message and nulls the pointer, making it safe to call multiple times. The safety documentation is clear and appropriate.


111-128: LGTM! Macro now prevents leaks consistently.

The macro correctly mirrors the cleanup pattern in set_error, ensuring that previous error messages are freed before setting new ones.

key-wallet-ffi/src/utxo_tests.rs (3)

103-104: LGTM! Appropriate cleanup for null input test.

The error message cleanup is correct for this test case where no wallet is allocated.


118-131: LGTM! Correct FFI allocation pattern.

The change from stack allocation to heap allocation via Box::into_raw properly mirrors real C FFI usage. The cleanup with managed_wallet_free is correct and prevents the leak.


583-603: LGTM! Complete cleanup for multi-call test.

The test correctly allocates the managed wallet on the heap and properly cleans up both the wallet and error messages after multiple function calls. The cleanup pattern is correct.


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
key-wallet-ffi/src/account_derivation_tests.rs (1)

225-227: c_str returns a dangling pointer (UB across all FFI calls using it)

c_str currently does:

fn c_str(s: &str) -> *const c_char {
    std::ffi::CString::new(s).unwrap().as_ptr()
}

The CString is dropped at the end of c_str, so the returned pointer immediately dangles and every FFI call using it operates on freed memory. This is undefined behavior and breaks the “be careful with FFI memory management” guideline for *-ffi code.

Consider changing to something that keeps the CString alive for at least as long as the FFI call, e.g. by returning an owning wrapper from the tests:

Suggested fix using an owning helper
-// Helper to make C string pointers
-fn c_str(s: &str) -> *const c_char {
-    std::ffi::CString::new(s).unwrap().as_ptr()
-}
+// Helper type to keep CString alive for the duration of the FFI call
+struct TestCString {
+    inner: CString,
+}
+
+impl TestCString {
+    fn new(s: &str) -> Self {
+        Self { inner: CString::new(s).unwrap() }
+    }
+    fn as_ptr(&self) -> *const c_char {
+        self.inner.as_ptr()
+    }
+}

Then in tests:

let mnemonic = TestCString::new(MNEMONIC);
let wallet = unsafe {
    wallet::wallet_create_from_mnemonic(
        mnemonic.as_ptr(),
        passphrase.as_ptr(),
        FFINetwork::Testnet,
        &mut error,
    )
};
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3884314 and e0053f1.

📒 Files selected for processing (23)
  • dash-spv-ffi/tests/test_types.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{rs,toml}

📄 CodeRabbit inference engine (CLAUDE.md)

Never hardcode network parameters, addresses, or keys

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Use proper error types (thiserror) and propagate errors appropriately
Use tokio runtime for async operations
Use conditional compilation with feature flags for optional features
Write unit tests for new functionality
Use secure random number generation for keys
Never log or expose private keys
Code must target Rust 1.89 minimum supported version (MSRV)
Format code using cargo fmt
Pass clippy linting without warnings

**/*.rs: MSRV (Minimum Supported Rust Version) is 1.89; ensure compatibility with this version for all builds
Unit tests should live alongside code with #[cfg(test)] annotation; integration tests use the tests/ directory
Use snake_case for function and variable names
Use UpperCamelCase for types and traits
Use SCREAMING_SNAKE_CASE for constants
Format code with rustfmt before commits; ensure cargo fmt --all is run
Run cargo clippy --workspace --all-targets -- -D warnings for linting; avoid warnings in CI
Prefer async/await via tokio for asynchronous operations

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/*-ffi/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*-ffi/**/*.rs: Exercise careful handling at FFI boundaries for memory safety
Be careful with FFI memory management

Files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
dash-spv-ffi/tests/unit/**/*.rs

📄 CodeRabbit inference engine (dash-spv-ffi/CLAUDE.md)

Add corresponding unit tests in tests/unit/ for each new FFI function

Files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
**/tests/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/tests/**/*.rs: Create integration tests for network operations
Test both mainnet and testnet configurations
Use proptest for property-based testing where appropriate

**/tests/**/*.rs: Use descriptive test names (e.g., test_parse_address_mainnet)
Mark network-dependent or long-running tests with #[ignore] and run with -- --ignored

Files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
🧠 Learnings (46)
📓 Common learnings
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : All FFI types must have corresponding `_destroy()` functions for explicit memory management
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use thread-local storage for error propagation via `dash_spv_ffi_get_last_error()` function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Be careful with FFI memory management
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/c_tests/**/*.{c,h} : Add corresponding C tests in `tests/c_tests/` for each new FFI function
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Exercise careful handling at FFI boundaries for memory safety
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Be careful with FFI memory management

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*-ffi/**/*.rs : Exercise careful handling at FFI boundaries for memory safety

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/tests/unit/**/*.rs : Add corresponding unit tests in `tests/unit/` for each new FFI function

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : All FFI types must have corresponding `_destroy()` functions for explicit memory management

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use the `?` operator for error propagation, provide context in error messages, never panic in library code, and return `Result<T>` for all fallible operations

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to **/tests/**/*.rs : Use descriptive test names (e.g., `test_parse_address_mainnet`)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Input strings in FFI functions are `*const c_char` (borrowed, not freed by C caller)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Rust strings must be returned as `*const c_char` with caller responsibility to free using `dash_string_free`

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/src/address_pool.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: Applies to src/**/*.rs : Avoid `unwrap()` and `expect()` in library code; use proper error types (e.g., `thiserror`)

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-06-26T15:48:36.342Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:48:36.342Z
Learning: In Rust FFI code, unwrap() must not be used on CString::new, especially for error messages or untrusted input, as it can panic if the string contains null bytes. Instead, use unwrap_or_else with a fallback to a known-safe, hardcoded string to prevent panics across FFI boundaries.

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • dash-spv-ffi/tests/test_types.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Always validate network consistency when deriving or validating addresses; never mix mainnet and testnet operations

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-06-26T15:49:53.811Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:49:53.811Z
Learning: In Rust FFI code, using thread-local storage for error reporting is unsafe in multi-threaded contexts, as callbacks may execute on different threads than the caller, leading to lost or invisible errors. FFI error handling should use global, thread-safe storage or return errors directly via return values or out parameters.

Applied to files:

  • key-wallet-ffi/src/address_tests.rs
  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/error.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Separate immutable structures (`Account`, `Wallet`) containing only identity information from mutable wrappers (`ManagedAccount`, `ManagedWalletInfo`) with state management

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/account/**/*.rs : Use enum-based type system for `AccountType` with specific variants (Standard, IdentityAuthentication, IdentityEncryption, MasternodeOperator, etc.) to provide compile-time safety and clear semantics

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use `BTreeMap` for ordered data (accounts, transactions) and `HashMap` for lookups (address mappings); apply memory management strategies for old transaction data

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/managed_account/**/*.rs : Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Organize unit tests by functionality: separate test files for BIP32, mnemonics, addresses, derivation paths, and PSBT operations

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Use property-based testing for complex invariants such as gap limit constraints

Applied to files:

  • key-wallet-ffi/src/account_tests.rs
  • key-wallet-ffi/src/transaction_tests.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Applied to files:

  • key-wallet-ffi/src/transaction_tests.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Add cbindgen annotations for complex types in FFI functions

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use `#[no_mangle] extern "C"` attribute when implementing new FFI functions in Rust

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/tests/**/*.rs : Organize tests into unit tests (in-module), integration tests (tests/ directory), real network tests (with live Dash Core nodes), and performance benchmarks

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Applies to dash-spv-ffi/src/**/*.rs : Use thread-local storage for error propagation via `dash_spv_ffi_get_last_error()` function

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • key-wallet-ffi/tests/integration_test.rs
  • dash-spv-ffi/tests/test_types.rs
  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:51.097Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-22T17:59:51.097Z
Learning: FFI bindings are organized in `*-ffi` crates; shared helpers in `internals/` and `test-utils/`

Applied to files:

  • dash-spv-ffi/tests/unit/test_type_conversions.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • dash-spv-ffi/tests/unit/test_memory_management.rs
  • dash-spv-ffi/tests/test_types.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Generate addresses in batches using gap limit and staged generation instead of unbounded address generation to prevent memory and performance issues

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Pre-generate addresses in batches (typically 20-100) and store them in pools; only derive on-demand when the pool is exhausted

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Use staged gap limit management with `GapLimitStage` tracking `last_used_index` and `used_indices` to enable efficient address discovery without loading entire chains into memory

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/src/managed_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/address_pool/**/*.rs : Support multiple `KeySource` variants (Private, Public, NoKeySource) to enable both full wallets and watch-only wallets with the same interface

Applied to files:

  • key-wallet-ffi/src/address_pool.rs
  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: When adding new features, define traits for abstractions, implement concrete types following existing patterns, add comprehensive unit tests, add integration tests for network interaction, and update error types in error.rs

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/derivation_tests.rs
📚 Learning: 2025-08-21T05:01:58.949Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 108
File: key-wallet-ffi/src/wallet_manager.rs:270-318
Timestamp: 2025-08-21T05:01:58.949Z
Learning: In the key-wallet-ffi design, wallets retrieved from the wallet manager via lookup functions should return const pointers (*const FFIWallet) to enforce read-only access and prevent unintended modifications. The wallet manager should control wallet lifecycle and mutations through specific APIs rather than allowing external mutation of retrieved wallet references.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/integration_test.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/wallet_manager_serialization_tests.rs
📚 Learning: 2025-06-15T16:42:18.187Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 74
File: key-wallet-ffi/src/lib_tests.rs:41-48
Timestamp: 2025-06-15T16:42:18.187Z
Learning: In key-wallet-ffi, the HDWallet::derive_xpriv method returns Result<String, KeyWalletError>, not an ExtPrivKey wrapper. When unwrapped, it yields a String that can have .is_empty() called on it.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-06-15T15:31:44.136Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 74
File: key-wallet/src/address.rs:30-40
Timestamp: 2025-06-15T15:31:44.136Z
Learning: In the key-wallet crate, QuantumExplorer prefers keeping wildcard arms that default unknown Network variants to testnet prefixes rather than using exhaustive matches or panics. This fallback behavior is intentional.

Applied to files:

  • key-wallet-ffi/tests/test_error_conversions.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/tests/**/*.rs : Use deterministic testing with known test vectors and fixed seeds for reproducible results

Applied to files:

  • key-wallet-ffi/src/account_derivation_tests.rs
  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
  • key-wallet-ffi/src/mnemonic_tests.rs
📚 Learning: 2025-02-27T05:39:16.767Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 56
File: dash/src/sml/masternode_list_engine/message_request_verification.rs:91-91
Timestamp: 2025-02-27T05:39:16.767Z
Learning: In the Dash Rust codebase, unwrap() on try_into() for byte slices from hash types like QuorumSigningRequestId is safe because hash types guarantee fixed-size byte arrays (32 bytes), ensuring the slice operations and conversions will never fail.

Applied to files:

  • dash-spv-ffi/tests/unit/test_memory_management.rs
📚 Learning: 2025-12-01T07:59:58.608Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv-ffi/CLAUDE.md:0-0
Timestamp: 2025-12-01T07:59:58.608Z
Learning: Verify FFI callback functions may be invoked from any thread and must be thread-safe

Applied to files:

  • dash-spv-ffi/tests/unit/test_memory_management.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/*.rs : Use proper error types (thiserror) and propagate errors appropriately

Applied to files:

  • key-wallet-ffi/tests/integration_test.rs
📚 Learning: 2025-12-19T00:07:22.904Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations

Applied to files:

  • key-wallet-ffi/src/wallet_tests.rs
  • key-wallet-ffi/src/managed_wallet.rs
  • key-wallet-ffi/src/managed_wallet_tests.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet-ffi/src/utxo_tests.rs
  • key-wallet-ffi/tests/test_managed_account_collection.rs
  • key-wallet-ffi/tests/test_import_wallet.rs
  • key-wallet-ffi/src/keys_tests.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/tests/**/*.rs : Test both mainnet and testnet configurations

Applied to files:

  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/tests/**/*.rs : Create integration tests for network operations

Applied to files:

  • key-wallet-ffi/tests/test_import_wallet.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/src/client/**/*.rs : Use the DashSpvClient high-level API with proper configuration via ClientConfig for client initialization

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/tests/**/*.rs : Integration tests should gracefully handle unavailable Dash Core nodes at 127.0.0.1:9999 without failing the test suite

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-06-26T16:01:37.609Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:01:37.609Z
Learning: The mempool tracking infrastructure (UnconfirmedTransaction, MempoolState, configuration, and mempool_filter.rs) is fully implemented and integrated in the Dash SPV client as of this PR, including client logic, FFI APIs, and tests.

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-16T09:03:55.811Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2025-12-16T09:03:55.811Z
Learning: Applies to dash-spv/**/*.rs : Use async/await throughout the codebase, built on tokio runtime

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-11-27T10:30:54.015Z
Learnt from: xdustinface
Repo: dashpay/rust-dashcore PR: 214
File: dash-spv/examples/filter_sync.rs:48-51
Timestamp: 2025-11-27T10:30:54.015Z
Learning: The DashSpvClient::run method in dash-spv internally handles Ctrl-C shutdown by spawning a task that listens for tokio::signal::ctrl_c() and cancels the provided CancellationToken. Examples and callers should create a CancellationToken without explicitly cancelling it, as the cancellation is managed internally by the run method.

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
📚 Learning: 2025-12-22T17:59:37.849Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-22T17:59:37.849Z
Learning: Applies to **/{dash-network,dash-spv,key-wallet}/**/*.rs : Use async/await for async operations in network and wallet modules

Applied to files:

  • dash-spv-ffi/tests/unit/test_client_lifecycle.rs
🧬 Code graph analysis (21)
key-wallet-ffi/src/address_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/account_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/error.rs (2)
key-wallet-ffi/src/managed_account.rs (4)
  • error (64-74)
  • success (55-61)
  • std (609-609)
  • std (667-667)
key-wallet-ffi/src/types.rs (2)
  • error (121-132)
  • success (112-118)
key-wallet-ffi/src/transaction_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
dash-spv-ffi/tests/unit/test_type_conversions.rs (1)
dash-spv-ffi/src/types.rs (3)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
key-wallet-ffi/src/address_pool.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/account_derivation_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
dash-spv-ffi/tests/unit/test_memory_management.rs (1)
dash-spv-ffi/src/types.rs (5)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
  • std (310-310)
  • std (311-311)
key-wallet-ffi/src/derivation_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/tests/integration_test.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/managed_wallet.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (2)
  • error (121-132)
  • new (82-86)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
dash-spv-ffi/tests/test_types.rs (2)
dash-spv-ffi/tests/unit/test_memory_management.rs (1)
  • array (433-433)
dash-spv-ffi/src/types.rs (3)
  • new (24-32)
  • new (299-313)
  • dash_spv_ffi_array_destroy (342-357)
key-wallet-ffi/src/managed_wallet_tests.rs (3)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager_tests.rs (5)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager.rs (5)
  • wallet_manager_get_wallet (551-592)
  • wallet_manager_get_managed_wallet_info (606-645)
  • wallet_manager_free_wallet_ids (891-898)
  • wallet_manager_free (874-880)
  • wallet_manager_free_wallet_bytes (390-398)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free (428-434)
key-wallet-ffi/src/managed_wallet.rs (1)
  • managed_wallet_info_free (612-619)
key-wallet-ffi/src/utxo_tests.rs (1)
key-wallet-ffi/src/managed_wallet.rs (2)
  • new (26-30)
  • managed_wallet_free (595-603)
key-wallet-ffi/tests/test_managed_account_collection.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/tests/test_import_wallet.rs (4)
dash-spv/src/client/core.rs (1)
  • wallet (158-160)
key-wallet-ffi/src/wallet.rs (1)
  • wallet_free_const (449-457)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/keys_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/mnemonic_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/managed_account.rs (1)
  • error (64-74)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager_serialization_tests.rs (3)
key-wallet-ffi/src/error.rs (1)
  • error (44-49)
key-wallet-ffi/src/types.rs (1)
  • error (121-132)
key-wallet-ffi/src/wallet_manager.rs (3)
  • wallet_manager_create (105-126)
  • wallet_manager_import_wallet_from_bytes (415-486)
  • wallet_manager_free (874-880)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: RPC Tests (stable, true)
  • GitHub Check: SPV Components Tests
  • GitHub Check: Core Components Tests
  • GitHub Check: fuzz (dash_deserialize_script)
  • GitHub Check: fuzz (dash_deserialize_witness)
  • GitHub Check: fuzz (hashes_sha512_256)
  • GitHub Check: fuzz (hashes_sha1)
  • GitHub Check: fuzz (hashes_cbor)
  • GitHub Check: fuzz (dash_outpoint_string)
  • GitHub Check: fuzz (dash_deserialize_amount)
  • GitHub Check: fuzz (dash_deserialize_block)
  • GitHub Check: fuzz (hashes_json)
  • GitHub Check: fuzz (dash_deserialize_address)
  • GitHub Check: fuzz (hashes_ripemd160)
  • GitHub Check: fuzz (hashes_sha512)
  • GitHub Check: fuzz (hashes_sha256)
  • GitHub Check: fuzz (dash_script_bytes_to_asm_fmt)
  • GitHub Check: fuzz (dash_deser_net_msg)
  • GitHub Check: Pre-commit (macos-latest)
  • GitHub Check: Pre-commit (ubuntu-latest)

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.

2 participants