Skip to content

chore: error cleanup#364

Open
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/error-cleanup
Open

chore: error cleanup#364
ZocoLini wants to merge 1 commit intov0.42-devfrom
chore/error-cleanup

Conversation

@ZocoLini
Copy link
Copy Markdown
Collaborator

@ZocoLini ZocoLini commented Jan 16, 2026

  • Removed unused error variants
  • Added clippy checks to avoid using std RwLock and std Mutex. I did this because there was an unused error variant dedicated for lock poisoning that was never used because we don't currently use std RwLock or Mutex, and I want to keep it like that, only Tokyo variants are allowed.

Extra: Some tests for the errors are really weird, I want to drop a bunch of them xd

Summary by CodeRabbit

  • Refactoring
    • Simplified error handling by removing deprecated error types and consolidating error definitions
    • Updated error code assignments for improved consistency
    • Strengthened code quality through enforced best practices for concurrent operations

@ZocoLini ZocoLini marked this pull request as draft January 16, 2026 02:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The changes simplify error handling across dash-spv and dash-spv-ffi crates by removing unused error variants and types, consolidating the error hierarchy, and renumbering FFIErrorCode values. A new Clippy configuration disallows std::sync types in the test_utils module.

Changes

Cohort / File(s) Summary
FFIErrorCode Refactor
dash-spv-ffi/src/error.rs, dash-spv-ffi/tests/unit/test_error_handling.rs, dash-spv-ffi/tests/test_error.rs
Renumbered FFIErrorCode variants (ConfigError: 8→7, RuntimeError: 9→8); removed WalletError, NotImplemented, Unknown variants; simplified SpvError→FFIErrorCode conversion mappings; updated test assertions and removed numeric validation tests.
SpvError Simplification
dash-spv/src/error.rs
Removed 6 SpvError variants (Validation, Io, General, Parse, Logging, Wallet); trimmed NetworkError, StorageError, ValidationError, and SyncError variants; eliminated ParseError and WalletError types; removed StorageError Clone impl and SyncError::category() method.
Integration Updates
dash-spv/src/main.rs
Updated error code mapping to new FFIErrorCode values; removed Parse variant handling (now falls through to default exit code 255); Config now maps to exit code 3 (previously 4).
Lint Configuration
dash-spv/clippy.toml
Added disallowed-types configuration flagging std::sync::\{Mutex, RwLock\} with directives to use tokio::sync equivalents.
Test Coverage Cleanup
dash-spv/tests/error_types_test.rs
Removed tests for deleted error variants; trimmed NetworkError, StorageError, ValidationError, SyncError test vectors; removed WalletError and ParseError coverage; removed error-category assertions; deleted wallet operation helper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Hops through errors with glee,
Pruning variants from the tree,
Clippy warns of mutex sin,
Tokio sync locks tucked within,
Code flows cleaner, refactored bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title 'chore: error cleanup' directly aligns with the main objective of the PR: removing unused error variants and simplifying error handling across multiple error types.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/error-cleanup

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
Copy Markdown
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: 1

Caution

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

⚠️ Outside diff range comments (3)
dash-spv/src/client/sync_coordinator.rs (1)

413-430: Handle failures from update_chainlock_validation.

Errors are silently ignored right now, which can leave ChainLock validation disabled without any signal. Consider logging or surfacing the failure.

💡 Suggested handling
-                if let Ok(has_engine) = self.update_chainlock_validation().await {
-                    if has_engine {
+                match self.update_chainlock_validation().await {
+                    Ok(has_engine) => {
+                        if has_engine {
                         masternode_engine_updated = true;
                         tracing::info!(
                             "✅ Masternode sync complete - ChainLock validation enabled"
                         );
 
                         // Validate any pending ChainLocks
                         if let Err(e) = self.validate_pending_chainlocks().await {
                             tracing::error!(
                                 "Failed to validate pending ChainLocks after masternode sync: {}",
                                 e
                             );
                         }
-                    }
-                }
+                        }
+                    }
+                    Err(e) => {
+                        tracing::warn!("Failed to update ChainLock validation state: {}", e);
+                    }
+                }
dash-spv/src/chain/chainlock_manager.rs (2)

179-217: Drop the masternode-engine lock before awaiting queueing.

queue_pending_chainlock().await (lines 200 and 213) runs while the masternode_engine read guard is held. The comment "engine_guard dropped before any await" is incorrect—the guard persists across both await calls until line 217. Clone the Option<Arc<_>> first in a scoped block, then await without holding the lock.

