Skip to content

Commit 19f0b56

Browse files
committed
Fix verify-ffi-docs
1 parent 524716c commit 19f0b56

File tree

6 files changed

+250
-304
lines changed

6 files changed

+250
-304
lines changed

dash-spv-ffi/FFI_API.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,31 @@ Functions: 27
3939
| Function | Description | Module |
4040
|----------|-------------|--------|
4141
| `dash_spv_ffi_client_update_config` | Update the running client's configuration | client |
42-
| `dash_spv_ffi_config_add_peer` | Adds a peer address to the configuration Accepts either a full socket address... | config |
43-
| `dash_spv_ffi_config_destroy` | Destroys an FFIClientConfig and frees its memory # Safety - `config` must be... | config |
44-
| `dash_spv_ffi_config_get_data_dir` | Gets the data directory path from the configuration # Safety - `config` must... | config |
45-
| `dash_spv_ffi_config_get_mempool_strategy` | Gets the mempool synchronization strategy # Safety - `config` must be a vali... | config |
46-
| `dash_spv_ffi_config_get_mempool_tracking` | Gets whether mempool tracking is enabled # Safety - `config` must be a valid... | config |
47-
| `dash_spv_ffi_config_get_network` | Gets the network type from the configuration # Safety - `config` must be a v... | config |
42+
| `dash_spv_ffi_config_add_peer` | Adds a peer address to the configuration Accepts either a full socket... | config |
43+
| `dash_spv_ffi_config_destroy` | Destroys an FFIClientConfig and frees its memory # Safety - `config` must... | config |
44+
| `dash_spv_ffi_config_get_data_dir` | Gets the data directory path from the configuration # Safety - `config`... | config |
45+
| `dash_spv_ffi_config_get_mempool_strategy` | Gets the mempool synchronization strategy # Safety - `config` must be a... | config |
46+
| `dash_spv_ffi_config_get_mempool_tracking` | Gets whether mempool tracking is enabled # Safety - `config` must be a... | config |
47+
| `dash_spv_ffi_config_get_network` | Gets the network type from the configuration # Safety - `config` must be a... | config |
4848
| `dash_spv_ffi_config_mainnet` | No description | config |
4949
| `dash_spv_ffi_config_new` | No description | config |
50-
| `dash_spv_ffi_config_set_data_dir` | Sets the data directory for storing blockchain data # Safety - `config` must... | config |
51-
| `dash_spv_ffi_config_set_fetch_mempool_transactions` | Sets whether to fetch full mempool transaction data # Safety - `config` must... | config |
52-
| `dash_spv_ffi_config_set_filter_load` | Sets whether to load bloom filters # Safety - `config` must be a valid point... | config |
53-
| `dash_spv_ffi_config_set_masternode_sync_enabled` | Enables or disables masternode synchronization # Safety - `config` must be a... | config |
54-
| `dash_spv_ffi_config_set_max_mempool_transactions` | Sets the maximum number of mempool transactions to track # Safety - `config`... | config |
55-
| `dash_spv_ffi_config_set_max_peers` | Sets the maximum number of peers to connect to # Safety - `config` must be a... | config |
56-
| `dash_spv_ffi_config_set_mempool_strategy` | Sets the mempool synchronization strategy # Safety - `config` must be a vali... | config |
57-
| `dash_spv_ffi_config_set_mempool_timeout` | Sets the mempool transaction timeout in seconds # Safety - `config` must be ... | config |
58-
| `dash_spv_ffi_config_set_mempool_tracking` | Enables or disables mempool tracking # Safety - `config` must be a valid poi... | config |
59-
| `dash_spv_ffi_config_set_persist_mempool` | Sets whether to persist mempool state to disk # Safety - `config` must be a ... | config |
60-
| `dash_spv_ffi_config_set_relay_transactions` | Sets whether to relay transactions (currently a no-op) # Safety - `config` m... | config |
61-
| `dash_spv_ffi_config_set_restrict_to_configured_peers` | Restrict connections strictly to configured peers (disable DNS discovery and ... | config |
62-
| `dash_spv_ffi_config_set_start_from_height` | Sets the starting block height for synchronization # Safety - `config` must ... | config |
63-
| `dash_spv_ffi_config_set_user_agent` | Sets the user agent string to advertise in the P2P handshake # Safety - `con... | config |
64-
| `dash_spv_ffi_config_set_validation_mode` | Sets the validation mode for the SPV client # Safety - `config` must be a va... | config |
65-
| `dash_spv_ffi_config_set_wallet_creation_time` | Sets the wallet creation timestamp for synchronization optimization # Safety... | config |
66-
| `dash_spv_ffi_config_set_worker_threads` | Sets the number of Tokio worker threads for the FFI runtime (0 = auto) # Saf... | config |
50+
| `dash_spv_ffi_config_set_data_dir` | Sets the data directory for storing blockchain data # Safety - `config`... | config |
51+
| `dash_spv_ffi_config_set_fetch_mempool_transactions` | Sets whether to fetch full mempool transaction data # Safety - `config`... | config |
52+
| `dash_spv_ffi_config_set_filter_load` | Sets whether to load bloom filters # Safety - `config` must be a valid... | config |
53+
| `dash_spv_ffi_config_set_masternode_sync_enabled` | Enables or disables masternode synchronization # Safety - `config` must be... | config |
54+
| `dash_spv_ffi_config_set_max_mempool_transactions` | Sets the maximum number of mempool transactions to track # Safety -... | config |
55+
| `dash_spv_ffi_config_set_max_peers` | Sets the maximum number of peers to connect to # Safety - `config` must be... | config |
56+
| `dash_spv_ffi_config_set_mempool_strategy` | Sets the mempool synchronization strategy # Safety - `config` must be a... | config |
57+
| `dash_spv_ffi_config_set_mempool_timeout` | Sets the mempool transaction timeout in seconds # Safety - `config` must be... | config |
58+
| `dash_spv_ffi_config_set_mempool_tracking` | Enables or disables mempool tracking # Safety - `config` must be a valid... | config |
59+
| `dash_spv_ffi_config_set_persist_mempool` | Sets whether to persist mempool state to disk # Safety - `config` must be a... | config |
60+
| `dash_spv_ffi_config_set_relay_transactions` | Sets whether to relay transactions (currently a no-op) # Safety - `config`... | config |
61+
| `dash_spv_ffi_config_set_restrict_to_configured_peers` | Restrict connections strictly to configured peers (disable DNS discovery and... | config |
62+
| `dash_spv_ffi_config_set_start_from_height` | Sets the starting block height for synchronization # Safety - `config` must... | config |
63+
| `dash_spv_ffi_config_set_user_agent` | Sets the user agent string to advertise in the P2P handshake # Safety -... | config |
64+
| `dash_spv_ffi_config_set_validation_mode` | Sets the validation mode for the SPV client # Safety - `config` must be a... | config |
65+
| `dash_spv_ffi_config_set_wallet_creation_time` | Sets the wallet creation timestamp for synchronization optimization #... | config |
66+
| `dash_spv_ffi_config_set_worker_threads` | Sets the number of Tokio worker threads for the FFI runtime (0 = auto) #... | config |
6767
| `dash_spv_ffi_config_testnet` | No description | config |
6868

6969
### Synchronization
@@ -78,7 +78,7 @@ Functions: 8
7878
| `dash_spv_ffi_client_is_filter_sync_available` | Check if compact filter sync is currently available | client |
7979
| `dash_spv_ffi_client_sync_to_tip` | Sync the SPV client to the chain tip | client |
8080
| `dash_spv_ffi_client_sync_to_tip_with_progress` | Sync the SPV client to the chain tip with detailed progress updates | client |
81-
| `dash_spv_ffi_client_test_sync` | Performs a test synchronization of the SPV client # Parameters - `client`: P... | client |
81+
| `dash_spv_ffi_client_test_sync` | Performs a test synchronization of the SPV client # Parameters - `client`:... | client |
8282
| `dash_spv_ffi_sync_progress_destroy` | Destroy a `FFISyncProgress` object returned by this crate | client |
8383

8484
### Address Monitoring
@@ -87,7 +87,7 @@ Functions: 1
8787

8888
| Function | Description | Module |
8989
|----------|-------------|--------|
90-
| `dash_spv_ffi_unconfirmed_transaction_destroy_addresses` | Destroys the addresses array allocated for an FFIUnconfirmedTransaction # Sa... | types |
90+
| `dash_spv_ffi_unconfirmed_transaction_destroy_addresses` | Destroys the addresses array allocated for an FFIUnconfirmedTransaction #... | types |
9191

9292
### Transaction Management
9393

@@ -96,7 +96,7 @@ Functions: 3
9696
| Function | Description | Module |
9797
|----------|-------------|--------|
9898
| `dash_spv_ffi_client_broadcast_transaction` | No description | broadcast |
99-
| `dash_spv_ffi_unconfirmed_transaction_destroy` | Destroys an FFIUnconfirmedTransaction and all its associated resources # Saf... | types |
99+
| `dash_spv_ffi_unconfirmed_transaction_destroy` | Destroys an FFIUnconfirmedTransaction and all its associated resources #... | types |
100100
| `dash_spv_ffi_unconfirmed_transaction_destroy_raw_tx` | Destroys the raw transaction bytes allocated for an FFIUnconfirmedTransaction... | types |
101101

102102
### Mempool Operations
@@ -113,10 +113,10 @@ Functions: 4
113113

114114
| Function | Description | Module |
115115
|----------|-------------|--------|
116-
| `ffi_dash_spv_get_core_handle` | Creates a CoreSDKHandle from an FFIDashSpvClient # Safety This function is ... | platform_integration |
117-
| `ffi_dash_spv_get_platform_activation_height` | Gets the platform activation height from the Core chain # Safety This funct... | platform_integration |
118-
| `ffi_dash_spv_get_quorum_public_key` | Gets a quorum public key from the Core chain # Safety This function is unsa... | platform_integration |
119-
| `ffi_dash_spv_release_core_handle` | Releases a CoreSDKHandle # Safety This function is unsafe because: - The ca... | platform_integration |
116+
| `ffi_dash_spv_get_core_handle` | Creates a CoreSDKHandle from an FFIDashSpvClient # Safety This function is... | platform_integration |
117+
| `ffi_dash_spv_get_platform_activation_height` | Gets the platform activation height from the Core chain # Safety This... | platform_integration |
118+
| `ffi_dash_spv_get_quorum_public_key` | Gets a quorum public key from the Core chain # Safety This function is... | platform_integration |
119+
| `ffi_dash_spv_release_core_handle` | Releases a CoreSDKHandle # Safety This function is unsafe because: - The... | platform_integration |
120120

121121
### Event Callbacks
122122

@@ -151,7 +151,7 @@ Functions: 19
151151
| `dash_spv_ffi_client_get_stats` | Get current runtime statistics for the SPV client | client |
152152
| `dash_spv_ffi_client_get_tip_hash` | Get the current chain tip hash (32 bytes) if available | client |
153153
| `dash_spv_ffi_client_get_tip_height` | Get the current chain tip height (absolute) | client |
154-
| `dash_spv_ffi_client_get_wallet_manager` | Get the wallet manager from the SPV client Returns a pointer to an `FFIWalle... | client |
154+
| `dash_spv_ffi_client_get_wallet_manager` | Get the wallet manager from the SPV client Returns a pointer to an... | client |
155155
| `dash_spv_ffi_client_record_send` | Record that we attempted to send a transaction by its txid | client |
156156
| `dash_spv_ffi_client_rescan_blockchain` | Request a rescan of the blockchain from a given height (not yet implemented) | client |
157157
| `dash_spv_ffi_enable_test_mode` | No description | utils |

dash-spv-ffi/scripts/check_ffi_docs.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

dash-spv-ffi/scripts/generate_ffi_docs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
215215
desc = func.doc_comment.split('.')[0] if func.doc_comment else "No description"
216216
desc = desc.replace('|', '\\|') # Escape pipes in description
217217
if len(desc) > 80:
218-
desc = desc[:77] + "..."
218+
# Truncate at last complete word before 77 chars to avoid mid-word breaks
219+
truncate_pos = desc.rfind(' ', 0, 77)
220+
if truncate_pos > 60: # Only if we find a space reasonably close
221+
desc = desc[:truncate_pos] + "..."
222+
else:
223+
desc = desc[:77] + "..."
219224
md.append(f"| `{func.name}` | {desc} | {func.module} |")
220225

221226
md.append("")

0 commit comments

Comments
 (0)