Skip to content

Commit 490cff2

Browse files
committed
Fix trailing-whitespace checks
1 parent 7486e37 commit 490cff2

File tree

94 files changed

+2190
-2190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2190
-2190
lines changed

contrib/test-rpc.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,57 +23,57 @@ fi
2323
# Integration test.
2424
if [ -n "$DASHVERSION" ]; then
2525
ASSET="dashcore-$DASHVERSION-x86_64-linux-gnu.tar.gz"
26-
26+
2727
# Download the Dash binary
2828
echo "Downloading $ASSET..."
2929
if ! wget "https://github.com/dashpay/dash/releases/download/v$DASHVERSION/$ASSET"; then
3030
echo "Error: Failed to download $ASSET" >&2
3131
exit 1
3232
fi
33-
33+
3434
# Verify the downloaded file exists
3535
if [ ! -f "$ASSET" ]; then
3636
echo "Error: Downloaded file $ASSET not found" >&2
3737
exit 1
3838
fi
39-
39+
4040
# Extract and determine the actual extracted directory
4141
echo "Extracting $ASSET..."
4242
if ! tar -xzvf "$ASSET"; then
4343
echo "Error: Failed to extract $ASSET" >&2
4444
exit 1
4545
fi
46-
46+
4747
# Find the extracted directory (should be dashcore-$DASHVERSION)
4848
EXTRACT_DIR="dashcore-$DASHVERSION"
4949
if [ ! -d "$EXTRACT_DIR" ]; then
5050
echo "Error: Expected directory $EXTRACT_DIR not found after extraction" >&2
5151
exit 1
5252
fi
53-
53+
5454
# Add the bin directory to PATH (avoid SC2155)
5555
DASH_BIN_PATH="$(pwd)/$EXTRACT_DIR/bin"
5656
PATH="$PATH:$DASH_BIN_PATH"
5757
export PATH
58-
58+
5959
echo "Added $DASH_BIN_PATH to PATH"
60-
60+
6161
# Change to the correct integration test directory
6262
if [ -d "rpc-integration-test" ]; then
6363
cd rpc-integration-test
6464
else
6565
echo "Error: rpc-integration-test directory not found" >&2
6666
exit 1
6767
fi
68-
68+
6969
# Run the integration tests
7070
if [ -f "./run.sh" ]; then
7171
./run.sh
7272
else
7373
echo "Error: run.sh script not found in rpc-integration-test" >&2
7474
exit 1
7575
fi
76-
76+
7777
exit 0
7878
else
7979
# Regular build/unit test.

dash-spv-ffi/examples/basic_usage.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ int main() {
88
fprintf(stderr, "Failed to initialize logging\n");
99
return 1;
1010
}
11-
11+
1212
// Create a configuration for testnet
1313
FFIClientConfig* config = dash_spv_ffi_config_testnet();
1414
if (config == NULL) {
1515
fprintf(stderr, "Failed to create config\n");
1616
return 1;
1717
}
18-
18+
1919
// Set data directory
2020
if (dash_spv_ffi_config_set_data_dir(config, "/tmp/dash-spv-test") != 0) {
2121
fprintf(stderr, "Failed to set data dir\n");
2222
dash_spv_ffi_config_destroy(config);
2323
return 1;
2424
}
25-
25+
2626
// Create the client
2727
FFIDashSpvClient* client = dash_spv_ffi_client_new(config);
2828
if (client == NULL) {
@@ -31,12 +31,12 @@ int main() {
3131
dash_spv_ffi_config_destroy(config);
3232
return 1;
3333
}
34-
34+
3535
printf("Successfully created Dash SPV client!\n");
36-
36+
3737
// Clean up
3838
dash_spv_ffi_client_destroy(client);
3939
dash_spv_ffi_config_destroy(config);
40-
40+
4141
return 0;
4242
}

