Skip to content

Commit 4ff67ba

Browse files
authored
docs: fix docs build issues (#297)
1 parent cefeaa9 commit 4ff67ba

File tree

29 files changed

+83
-63
lines changed

29 files changed

+83
-63
lines changed

dash-spv-ffi/FFI_API.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Functions: 3
9494

9595
| Function | Description | Module |
9696
|----------|-------------|--------|
97-
| `dash_spv_ffi_client_broadcast_transaction` | No description | broadcast |
97+
| `dash_spv_ffi_client_broadcast_transaction` | Broadcasts a transaction to the Dash network via connected peers | broadcast |
9898
| `dash_spv_ffi_unconfirmed_transaction_destroy` | Destroys an FFIUnconfirmedTransaction and all its associated resources #... | types |
9999
| `dash_spv_ffi_unconfirmed_transaction_destroy_raw_tx` | Destroys the raw transaction bytes allocated for an FFIUnconfirmedTransaction... | types |
100100

@@ -254,7 +254,7 @@ dash_spv_ffi_config_add_peer(config: *mut FFIClientConfig, addr: *const c_char,)
254254
```
255255

256256
**Description:**
257-
Adds a peer address to the configuration Accepts either a full socket address (e.g., "192.168.1.1:9999" or "[::1]:19999") or an IP-only string (e.g., "127.0.0.1" or "2001:db8::1"). When an IP-only string is given, the default P2P port for the configured network is used. # Safety - `config` must be a valid pointer to an FFIClientConfig created by dash_spv_ffi_config_new/mainnet/testnet - `addr` must be a valid null-terminated C string containing a socket address or IP-only string - The caller must ensure both pointers remain valid for the duration of this call
257+
Adds a peer address to the configuration Accepts either a full socket address (e.g., `192.168.1.1:9999` or `[::1]:19999`) or an IP-only string (e.g., "127.0.0.1" or "2001:db8::1"). When an IP-only string is given, the default P2P port for the configured network is used. # Safety - `config` must be a valid pointer to an FFIClientConfig created by dash_spv_ffi_config_new/mainnet/testnet - `addr` must be a valid null-terminated C string containing a socket address or IP-only string - The caller must ensure both pointers remain valid for the duration of this call
258258

259259
**Safety:**
260260
- `config` must be a valid pointer to an FFIClientConfig created by dash_spv_ffi_config_new/mainnet/testnet - `addr` must be a valid null-terminated C string containing a socket address or IP-only string - The caller must ensure both pointers remain valid for the duration of this call
@@ -785,6 +785,12 @@ Destroys the addresses array allocated for an FFIUnconfirmedTransaction # Safet
785785
dash_spv_ffi_client_broadcast_transaction(client: *mut FFIDashSpvClient, tx_hex: *const c_char,) -> i32
786786
```
787787
788+
**Description:**
789+
Broadcasts a transaction to the Dash network via connected peers. # Safety - `client` must be a valid, non-null pointer to an initialized FFIDashSpvClient - `tx_hex` must be a valid, non-null pointer to a NUL-terminated C string containing a hex-encoded serialized transaction
790+
791+
**Safety:**
792+
- `client` must be a valid, non-null pointer to an initialized FFIDashSpvClient - `tx_hex` must be a valid, non-null pointer to a NUL-terminated C string containing a hex-encoded serialized transaction
793+
788794
**Module:** `broadcast`
789795
790796
---

dash-spv-ffi/include/dash_spv_ffi.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ int32_t dash_spv_ffi_config_set_max_peers(struct FFIClientConfig *config,
609609
/**
610610
* Adds a peer address to the configuration
611611
*
612-
* Accepts either a full socket address (e.g., "192.168.1.1:9999" or "[::1]:19999")
612+
* Accepts either a full socket address (e.g., `192.168.1.1:9999` or `[::1]:19999`)
613613
* or an IP-only string (e.g., "127.0.0.1" or "2001:db8::1"). When an IP-only
614614
* string is given, the default P2P port for the configured network is used.
615615
*
@@ -992,6 +992,15 @@ int32_t dash_spv_ffi_init_logging(const char *level,
992992

993993
void dash_spv_ffi_enable_test_mode(void) ;
994994

995+
/**
996+
* Broadcasts a transaction to the Dash network via connected peers.
997+
*
998+
* # Safety
999+
*
1000+
* - `client` must be a valid, non-null pointer to an initialized FFIDashSpvClient
1001+
* - `tx_hex` must be a valid, non-null pointer to a NUL-terminated C string
1002+
* containing a hex-encoded serialized transaction
1003+
*/
9951004

9961005
int32_t dash_spv_ffi_client_broadcast_transaction(struct FFIDashSpvClient *client,
9971006
const char *tx_hex)

dash-spv-ffi/src/broadcast.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ use crate::{null_check, set_last_error, FFIDashSpvClient, FFIErrorCode};
22
use std::ffi::CStr;
33
use std::os::raw::c_char;
44

5+
/// Broadcasts a transaction to the Dash network via connected peers.
6+
///
7+
/// # Safety
8+
///
9+
/// - `client` must be a valid, non-null pointer to an initialized FFIDashSpvClient
10+
/// - `tx_hex` must be a valid, non-null pointer to a NUL-terminated C string
11+
/// containing a hex-encoded serialized transaction
512
#[no_mangle]
613
pub unsafe extern "C" fn dash_spv_ffi_client_broadcast_transaction(
714
client: *mut FFIDashSpvClient,

dash-spv-ffi/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub unsafe extern "C" fn dash_spv_ffi_config_set_max_peers(
125125

126126
/// Adds a peer address to the configuration
127127
///
128-
/// Accepts either a full socket address (e.g., "192.168.1.1:9999" or "[::1]:19999")
128+
/// Accepts either a full socket address (e.g., `192.168.1.1:9999` or `[::1]:19999`)
129129
/// or an IP-only string (e.g., "127.0.0.1" or "2001:db8::1"). When an IP-only
130130
/// string is given, the default P2P port for the configured network is used.
131131
///

dash-spv/src/client/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub struct DashSpvClient<W: WalletInterface, N: NetworkManager, S: StorageManage
109109
///
110110
/// # Architectural Design
111111
///
112-
/// The sync manager is stored as a non-shared field (not wrapped in Arc<Mutex<T>>)
112+
/// The sync manager is stored as a non-shared field (not wrapped in `Arc<Mutex<T>>`)
113113
/// for the following reasons:
114114
///
115115
/// 1. **Single Owner Pattern**: The sync manager is exclusively owned by the client,
@@ -126,7 +126,7 @@ pub struct DashSpvClient<W: WalletInterface, N: NetworkManager, S: StorageManage
126126
///
127127
/// If concurrent access becomes necessary (e.g., for monitoring sync progress from
128128
/// multiple threads), consider:
129-
/// - Using interior mutability patterns (Arc<Mutex<SyncManager>>)
129+
/// - Using interior mutability patterns (`Arc<Mutex<SyncManager>>`)
130130
/// - Extracting read-only state into a separate shared structure
131131
/// - Implementing a message-passing architecture for sync commands
132132
///

dash-spv/src/client/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
//! ## Lock Ordering (CRITICAL - Prevents Deadlocks)
2424
//!
2525
//! When acquiring multiple locks, ALWAYS use this order:
26-
//! 1. running (Arc<RwLock<bool>>)
27-
//! 2. state (Arc<RwLock<ChainState>>)
28-
//! 3. stats (Arc<RwLock<SpvStats>>)
29-
//! 4. mempool_state (Arc<RwLock<MempoolState>>)
30-
//! 5. storage (Arc<Mutex<S>>)
26+
//! 1. running (`Arc<RwLock<bool>>`)
27+
//! 2. state (`Arc<RwLock<ChainState>>`)
28+
//! 3. stats (`Arc<RwLock<SpvStats>>`)
29+
//! 4. mempool_state (`Arc<RwLock<MempoolState>>`)
30+
//! 5. storage (`Arc<Mutex<S>>`)
3131
//!
3232
//! Never acquire locks in reverse order or deadlock will occur!
3333

dash-spv/src/logging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn init_console_logging(level: LevelFilter) -> LoggingResult<LoggingGuard> {
7474
/// Note: If neither console nor file output is enabled, logging is disabled
7575
/// (tracing macros become no-ops) and Ok is returned.
7676
///
77-
/// # Example
77+
/// # Examples
7878
///
7979
/// ```no_run
8080
/// use dash_spv::logging::{init_logging, LoggingConfig, LogFileConfig};

dash-spv/src/sync/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl<
304304
/// - `filters_downloaded`: Should be calculated from storage
305305
/// - `last_synced_filter_height`: Should be queried from storage
306306
///
307-
/// # Example
307+
/// # Examples
308308
/// ```ignore
309309
/// let mut progress = sync_manager.get_progress();
310310
/// progress.header_height = storage.get_tip_height().await?.unwrap_or(0);

dash-spv/src/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! - types/balances.rs - AddressBalance, UnconfirmedTransaction
1010
//!
1111
//! # Thread Safety
12-
//! Many types here are wrapped in Arc<RwLock> or Arc<Mutex> when used.
12+
//! Many types here are wrapped in `Arc<RwLock>` or `Arc<Mutex>` when used.
1313
//! Always acquire locks in consistent order to prevent deadlocks:
1414
//! 1. state (ChainState)
1515
//! 2. stats (SpvStats)
@@ -27,13 +27,13 @@ use std::sync::Arc;
2727

2828
/// Shared, mutex-protected set of filter heights used across components.
2929
///
30-
/// # Why Arc<Mutex<HashSet>>?
30+
/// # Why `Arc<Mutex<HashSet>>`?
3131
/// - Arc: Shared ownership between FilterSyncManager and SpvStats
3232
/// - Mutex: Interior mutability for concurrent updates from filter download tasks
3333
/// - HashSet: Fast O(1) membership testing for gap detection
3434
///
3535
/// # Performance Note
36-
/// Consider Arc<RwLock> if read contention becomes an issue (most operations are reads).
36+
/// Consider `Arc<RwLock>` if read contention becomes an issue (most operations are reads).
3737
pub type SharedFilterHeights = std::sync::Arc<tokio::sync::Mutex<std::collections::HashSet<u32>>>;
3838

3939
/// A block header with its cached hash to avoid expensive X11 recomputation.
@@ -240,7 +240,7 @@ impl DetailedSyncProgress {
240240
/// # CRITICAL: This is the heart of the SPV client's state
241241
///
242242
/// ## Thread Safety
243-
/// Almost always wrapped in Arc<RwLock<ChainState>> for shared access.
243+
/// Almost always wrapped in `Arc<RwLock<ChainState>>` for shared access.
244244
/// Multiple readers can access simultaneously, but writes are exclusive.
245245
///
246246
/// ## Checkpoint Sync

dash/src/blockdata/transaction/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use crate::prelude::*;
5252
pub use crate::transaction::outpoint::*;
5353
use crate::{ScriptBuf, Weight, io};
5454

55-
/// Result of [`SighashCache::legacy_encode_signing_data_to`].
55+
/// Result of `SighashCache::legacy_encode_signing_data_to`.
5656
///
5757
/// This type forces the caller to handle SIGHASH_SINGLE bug case.
5858
///
@@ -232,10 +232,10 @@ impl Transaction {
232232
/// sighash flag can be computed.
233233
///
234234
/// To actually produce a scriptSig, this hash needs to be run through an ECDSA signer, the
235-
/// [`EcdsaSighashType`] appended to the resulting sig, and a script written around this, but
235+
/// `EcdsaSighashType` appended to the resulting sig, and a script written around this, but
236236
/// this is the general (and hard) part.
237237
///
238-
/// The `sighash_type` supports an arbitrary `u32` value, instead of just [`EcdsaSighashType`],
238+
/// The `sighash_type` supports an arbitrary `u32` value, instead of just `EcdsaSighashType`,
239239
/// because internally 4 bytes are being hashed, even though only the lowest byte is appended to
240240
/// signature in a transaction.
241241
///
@@ -245,7 +245,7 @@ impl Transaction {
245245
/// `script_pubkey` to determine which separators get evaluated and which don't, which we don't
246246
/// have the information to determine.
247247
/// - Does NOT handle the sighash single bug, you should either handle that manually or use
248-
/// [`Self::signature_hash()`] instead.
248+
/// `Self::signature_hash()` instead.
249249
///
250250
/// # Panics
251251
///
@@ -254,10 +254,10 @@ impl Transaction {
254254
/// sighash flag can be computed.
255255
///
256256
/// To actually produce a scriptSig, this hash needs to be run through an ECDSA signer, the
257-
/// [`EcdsaSighashType`] appended to the resulting sig, and a script written around this, but
257+
/// `EcdsaSighashType` appended to the resulting sig, and a script written around this, but
258258
/// this is the general (and hard) part.
259259
///
260-
/// The `sighash_type` supports an arbitrary `u32` value, instead of just [`EcdsaSighashType`],
260+
/// The `sighash_type` supports an arbitrary `u32` value, instead of just `EcdsaSighashType`,
261261
/// because internally 4 bytes are being hashed, even though only the lowest byte is appended to
262262
/// signature in a transaction.
263263
///

0 commit comments

Comments
 (0)