🔧 Example refactor
-            let engine_guard = self.masternode_engine.read().await;
-
-            if let Some(engine) = engine_guard.as_ref() {
+            let engine = { self.masternode_engine.read().await.clone() };
+            if let Some(engine) = engine.as_ref() {
                 // Use the masternode engine's verify_chain_lock method
                 match engine.verify_chain_lock(&chain_lock) {
                     Ok(()) => {
@@
                         if error_string.contains("No masternode lists in engine") {
@@
-                            self.queue_pending_chainlock(chain_lock.clone()).await;
+                            self.queue_pending_chainlock(chain_lock.clone()).await;
                         } else {
                             return Err(ValidationError::InvalidChainLock(format!(
                                 "MasternodeListEngine validation failed: {:?}",
                                 e
                             )));
                         }
                     }
                 }
             } else {
                 // Queue for later validation when engine becomes available
                 warn!(
                     "⚠️ Masternode engine not available, queueing ChainLock for later validation"
                 );
-                self.queue_pending_chainlock(chain_lock.clone()).await;
+                self.queue_pending_chainlock(chain_lock.clone()).await;
             }
-        } // engine_guard dropped before any await
+        } // guard already dropped before awaits

90-125: Don't hold the pending-chainlocks write lock across awaits.

validate_pending_chainlocks acquires a write lock and holds it while calling self.process_chain_lock(...).await in a loop. If process_chain_lock encounters missing masternode list data, it calls self.queue_pending_chainlock(...), which attempts to re-acquire the same lock from the same task. Tokio's RwLock is not reentrant, causing a deadlock.

Drain the pending queue before awaiting by using std::mem::take(&mut *pending) immediately after acquiring the lock, then drop the lock before processing.

🤖 Fix all issues with AI agents
In `@dash-spv/src/error.rs`:
- Around line 168-169: Update the doc comment for the Result type alias so it
references the current Error type name instead of the old "SpvError"; locate the
declaration of the alias named Result and change its comment to something like
"Type alias for Result with Error." ensuring the documentation matches the
actual Error type used by the alias.

Comment thread dash-spv/src/error.rs Outdated
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Jan 16, 2026
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@ZocoLini ZocoLini force-pushed the chore/error-cleanup branch from b6f854e to 1b21f7d Compare January 16, 2026 16:05
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Jan 16, 2026
@ZocoLini ZocoLini marked this pull request as ready for review January 16, 2026 16:13
Copy link
Copy Markdown
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)
dash-spv/src/chain/chainlock_manager.rs (1)

90-127: Potential deadlock when processing pending chainlocks.

The write lock on pending_chainlocks is acquired at line 95 and held throughout the iteration. However, process_chain_lock (called at line 103) can invoke queue_pending_chainlock (at lines 201, 215), which attempts to acquire a write lock on the same pending_chainlocks. With tokio::sync::RwLock, this will cause the task to block forever waiting for a lock it already holds.

Additionally, a write lock is acquired but only read operations (.iter()) are performed.

