Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ci-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ groups:

wallet:
- key-wallet
- key-wallet-manager

ffi:
- dash-spv-ffi
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["dash", "hashes", "internals", "fuzz", "rpc-client", "rpc-json", "rpc-integration-test", "key-wallet", "key-wallet-ffi", "dash-spv", "dash-spv-ffi"]
members = ["dash", "hashes", "internals", "fuzz", "rpc-client", "rpc-json", "rpc-integration-test", "key-wallet", "key-wallet-manager", "key-wallet-ffi", "dash-spv", "dash-spv-ffi"]
resolver = "2"

[workspace.package]
Expand Down
1 change: 1 addition & 0 deletions dash-spv-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tracing = "0.1"
key-wallet-ffi = { path = "../key-wallet-ffi" }
# Still need these for SPV client internals (not for FFI types)
key-wallet = { path = "../key-wallet" }
key-wallet-manager = { path = "../key-wallet-manager" }
rand = "0.8"
clap = { version = "4.5", features = ["derive"] }

Expand Down
2 changes: 1 addition & 1 deletion dash-spv-ffi/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use dash_spv::network::NetworkEvent;
use dash_spv::sync::{SyncEvent, SyncProgress};
use dash_spv::EventHandler;
use dashcore::hashes::Hash;
use key_wallet::manager::WalletEvent;
use key_wallet_ffi::types::FFITransactionContext;
use key_wallet_manager::WalletEvent;
use std::ffi::CString;
use std::os::raw::{c_char, c_void};

Expand Down
4 changes: 2 additions & 2 deletions dash-spv-ffi/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use tokio_util::sync::CancellationToken;

