feat: add UniFFI callback traits for event dispatch#12
Conversation
…tListener Defines two new `#[derive(uniffi::Enum)]` types in `bridge/mod.rs`: - `SyncEvent`: flattened bridge version of the internal sync event enum, covering all 14 variants with primitive-only fields (BlockHash → String, SocketAddr → String, complex types decomposed). - `NetworkEvent`: bridge version of the internal network event enum (PeerConnected, PeerDisconnected, PeersUpdated) using String for addresses. Expands `SpvEventListener` with: - `on_sync_event(&self, event: SyncEvent)` - `on_network_event(&self, event: NetworkEvent)` - Updated `on_sync_progress` signature with `current_height` and `target_height` Removes the obsolete `start_mock_sync` placeholder and updates tests. Closes #8 Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
|
@claude CI fails with clippy error: |
|
Claude finished @xdustinface's task in 44s —— View job Fixing Clippy Lint Error
SummaryFixed two clippy lint warnings in
Committed as |
Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
|
@claude CI is still failing on pre-commit checks. It looks like a |
|
Claude finished @xdustinface's task in 7m 4s —— View job Fixing Cargo Fmt Formatting Issues
SummaryThe Change in // Before
use super::*;
use std::sync::Mutex;
// After
use std::sync::Mutex;
use super::*;Committed as |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
|
@claude Pre-commit is STILL failing with formatting issues. Please run |
|
Claude finished @xdustinface's task in 2m 2s —— View job Fixing Cargo Fmt (All Crates)
SummaryThe
Committed as |
Co-authored-by: Kevin Rombach <xdustinface@users.noreply.github.com>
Defines UniFFI-compatible event types and callback trait for event dispatch.
Closes #8
SyncEventandNetworkEventenums with UniFFI derivesSpvEventListenercallback trait with#[uniffi::export(with_foreign)]cargo check -p dash-spv --features uniffi