🔒 Proposed fix: Clone pending items and use read lock, or drain before processing
     pub async fn validate_pending_chainlocks<S: StorageManager>(
         &self,
         chain_state: &ChainState,
         storage: &mut S,
     ) -> ValidationResult<()> {
-        let pending = self.pending_chainlocks.write().await;
+        // Drain pending chainlocks to avoid holding lock during async processing
+        let pending: Vec<ChainLock> = {
+            let mut guard = self.pending_chainlocks.write().await;
+            std::mem::take(&mut *guard)
+        };

         info!("Validating {} pending ChainLocks", pending.len());

         let mut validated_count = 0;
         let mut failed_count = 0;

-        for chain_lock in pending.iter() {
+        for chain_lock in pending.into_iter() {
-            match self.process_chain_lock(chain_lock.clone(), chain_state, storage).await {
+            match self.process_chain_lock(chain_lock, chain_state, storage).await {
🧹 Nitpick comments (4)
dash-spv/src/sync/manager.rs (1)

10-11: LGTM!

The import path update to use crate::SyncResult is consistent with the error consolidation. Minor nitpick: lines 10-11 could be consolidated into a single import statement:

-use crate::SyncResult;
-use crate::{SpvStats, SyncError};
+use crate::{SpvStats, SyncError, SyncResult};
dash-spv/src/storage/chainstate.rs (1)

5-9: Use the re-exported StorageResult type alias for consistency.

Line 6 imports StorageResult from crate::error, but StorageResult is re-exported at the crate root in lib.rs (line 81). Other storage files (storage/mod.rs, storage/blocks.rs) import it directly as crate::StorageResult. Update the import for consistency:

 use crate::{
-    error::StorageResult,
+    StorageResult,
     storage::{io::atomic_write, PersistentStorage},
     ChainState,
 };
dash-spv-ffi/tests/unit/test_error_handling.rs (1)

111-127: Add coverage for newly introduced error variants.

Consider adding assertions for the new dash_spv::Error variants (e.g., UninitializedClient, TaskFailed, QuorumLookupError, ChannelFailure, Logging) to lock in the FFI mapping behavior.

dash-spv/src/network/manager.rs (1)

905-938: Use Error::TaskFailed for task panics to preserve error context.

The broadcast method currently converts JoinError to NetworkError::ConnectionFailed, which loses the error type and context. Since Error::TaskFailed(#[from] JoinError) is already defined, use that instead:

Suggested change
-                Err(_) => {
-                    results.push(Err(crate::Error::Network(crate::NetworkError::ConnectionFailed(
-                        "Task panicked during broadcast".to_string(),
-                    ))))
-                }
+                Err(join_err) => {
+                    results.push(Err(crate::Error::TaskFailed(join_err)))
+                }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6f854e and 1b21f7d.

📒 Files selected for processing (59)
  • dash-spv-ffi/src/broadcast.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/clippy.toml
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/src/client/config_test.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/client/status_display.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/transactions.rs
  • dash-spv/src/error.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/logging.rs
  • dash-spv/src/main.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/src/network/mock.rs
  • dash-spv/src/network/mod.rs
  • dash-spv/src/network/peer.rs
  • dash-spv/src/network/persist.rs
  • dash-spv/src/network/pool.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/storage/io.rs
  • dash-spv/src/storage/lockfile.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/storage/mod.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/src/sync/filters/headers.rs
  • dash-spv/src/sync/filters/manager.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/sync/filters/retry.rs
  • dash-spv/src/sync/headers/manager.rs
  • dash-spv/src/sync/headers/validation.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/sync/masternodes/manager.rs
  • dash-spv/src/sync/message_handlers.rs
  • dash-spv/src/sync/phase_execution.rs
  • dash-spv/src/sync/post_sync.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/tests/chainlock_simple_test.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/error_types_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
  • dash-spv/tests/storage_test.rs
💤 Files with no reviewable changes (1)
  • dash-spv/tests/error_types_test.rs
✅ Files skipped from review due to trivial changes (1)
  • dash-spv/src/network/peer.rs
🚧 Files skipped from review as they are similar to previous changes (21)
  • dash-spv/tests/chainlock_simple_test.rs
  • dash-spv/src/logging.rs
  • dash-spv/src/storage/io.rs
  • dash-spv/src/storage/lockfile.rs
  • dash-spv/src/sync/filters/headers.rs
  • dash-spv/src/sync/filters/manager.rs
  • dash-spv-ffi/src/broadcast.rs
  • dash-spv/src/sync/masternodes/manager.rs
  • dash-spv/src/sync/headers/validation.rs
  • dash-spv/src/sync/phase_execution.rs
  • dash-spv/src/main.rs
  • dash-spv/src/client/transactions.rs
  • dash-spv/src/sync/headers/manager.rs
  • dash-spv/src/sync/message_handlers.rs
  • dash-spv/src/sync/post_sync.rs
  • dash-spv/src/client/config_test.rs
  • dash-spv/src/network/pool.rs
  • dash-spv/src/client/status_display.rs
  • dash-spv/src/sync/filters/retry.rs
  • dash-spv/src/storage/mod.rs
  • dash-spv/src/network/mock.rs
🧰 Additional context used
📓 Path-based instructions (10)
**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.rs: Never hardcode network parameters, addresses, or keys
Use proper error types (thiserror) and propagate errors appropriately
Use tokio runtime for async operations
Use conditional compilation for optional features
Use proptest for property-based testing where appropriate
Always validate inputs from untrusted sources
Never log or expose private keys
Format code using cargo fmt
Ensure clippy passes with all features enabled and -D warnings flag

**/*.rs: Keep unit tests in the source code alongside implementation using #[cfg(test)] modules
Use snake_case for function and variable names
Use UpperCamelCase for types and traits
Use SCREAMING_SNAKE_CASE for constants
Format code with rustfmt following the rustfmt.toml configuration; run cargo fmt --all before commits
Avoid unwrap() and expect() in library code; use explicit error types (e.g., thiserror)
Use tokio for async/await implementations
Run clippy with warnings-as-errors for linting: cargo clippy --workspace --all-targets -- -D warnings
Maintain Minimum Supported Rust Version (MSRV) of 1.89
Follow crate-specific idioms for mixed Rust editions (2021/2024)

Files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
dash-spv/**/*.rs

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

dash-spv/**/*.rs: Use trait-based abstractions for swappable implementations (e.g., NetworkManager, StorageManager)
Use async/await throughout the codebase instead of callback-based patterns
Use domain-specific error types (NetworkError, StorageError, SyncError, ValidationError, SpvError) for error handling
Use Tokio channels for inter-component message passing in async architecture
Run cargo fmt --check to verify code formatting before committing
Run cargo clippy --all-targets --all-features -- -D warnings to catch potential bugs and style issues
Write unit tests in-module and integration tests in the tests/ directory following the test organization strategy
Use Arc<dyn TraitName> for trait objects in Rust to support runtime polymorphism

Files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
dash-spv/src/network/**/*.rs

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

dash-spv/src/network/**/*.rs: Use DNS-first peer discovery with automatic fallback to DNS seeds when no explicit peers are configured
Implement configurable timeouts with recovery mechanisms in network operations

Files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/network/persist.rs
  • dash-spv/src/network/manager.rs
dash-spv/src/sync/**/*.rs

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

dash-spv/src/sync/**/*.rs: Use sequential phase-based synchronization via SyncManager for organized sync coordination
Implement state machines using SyncState enum to drive synchronization flow

Files:

  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/sync/filters/download.rs
**/*test*.rs

📄 CodeRabbit inference engine (AGENTS.md)

Write descriptive test names (e.g., test_parse_address_mainnet)

Files:

  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
dash-spv/src/storage/**/*.rs

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

Implement StorageManager trait for storage backends and store headers in 10,000-header segments with index files

Files:

  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/storage/masternode.rs
dash-spv/src/validation/**/*.rs

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

Implement configurable validation modes (ValidationMode::None, ValidationMode::Basic, ValidationMode::Full)

Files:

  • dash-spv/src/validation/instantlock.rs
dash-spv-ffi/src/**/*.rs

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

dash-spv-ffi/src/**/*.rs: Use #[no_mangle] extern "C" attribute when implementing new FFI functions in Rust
All FFI types must have corresponding _destroy() functions for explicit memory management
Rust strings must be returned as *const c_char with caller responsibility to free using dash_string_free
Input strings in FFI functions are *const c_char (borrowed, not freed by C caller)
Add cbindgen annotations for complex types in FFI functions
Use thread-local storage for error propagation via dash_spv_ffi_get_last_error() function

Files:

  • dash-spv-ffi/src/client.rs
  • dash-spv-ffi/src/error.rs
**/*-ffi/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • dash-spv-ffi/src/client.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.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_error_handling.rs
🧠 Learnings (43)
📓 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 : 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: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Run `cargo fmt --check` to verify code formatting before committing
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Run `cargo clippy --all-targets --all-features -- -D warnings` to catch potential bugs and style issues
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use domain-specific error types (`NetworkError`, `StorageError`, `SyncError`, `ValidationError`, `SpvError`) for error handling
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/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use async/await throughout the codebase instead of callback-based patterns
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.
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Use sequential phase-based synchronization via `SyncManager` for organized sync coordination
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use trait-based abstractions for swappable implementations (e.g., `NetworkManager`, `StorageManager`)

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use domain-specific error types (`NetworkError`, `StorageError`, `SyncError`, `ValidationError`, `SpvError`) for error handling

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Run `cargo fmt --check` to verify code formatting before committing

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/clippy.toml
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/network/**/*.rs : Implement configurable timeouts with recovery mechanisms in network operations

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Run `cargo clippy --all-targets --all-features -- -D warnings` to catch potential bugs and style issues

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/clippy.toml
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/network/**/*.rs : Use DNS-first peer discovery with automatic fallback to DNS seeds when no explicit peers are configured

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use async/await throughout the codebase instead of callback-based patterns

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use Tokio channels for inter-component message passing in async architecture

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/clippy.toml
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/validation/**/*.rs : Implement configurable validation modes (`ValidationMode::None`, `ValidationMode::Basic`, `ValidationMode::Full`)

Applied to files:

  • dash-spv/src/network/mod.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/src/error.rs
  • dash-spv/src/client/queries.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/src/network/mod.rs
  • dash-spv/clippy.toml
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/sync/filters/download.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Use sequential phase-based synchronization via `SyncManager` for organized sync coordination

Applied to files:

  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/sync/**/*.rs : Implement state machines using `SyncState` enum to drive synchronization flow

Applied to files:

  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/client/progress.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/error.rs
  • dash-spv/src/sync/manager.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.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/src/sync/filters/requests.rs
  • dash-spv/src/network/discovery.rs
  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/network/handshake.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/clippy.toml
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/sync/transitions.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/error.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:24.093Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T14:54:24.093Z
Learning: Applies to **/*.rs : Avoid `unwrap()` and `expect()` in library code; use explicit error types (e.g., `thiserror`)

Applied to files:

  • dash-spv/src/sync/filters/requests.rs
  • dash-spv/clippy.toml
📚 Learning: 2025-09-03T17:45:58.984Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 134
File: dash-spv/src/network/discovery.rs:14-14
Timestamp: 2025-09-03T17:45:58.984Z
Learning: In hickory_resolver 0.25.0+, TokioAsyncResolver is deprecated in favor of TokioResolver. When migrating from trust_dns_resolver to hickory_resolver, the correct type to use is TokioResolver, not TokioAsyncResolver.

Applied to files:

  • dash-spv/src/network/discovery.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/src/client/progress.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2025-06-26T15:54:02.509Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T15:54:02.509Z
Learning: The `StorageManager` trait in `dash-spv/src/storage/mod.rs` uses `&mut self` methods but is also `Send + Sync`, and implementations often use interior mutability for concurrency. This can be confusing, so explicit documentation should clarify thread-safety expectations and the rationale for the API design.

Applied to files:

  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/clippy.toml
  • dash-spv/src/client/core.rs
  • dash-spv/src/network/persist.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/storage/masternode.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Write unit tests in-module and integration tests in the `tests/` directory following the test organization strategy

Applied to files:

  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/tests/storage_test.rs
  • dash-spv/tests/block_download_test.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.rs
📚 Learning: 2026-01-16T14:54:24.093Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-16T14:54:24.093Z
Learning: Applies to **/*.rs : Use `tokio` for async/await implementations

Applied to files:

  • dash-spv/src/chain/chainlock_test.rs
  • dash-spv/clippy.toml
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/src/storage/**/*.rs : Implement `StorageManager` trait for storage backends and store headers in 10,000-header segments with index files

Applied to files:

  • dash-spv/tests/storage_test.rs
  • dash-spv/src/storage/chainstate.rs
  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/client/core.rs
  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/network/persist.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/storage/masternode.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/src/sync/filters/download.rs
  • dash-spv/tests/filter_header_verification_test.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:

  • dash-spv/tests/storage_test.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/tests/edge_case_filter_sync_test.rs
  • dash-spv/tests/filter_header_verification_test.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:

  • dash-spv/tests/storage_test.rs
  • dash-spv/src/client/core.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/interface.rs
  • dash-spv/src/client/config.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.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/clippy.toml
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/lib.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv/src/sync/filters/download.rs
📚 Learning: 2026-01-16T14:53:56.692Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T14:53:56.692Z
Learning: Applies to **/*.rs : Ensure clippy passes with all features enabled and -D warnings flag

Applied to files:

  • dash-spv/clippy.toml
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/Cargo.toml : Maintain Minimum Rust Version (MSRV) of 1.89 and ensure all dependencies compile with `cargo check --all-features`

Applied to files:

  • dash-spv/clippy.toml
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/validation/instantlock.rs
  • dash-spv/src/storage/blocks.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/config.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/sync/filters/download.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:

  • dash-spv/clippy.toml
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
📚 Learning: 2026-01-16T14:53:56.692Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T14:53:56.692Z
Learning: Applies to **/*-ffi/**/*.rs : Exercise careful memory safety handling at FFI boundaries

Applied to files:

  • dash-spv/clippy.toml
📚 Learning: 2026-01-16T14:53:56.692Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T14:53:56.692Z
Learning: Applies to **/*.rs : Use tokio runtime for async operations

Applied to files:

  • dash-spv/clippy.toml
📚 Learning: 2026-01-16T14:53:56.692Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T14:53:56.692Z
Learning: Applies to **/*-ffi/**/*.rs : Be careful with FFI memory management

Applied to files:

  • dash-spv/clippy.toml
📚 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/src/client/sync_coordinator.rs
  • dash-spv-ffi/src/client.rs
  • dash-spv/src/error.rs
📚 Learning: 2026-01-16T14:53:56.692Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T14:53:56.692Z
Learning: Applies to **/*.rs : Use proper error types (thiserror) and propagate errors appropriately

Applied to files:

  • dash-spv/src/client/sync_coordinator.rs
  • dash-spv/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
📚 Learning: 2025-06-26T16:02:42.390Z
Learnt from: DCG-Claude
Repo: dashpay/rust-dashcore PR: 0
File: :0-0
Timestamp: 2025-06-26T16:02:42.390Z
Learning: Passing exclusive mutable references to network and storage managers into the sync manager in async Rust can lead to borrow checker issues or runtime contention if concurrent access is needed elsewhere. It's advisable to document this architectural tradeoff and consider refactoring to interior mutability or message passing for shared access as the codebase evolves.

Applied to files:

  • dash-spv/src/client/lifecycle.rs
  • dash-spv/src/client/mempool.rs
  • dash-spv/src/sync/filters/matching.rs
  • dash-spv/src/client/message_handler.rs
  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/client/chainlock.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/network/manager.rs
  • dash-spv/src/sync/filters/download.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:

  • dash-spv-ffi/src/client.rs
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
📚 Learning: 2025-02-25T06:13:52.858Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 51
File: dash/src/sml/masternode_list/scores_for_quorum.rs:50-73
Timestamp: 2025-02-25T06:13:52.858Z
Learning: ScoreHash is a cryptographic hash in the rust-dashcore library, and therefore does not need collision handling when used as a key in collections like BTreeMap due to the extremely low probability of collisions.

Applied to files:

  • dash-spv/src/storage/blocks.rs
📚 Learning: 2025-02-25T06:19:32.230Z
Learnt from: QuantumExplorer
Repo: dashpay/rust-dashcore PR: 51
File: dash/src/sml/masternode_list_entry/hash.rs:7-12
Timestamp: 2025-02-25T06:19:32.230Z
Learning: The `consensus_encode` method on `MasternodeListEntry` writing to a `Vec` buffer cannot fail, so using `.expect()` is appropriate rather than propagating the error with the `?` operator.

Applied to files:

  • dash-spv/src/chain/chainlock_manager.rs
  • dash-spv/src/error.rs
  • dash-spv/src/client/queries.rs
  • dash-spv/src/storage/masternode.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Applies to dash-spv/**/*.rs : Use `Arc<dyn TraitName>` for trait objects in Rust to support runtime polymorphism

Applied to files:

  • dash-spv/src/client/chainlock.rs
  • dash-spv-ffi/src/error.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:

  • dash-spv/src/error.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:

  • dash-spv/src/error.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:

  • dash-spv/src/error.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:

  • dash-spv/src/error.rs
  • dash-spv/src/client/queries.rs
📚 Learning: 2026-01-16T14:54:10.809Z
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: dash-spv/CLAUDE.md:0-0
Timestamp: 2026-01-16T14:54:10.809Z
Learning: Follow a layered, trait-based architecture with clear separation of concerns across modules: client, network, storage, sync, validation, wallet, types, and error

Applied to files:

  • dash-spv/src/lib.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: When debugging FFI issues, check `dash_spv_ffi_get_last_error()` for error details

Applied to files:

  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
🧬 Code graph analysis (16)
dash-spv/src/client/progress.rs (2)
dash-spv/src/client/status_display.rs (2)
  • sync_progress (100-134)
  • stats (137-140)
dash-spv/src/network/peer.rs (1)
  • stats (703-705)
dash-spv/src/chain/chainlock_test.rs (1)
dash-spv/src/chain/chainlock_manager.rs (2)
  • has_chain_lock_at_height (311-313)
  • would_violate_chain_lock (346-366)
dash-spv/src/storage/chainstate.rs (1)
dash-spv/src/main.rs (1)
  • e (21-21)
dash-spv/src/client/sync_coordinator.rs (1)
dash-spv/src/client/core.rs (1)
  • storage (161-163)
dash-spv/src/client/lifecycle.rs (1)
dash-spv/src/client/core.rs (1)
  • storage (161-163)
dash-spv/src/client/mempool.rs (2)
dash-spv-ffi/src/client.rs (1)
  • txid (273-273)
dash-spv-ffi/src/broadcast.rs (1)
  • dashcore (36-36)
dash-spv/src/network/persist.rs (2)
dash-spv/src/storage/io.rs (1)
  • atomic_write (24-57)
dash-spv/src/storage/mod.rs (2)
  • clear (70-70)
  • clear (203-244)
dash-spv/src/client/chainlock.rs (2)
dash-spv/src/sync/masternodes/manager.rs (1)
  • engine (583-585)
dash-spv/src/chain/chainlock_manager.rs (1)
  • new (54-63)
dash-spv/src/client/config.rs (1)
dash-spv-ffi/src/error.rs (1)
  • from (52-65)
dash-spv/src/error.rs (1)
dash-spv-ffi/src/error.rs (1)
  • from (52-65)
dash-spv-ffi/src/error.rs (3)
dash-spv/src/types.rs (2)
  • from (69-74)
  • from (78-83)
dash-spv-ffi/src/config.rs (1)
  • from (16-22)
dash-spv-ffi/src/types.rs (9)
  • from (57-67)
  • from (86-111)
  • from (128-179)
  • from (191-200)
  • from (220-235)
  • from (250-268)
  • from (397-402)
  • from (406-411)
  • from (425-437)
dash-spv/src/client/queries.rs (2)
dash-spv/src/network/manager.rs (1)
  • disconnect_peer (946-957)
dash-spv/src/client/transactions.rs (1)
  • network (13-16)
dash-spv-ffi/tests/unit/test_error_handling.rs (1)
dash-spv-ffi/src/error.rs (1)
  • from (52-65)
dash-spv/src/network/manager.rs (1)
dash-spv/src/network/mod.rs (6)
  • connect (36-36)
  • disconnect (39-39)
  • send_message (42-42)
  • receive_message (45-45)
  • get_peer_best_height (57-57)
  • update_peer_dsq_preference (83-83)
dash-spv/tests/edge_case_filter_sync_test.rs (5)
dash-spv/src/network/mock.rs (1)
  • get_peer_best_height (169-171)
dash-spv/src/network/mod.rs (1)
  • get_peer_best_height (57-57)
dash-spv/src/network/manager.rs (1)
  • get_peer_best_height (1265-1312)
dash-spv/tests/block_download_test.rs (1)
  • get_peer_best_height (91-93)
dash-spv/tests/filter_header_verification_test.rs (1)
  • get_peer_best_height (86-88)
dash-spv/tests/filter_header_verification_test.rs (5)
dash-spv/src/network/mock.rs (1)
  • get_peer_best_height (169-171)
dash-spv/src/network/mod.rs (1)
  • get_peer_best_height (57-57)
dash-spv/src/network/manager.rs (1)
  • get_peer_best_height (1265-1312)
dash-spv/tests/block_download_test.rs (1)
  • get_peer_best_height (91-93)
dash-spv/tests/edge_case_filter_sync_test.rs (1)
  • get_peer_best_height (90-92)
⏰ 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). (2)
  • GitHub Check: macOS / spv
  • GitHub Check: Windows / spv

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Jan 16, 2026
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@ZocoLini ZocoLini marked this pull request as draft January 17, 2026 19:34
@ZocoLini ZocoLini force-pushed the chore/error-cleanup branch from 1b21f7d to 6497a2a Compare January 19, 2026 01:00
@github-actions github-actions bot added merge-conflict The PR conflicts with the target branch. and removed merge-conflict The PR conflicts with the target branch. labels Jan 19, 2026
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@ZocoLini ZocoLini force-pushed the chore/error-cleanup branch from 6497a2a to dda15a3 Compare January 19, 2026 15:04
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Jan 19, 2026
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Jan 20, 2026
@ZocoLini ZocoLini force-pushed the chore/error-cleanup branch from dda15a3 to c3fa8c7 Compare April 17, 2026 18:24
@github-actions github-actions bot removed the merge-conflict The PR conflicts with the target branch. label Apr 17, 2026
@ZocoLini ZocoLini marked this pull request as ready for review April 17, 2026 18:29
Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (2)
dash-spv/tests/error_types_test.rs (1)

146-167: Test name still references “categories” after removal of SyncError::category().

test_sync_error_variants_and_categories no longer asserts any category behavior (that method was removed); the name is now misleading. Consider renaming to test_sync_error_variants for clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dash-spv/tests/error_types_test.rs` around lines 146 - 167, The test function
name test_sync_error_variants_and_categories is misleading because
SyncError::category() was removed; rename the test to reflect current behavior
(e.g., test_sync_error_variants) to match that it only checks string
representations; update the test function identifier
test_sync_error_variants_and_categories to test_sync_error_variants and adjust
any references (imports, mod declarations) to the new name so the test suite and
CI reflect the rename.
dash-spv-ffi/tests/unit/test_error_handling.rs (1)

82-96: Consider adding coverage for the remaining SpvError variants.

The From<SpvError> for FFIErrorCode impl has 6 arms (ChannelFailure, Network, Storage, Sync, Config, QuorumLookupError), but this test only exercises 3 of them (Network, Storage, Config). Since the PR's intent is to keep the FFI mapping in lockstep with SpvError, covering ChannelFailureRuntimeError, SyncSyncError, and QuorumLookupErrorValidationError would guard against future silent regressions when arms are added/removed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dash-spv-ffi/tests/unit/test_error_handling.rs` around lines 82 - 96, Add
tests that exercise the remaining SpvError variants so the From<SpvError> for
FFIErrorCode mapping is fully covered: construct SpvError::ChannelFailure(...),
SpvError::Sync(...), and SpvError::QuorumLookupError(...) (using minimal valid
inner values) and add assertions that FFIErrorCode::from(...) for each yields
FFIErrorCode::RuntimeError, FFIErrorCode::SyncError, and
FFIErrorCode::ValidationError respectively (compare as i32 like the existing
asserts).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@dash-spv-ffi/src/error.rs`:
- Around line 19-20: FFI enum variant numbers changed, breaking the C ABI:
update the public #[repr(C)] enum FFIErrorCode to preserve original
discriminants by explicitly assigning ConfigError = 8 and RuntimeError = 9
(leave gaps for the removed WalletError/NotImplemented/Unknown), regenerate
cbindgen headers, and either bump the crate version + add a changelog entry and
correct the PR title if you intend to publish an ABI-breaking change, or keep
the explicit numeric values to avoid breaking downstream C/C++ consumers.

---

Nitpick comments:
In `@dash-spv-ffi/tests/unit/test_error_handling.rs`:
- Around line 82-96: Add tests that exercise the remaining SpvError variants so
the From<SpvError> for FFIErrorCode mapping is fully covered: construct
SpvError::ChannelFailure(...), SpvError::Sync(...), and
SpvError::QuorumLookupError(...) (using minimal valid inner values) and add
assertions that FFIErrorCode::from(...) for each yields
FFIErrorCode::RuntimeError, FFIErrorCode::SyncError, and
FFIErrorCode::ValidationError respectively (compare as i32 like the existing
asserts).

In `@dash-spv/tests/error_types_test.rs`:
- Around line 146-167: The test function name
test_sync_error_variants_and_categories is misleading because
SyncError::category() was removed; rename the test to reflect current behavior
(e.g., test_sync_error_variants) to match that it only checks string
representations; update the test function identifier
test_sync_error_variants_and_categories to test_sync_error_variants and adjust
any references (imports, mod declarations) to the new name so the test suite and
CI reflect the rename.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f3ed784-5fb3-4600-be75-d6c8d0190978

📥 Commits

Reviewing files that changed from the base of the PR and between 1b21f7d and c3fa8c7.

📒 Files selected for processing (8)
  • dash-spv-ffi/src/error.rs
  • dash-spv-ffi/tests/test_error.rs
  • dash-spv-ffi/tests/unit/test_error_handling.rs
  • dash-spv/clippy.toml
  • dash-spv/src/error.rs
  • dash-spv/src/lib.rs
  • dash-spv/src/main.rs
  • dash-spv/tests/error_types_test.rs
💤 Files with no reviewable changes (1)
  • dash-spv-ffi/tests/test_error.rs
✅ Files skipped from review due to trivial changes (2)
  • dash-spv/clippy.toml
  • dash-spv/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • dash-spv/src/main.rs

Comment thread dash-spv-ffi/src/error.rs
@ZocoLini ZocoLini changed the title Chore: error cleanup chore: error cleanup Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.97%. Comparing base (7e2aa23) to head (c3fa8c7).

Files with missing lines Patch % Lines
dash-spv/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           v0.42-dev     #364      +/-   ##
=============================================
- Coverage      67.99%   67.97%   -0.02%     
=============================================
  Files            319      319              
  Lines          67970    67921      -49     
=============================================
- Hits           46216    46170      -46     
+ Misses         21754    21751       -3     
Flag Coverage Δ
core 75.25% <ø> (ø)
ffi 38.98% <ø> (-0.22%) ⬇️
rpc 20.00% <ø> (ø)
spv 85.48% <0.00%> (+0.11%) ⬆️
wallet 67.62% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv-ffi/src/error.rs 68.18% <ø> (+2.18%) ⬆️
dash-spv/src/error.rs 33.33% <ø> (-28.67%) ⬇️
dash-spv/src/main.rs 0.00% <0.00%> (ø)

... and 17 files with indirect coverage changes

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.

1 participant