/// FFI wrapper around `DashSpvClient`.
type InnerClient = DashSpvClient<
key_wallet::manager::WalletManager<key_wallet::wallet::managed_wallet_info::ManagedWalletInfo>,
key_wallet_manager::WalletManager<key_wallet::wallet::managed_wallet_info::ManagedWalletInfo>,
dash_spv::network::PeerNetworkManager,
DiskStorageManager,
FFIEventCallbacks,
Expand Down Expand Up @@ -78,7 +78,7 @@ pub unsafe extern "C" fn dash_spv_ffi_client_new(
// Construct concrete implementations for generics
let network = dash_spv::network::PeerNetworkManager::new(&client_config).await;
let storage = DiskStorageManager::new(&client_config).await;
let wallet = key_wallet::manager::WalletManager::<
let wallet = key_wallet_manager::WalletManager::<
key_wallet::wallet::managed_wallet_info::ManagedWalletInfo,
>::new(client_config.network);
let wallet = std::sync::Arc::new(tokio::sync::RwLock::new(wallet));
Expand Down
2 changes: 1 addition & 1 deletion dash-spv-ffi/tests/test_wallet_manager.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[cfg(test)]
mod tests {
use dash_spv_ffi::*;
use key_wallet::manager::WalletManager;
use key_wallet::wallet::initialization::WalletAccountCreationOptions;
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_ffi::{
Expand All @@ -11,6 +10,7 @@ mod tests {
},
FFIError, FFINetwork, FFIWalletManager,
};
use key_wallet_manager::WalletManager;
use std::ffi::{CStr, CString};
use tempfile::TempDir;

Expand Down
4 changes: 3 additions & 1 deletion dash-spv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ rust-version = "1.89"
# Core Dash libraries
dashcore = { path = "../dash", features = ["serde", "core-block-hash-use-x11", "message_verification", "bls", "quorum_validation"] }
dashcore_hashes = { path = "../hashes" }
key-wallet = { path = "../key-wallet", features = ["parallel-filters"] }
key-wallet = { path = "../key-wallet" }
key-wallet-manager = { path = "../key-wallet-manager", features = ["parallel-filters"] }

# BLS signatures
blsful = { git = "https://github.com/dashpay/agora-blsful", rev = "0c34a7a488a0bd1c9a9a2196e793b303ad35c900" }
Expand Down Expand Up @@ -64,6 +65,7 @@ log = "0.4"
dash-spv = { path = ".", features = ["test-utils"] }
dashcore = { path = "../dash", features = ["test-utils"] }
key-wallet = { path = "../key-wallet", features = ["test-utils"] }
key-wallet-manager = { path = "../key-wallet-manager", features = ["test-utils"] }
criterion = { version = "0.8.1", features = ["async_tokio"] }
tempfile = "3.0"
tokio-test = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/examples/filter_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use dash_spv::network::PeerNetworkManager;
use dash_spv::storage::DiskStorageManager;
use dash_spv::{init_console_logging, ClientConfig, DashSpvClient, LevelFilter};
use dashcore::Address;
use key_wallet::manager::WalletManager;
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::WalletManager;
use std::str::FromStr;
use std::sync::Arc;
use tokio::sync::RwLock;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/examples/simple_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use dash_spv::storage::DiskStorageManager;
use dash_spv::{init_console_logging, ClientConfig, DashSpvClient, LevelFilter};
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;

use key_wallet::manager::WalletManager;
use key_wallet_manager::WalletManager;
use std::sync::Arc;
use tokio::sync::RwLock;
use tokio_util::sync::CancellationToken;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/examples/spv_with_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use dash_spv::network::PeerNetworkManager;
use dash_spv::storage::DiskStorageManager;
use dash_spv::{ClientConfig, DashSpvClient, LevelFilter};
use key_wallet::manager::WalletManager;
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::WalletManager;
use std::sync::Arc;
use tokio::sync::RwLock;
use tokio_util::sync::CancellationToken;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::storage::{
};
use crate::sync::SyncCoordinator;
use crate::types::MempoolState;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

pub(super) type PersistentSyncCoordinator<W> = SyncCoordinator<
PersistentBlockHeaderStorage,
Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/client/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tokio_util::sync::CancellationToken;

use crate::network::NetworkEvent;
use crate::sync::{SyncEvent, SyncProgress};
use key_wallet::manager::WalletEvent;
use key_wallet_manager::WalletEvent;

/// Trait for receiving SPV client events.
///
Expand Down Expand Up @@ -105,7 +105,7 @@ mod tests {
use super::{spawn_broadcast_monitor, spawn_progress_monitor, EventHandler};
use crate::network::NetworkEvent;
use crate::sync::{ManagerIdentifier, SyncEvent, SyncProgress};
use key_wallet::manager::WalletEvent;
use key_wallet_manager::WalletEvent;

struct RecordingHandler {
sync_count: AtomicUsize,
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tokio::sync::watch;
use crate::network::{NetworkEvent, NetworkManager};
use crate::storage::StorageManager;
use crate::sync::{SyncEvent, SyncProgress};
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;
use tokio::sync::broadcast;

use super::{DashSpvClient, EventHandler};
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::sync::{
use crate::types::MempoolState;
use dashcore::sml::masternode_list_engine::MasternodeListEngine;
use dashcore_hashes::Hash;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

impl<W: WalletInterface, N: NetworkManager, S: StorageManager, H: EventHandler>
DashSpvClient<W, N, S, H>
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::error::Result;
use crate::mempool_filter::MempoolFilter;
use crate::network::NetworkManager;
use crate::storage::StorageManager;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

use super::{DashSpvClient, EventHandler};

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ mod tests {
use crate::storage::DiskStorageManager;
use crate::{test_utils::MockNetworkManager, types::UnconfirmedTransaction};
use dashcore::{Address, Amount, Transaction, TxOut};
use key_wallet::manager::WalletManager;
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::WalletManager;
use std::sync::Arc;
use tempfile::TempDir;
use tokio::sync::RwLock;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dashcore::sml::llmq_type::LLMQType;
use dashcore::sml::masternode_list_engine::MasternodeListEngine;
use dashcore::sml::quorum_entry::qualified_quorum_entry::QualifiedQuorumEntry;
use dashcore::QuorumHash;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;
use std::sync::Arc;
use tokio::sync::RwLock;

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/sync_coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::network::NetworkManager;
use crate::storage::StorageManager;
use crate::sync::SyncProgress;
use crate::SpvError;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

const SYNC_COORDINATOR_TICK_MS: Duration = Duration::from_millis(100);

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/client/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::error::{Result, SpvError};
use crate::network::NetworkManager;
use crate::storage::StorageManager;
use dashcore::network::message::NetworkMessage;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

use super::{DashSpvClient, EventHandler};

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! use dash_spv::storage::DiskStorageManager;
//! use dashcore::Network;
//! use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
//! use key_wallet::manager::WalletManager;
//! use key_wallet_manager::WalletManager;
//! use std::sync::Arc;
//! use tokio::sync::RwLock;
//! use tokio_util::sync::CancellationToken;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use clap::{Arg, Command};
use dash_spv::network::NetworkEvent;
use dash_spv::sync::{SyncEvent, SyncProgress};
use dash_spv::{ClientConfig, DashSpvClient, EventHandler, LevelFilter, MempoolStrategy, Network};
use key_wallet::manager::{WalletEvent, WalletManager};
use key_wallet::wallet::managed_wallet_info::ManagedWalletInfo;
use key_wallet_manager::{WalletEvent, WalletManager};
use tokio_util::sync::CancellationToken;

/// Logs all SPV client events via tracing.
Expand Down
6 changes: 3 additions & 3 deletions dash-spv/src/sync/blocks/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::error::SyncResult;
use crate::network::RequestSender;
use crate::storage::{BlockHeaderStorage, BlockStorage};
use crate::sync::{BlocksProgress, SyncEvent, SyncManager, SyncState};
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

/// Blocks manager for downloading and processing matching blocks.
///
Expand Down Expand Up @@ -168,8 +168,8 @@ mod tests {
};
use crate::sync::{ManagerIdentifier, SyncEvent, SyncManagerProgress};
use crate::test_utils::MockNetworkManager;
use key_wallet::manager::FilterMatchKey;
use key_wallet::test_utils::MockWallet;
use key_wallet_manager::test_utils::MockWallet;
use key_wallet_manager::FilterMatchKey;
use std::collections::BTreeSet;

type TestBlocksManager =
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/blocks/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::network::RequestSender;
use crate::sync::download_coordinator::{DownloadConfig, DownloadCoordinator};
use dashcore::blockdata::block::Block;
use dashcore::BlockHash;
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;

/// Maximum number of concurrent block downloads.
const MAX_CONCURRENT_BLOCK_DOWNLOADS: usize = 20;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/blocks/sync_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::types::HashedBlock;
use crate::SyncError;
use async_trait::async_trait;
use dashcore::network::message::NetworkMessage;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

#[async_trait]
impl<H: BlockHeaderStorage, B: BlockStorage, W: WalletInterface + 'static> SyncManager
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::sync::ManagerIdentifier;
use dashcore::ephemerealdata::chain_lock::ChainLock;
use dashcore::ephemerealdata::instant_lock::InstantLock;
use dashcore::{Address, BlockHash, Txid};
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;
use std::collections::BTreeSet;

/// Events that managers can emit and subscribe to.
Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/sync/filters/batch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dashcore::bip158::BlockFilter;
use dashcore::Address;
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;
use std::collections::{HashMap, HashSet};

/// A completed batch of compact block filters ready for verification.
Expand Down Expand Up @@ -134,7 +134,7 @@ mod tests {
use crate::sync::filters::batch::FiltersBatch;
use dashcore::bip158::BlockFilter;
use dashcore::Header;
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;
use std::collections::{BTreeSet, HashMap};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/filters/batch_tracker.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dashcore::bip158::BlockFilter;
use dashcore::BlockHash;
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;
use std::collections::{HashMap, HashSet};

/// Tracks individual filters within a batch.
Expand Down
6 changes: 3 additions & 3 deletions dash-spv/src/sync/filters/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::validation::{FilterValidationInput, FilterValidator, Validator};

use crate::sync::progress::ProgressPercentage;
use dashcore::hash_types::FilterHeader;
use key_wallet::manager::WalletInterface;
use key_wallet::manager::{check_compact_filters_for_addresses, FilterMatchKey};
use key_wallet_manager::WalletInterface;
use key_wallet_manager::{check_compact_filters_for_addresses, FilterMatchKey};
use tokio::sync::RwLock;

/// Batch size for processing filters.
Expand Down Expand Up @@ -771,7 +771,7 @@ mod tests {
PersistentFilterStorage, StorageManager,
};
use crate::sync::{ManagerIdentifier, SyncManagerProgress};
use key_wallet::test_utils::MockWallet;
use key_wallet_manager::test_utils::MockWallet;
use tokio::sync::mpsc::unbounded_channel;

type TestFiltersManager = FiltersManager<
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/filters/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ mod tests {
use dashcore::block::Header;
use dashcore::network::message::NetworkMessage;
use dashcore_hashes::Hash;
use key_wallet::manager::FilterMatchKey;
use key_wallet_manager::FilterMatchKey;
use std::time::Duration;
use tempfile::TempDir;
use tokio::sync::mpsc::unbounded_channel;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/filters/sync_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::sync::{
};
use async_trait::async_trait;
use dashcore::network::message::NetworkMessage;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

#[async_trait]
impl<
Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/sync/mempool/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::network::RequestSender;
use crate::sync::mempool::MempoolProgress;
use crate::sync::SyncEvent;
use crate::types::{MempoolState, UnconfirmedTransaction};
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

/// Timeout for pruning expired mempool transactions (24 hours).
pub(super) const MEMPOOL_TX_EXPIRY: Duration = Duration::from_secs(24 * 3600);
Expand Down Expand Up @@ -497,8 +497,8 @@ mod tests {
use dashcore::hashes::Hash;
use dashcore::network::message::NetworkMessage;
use dashcore::{Address, BlockHash, Network, ScriptBuf, Transaction};
use key_wallet::test_utils::MockWallet;
use key_wallet::transaction_checking::TransactionContext;
use key_wallet_manager::test_utils::MockWallet;

use crate::sync::SyncState;
use crate::test_utils::test_socket_address;
Expand Down
4 changes: 2 additions & 2 deletions dash-spv/src/sync/mempool/sync_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::sync::{
};
use async_trait::async_trait;
use dashcore::network::message::NetworkMessage;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

#[async_trait]
impl<W: WalletInterface + 'static> SyncManager for MempoolManager<W> {
Expand Down Expand Up @@ -191,7 +191,7 @@ mod tests {
use crate::test_utils::test_socket_address;
use crate::types::MempoolState;
use dashcore::hashes::Hash;
use key_wallet::test_utils::MockWallet;
use key_wallet_manager::test_utils::MockWallet;
use std::sync::Arc;
use tokio::sync::{mpsc, RwLock};

Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/sync/sync_coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::sync::{
SyncManager, SyncManagerProgress, SyncManagerTaskContext, SyncProgress,
};
use crate::SyncError;
use key_wallet::manager::WalletInterface;
use key_wallet_manager::WalletInterface;

const TASK_JOIN_TIMEOUT: Duration = Duration::from_secs(5);
const DEFAULT_SYNC_EVENT_CAPACITY: usize = 10000;
Expand Down
2 changes: 1 addition & 1 deletion dash-spv/src/test_utils/event_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tokio::sync::{broadcast, watch};
use crate::client::EventHandler;
use crate::network::NetworkEvent;
use crate::sync::{SyncEvent, SyncProgress};
use key_wallet::manager::WalletEvent;
use key_wallet_manager::WalletEvent;

/// Event handler that forwards all events to internal channels.
///
Expand Down
Loading
Loading