dash-spv-ffi/scripts/generate_ffi_docs.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def categorize_functions(functions: List[FFIFunction]) -> Dict[str, List[FFIFunc
138138
'Error Handling': [],
139139
'Utility Functions': [],
140140
}
141-
141+
142142
for func in functions:
143143
name = func.name.lower()
144-
144+
145145
if 'client_new' in name or 'client_start' in name or 'client_stop' in name or 'client_destroy' in name:
146146
categories['Client Management'].append(func)
147147
elif 'config' in name:
@@ -166,15 +166,15 @@ def categorize_functions(functions: List[FFIFunction]) -> Dict[str, List[FFIFunc
166166
categories['Error Handling'].append(func)
167167
else:
168168
categories['Utility Functions'].append(func)
169-
169+
170170
# Remove empty categories
171171
return {k: v for k, v in categories.items() if v}
172172

173173
def generate_markdown(functions: List[FFIFunction]) -> str:
174174
"""Generate markdown documentation from FFI functions."""
175-
175+
176176
categories = categorize_functions(functions)
177-
177+
178178
md = []
179179
md.append("# Dash SPV FFI API Documentation")
180180
md.append("")
@@ -184,76 +184,76 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
184184
md.append("")
185185
md.append(f"**Total Functions**: {len(functions)}")
186186
md.append("")
187-
187+
188188
# Table of Contents
189189
md.append("## Table of Contents")
190190
md.append("")
191191
for category in categories.keys():
192192
anchor = category.lower().replace(' ', '-').replace('&', 'and')
193193
md.append(f"- [{category}](#{anchor})")
194194
md.append("")
195-
195+
196196
# Function Reference
197197
md.append("## Function Reference")
198198
md.append("")
199-
199+
200200
for category, funcs in categories.items():
201201
if not funcs:
202202
continue
203-
203+
204204
anchor = category.lower().replace(' ', '-').replace('&', 'and')
205205
md.append(f"### {category}")
206206
md.append("")
207207
md.append(f"Functions: {len(funcs)}")
208208
md.append("")
209-
209+
210210
# Create a table for each category
211211
md.append("| Function | Description | Module |")
212212
md.append("|----------|-------------|--------|")
213-
213+
214214
for func in sorted(funcs, key=lambda f: f.name):
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:
218218
desc = desc[:77] + "..."
219219
md.append(f"| `{func.name}` | {desc} | {func.module} |")
220-
220+
221221
md.append("")
222-
222+
223223
# Detailed Function Documentation
224224
md.append("## Detailed Function Documentation")
225225
md.append("")
226-
226+
227227
for category, funcs in categories.items():
228228
if not funcs:
229229
continue
230-
230+
231231
md.append(f"### {category} - Detailed")
232232
md.append("")
233-
233+
234234
for func in sorted(funcs, key=lambda f: f.name):
235235
md.append(f"#### `{func.name}`")
236236
md.append("")
237237
md.append("```c")
238238
md.append(func.signature)
239239
md.append("```")
240240
md.append("")
241-
241+
242242
if func.doc_comment:
243243
md.append("**Description:**")
244244
md.append(func.doc_comment)
245245
md.append("")
246-
246+
247247
if func.safety_comment:
248248
md.append("**Safety:**")
249249
md.append(func.safety_comment)
250250
md.append("")
251-
251+
252252
md.append(f"**Module:** `{func.module}`")
253253
md.append("")
254254
md.append("---")
255255
md.append("")
256-
256+
257257
# Type Definitions
258258
md.append("## Type Definitions")
259259
md.append("")
@@ -269,15 +269,15 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
269269
md.append("- `FFIEventCallbacks` - Event callback structure")
270270
md.append("- `CoreSDKHandle` - Platform SDK integration handle")
271271
md.append("")
272-
272+
273273
md.append("### Enumerations")
274274
md.append("")
275275
md.append("- `FFINetwork` - Network type (Dash, Testnet, Regtest, Devnet)")
276276
md.append("- `FFIValidationMode` - Validation mode (None, Basic, Full)")
277277
md.append("- `FFIMempoolStrategy` - Mempool strategy (FetchAll, BloomFilter, Selective)")
278278
md.append("- `FFISyncStage` - Synchronization stage")
279279
md.append("")
280-
280+
281281
# Memory Management
282282
md.append("## Memory Management")
283283
md.append("")
@@ -292,7 +292,7 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
292292
"that must be released with `dash_spv_ffi_wallet_manager_free()`"
293293
)
294294
md.append("")
295-
295+
296296
# Usage Examples
297297
md.append("## Usage Examples")
298298
md.append("")
@@ -323,7 +323,7 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
323323
md.append("dash_spv_ffi_config_destroy(config);")
324324
md.append("```")
325325
md.append("")
326-
326+
327327
md.append("### Event Callbacks")
328328
md.append("")
329329
md.append("```c")
@@ -347,30 +347,30 @@ def generate_markdown(functions: List[FFIFunction]) -> str:
347347
md.append("dash_spv_ffi_client_set_event_callbacks(client, callbacks);")
348348
md.append("```")
349349
md.append("")
350-
350+
351351
return '\n'.join(md)
352352

353353
def main():
354354
# Find all Rust source files
355355
src_dir = Path(__file__).parent.parent / "src"
356-
356+
357357
all_functions = []
358-
358+
359359
for rust_file in src_dir.rglob("*.rs"):
360360
functions = extract_ffi_functions(rust_file)
361361
all_functions.extend(functions)
362-
362+
363363
# Generate markdown
364364
markdown = generate_markdown(all_functions)
365-
365+
366366
# Write to file
367367
output_file = Path(__file__).parent.parent / "FFI_API.md"
368368
with open(output_file, 'w') as f:
369369
f.write(markdown)
370-
370+
371371
print(f"Generated FFI documentation with {len(all_functions)} functions")
372372
print(f"Output: {output_file}")
373-
373+
374374
return 0
375375

376376
if __name__ == "__main__":

dash-spv-ffi/src/callbacks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl FFIEventCallbacks {
247247
is_instant_send: bool,
248248
) {
249249
if let Some(callback) = self.on_mempool_transaction_added {
250-
tracing::info!("🎯 Calling mempool transaction added callback: txid={}, amount={}, is_instant_send={}",
250+
tracing::info!("🎯 Calling mempool transaction added callback: txid={}, amount={}, is_instant_send={}",
251251
txid, amount, is_instant_send);
252252
let txid_bytes = txid.as_byte_array();
253253
let addresses_str = addresses.join(",");

0 commit comments

Comments
 (0)