@@ -103,7 +103,7 @@ impl PoWConfig {
103103/// ```
104104/// use ironshield_core::{
105105/// IronShieldChallenge,
106- /// find_solution_multi_threaded ,
106+ /// find_solution ,
107107/// SigningKey
108108/// };
109109///
@@ -117,7 +117,7 @@ impl PoWConfig {
117117/// );
118118///
119119/// // JavaScript worker coordination mode
120- /// let response = find_solution_multi_threaded (&challenge, None, Some(0), Some(8), None)?;
120+ /// let response = find_solution (&challenge, None, Some(0), Some(8), None)?;
121121/// println!("Found solution: {}", response.solution);
122122/// # Ok(())
123123/// # }
@@ -285,41 +285,6 @@ mod tests {
285285 }
286286 }
287287
288- #[ test]
289- fn test_find_solution_single_threaded_easy ( ) {
290- // Create a challenge with very high threshold (easy to solve).
291- let dummy_key = SigningKey :: from_bytes ( & [ 0u8 ; 32 ] ) ;
292- let challenge = IronShieldChallenge :: new (
293- "test_website" . to_string ( ) ,
294- 1 , // Easiest difficulty.
295- dummy_key,
296- [ 0x00 ; 32 ] ,
297- ) ;
298-
299- let result = find_solution_single_threaded ( & challenge, None ) ;
300- assert ! ( result. is_ok( ) , "Should find solution for easy challenge" ) ;
301-
302- let response = result. unwrap ( ) ;
303- assert_eq ! ( response. solved_challenge. challenge_signature, challenge. challenge_signature) ;
304- assert ! ( response. solution >= 0 , "Solution should be non-negative" ) ;
305- }
306-
307- #[ test]
308- fn test_find_solution_single_threaded_custom_config ( ) {
309- // Test with custom configuration.
310- let dummy_key = SigningKey :: from_bytes ( & [ 0u8 ; 32 ] ) ;
311- let challenge = IronShieldChallenge :: new (
312- "test_website" . to_string ( ) ,
313- 1 , // Easiest difficulty.
314- dummy_key,
315- [ 0x00 ; 32 ] ,
316- ) ;
317-
318- let config = PoWConfig :: custom ( 10_000 , 1_000 ) ;
319- let result = find_solution_single_threaded ( & challenge, Some ( config) ) ;
320- assert ! ( result. is_ok( ) , "Should find solution with custom config" ) ;
321- }
322-
323288
324289 #[ test]
325290 fn test_performance_optimization_correctness ( ) {
@@ -361,7 +326,7 @@ mod tests {
361326 [ 0x00 ; 32 ] ,
362327 ) ;
363328
364- let result = find_solution_multi_threaded ( & challenge, None , None , None , None ) ;
329+ let result = find_solution ( & challenge, None , None , None , None ) ;
365330 assert ! ( result. is_ok( ) , "Should find solution for easy challenge" ) ;
366331
367332 let response = result. unwrap ( ) ;
@@ -373,40 +338,6 @@ mod tests {
373338 "Multi-threaded solution should pass verification" ) ;
374339 }
375340
376- #[ test]
377- #[ cfg( all( feature = "parallel" , not( feature = "no-parallel" ) ) ) ]
378- fn test_find_solution_multi_threaded_vs_single_threaded ( ) {
379- // Test that multithreaded and single-threaded versions find valid solutions
380- // for the same challenge (solutions may differ due to search order).
381- let dummy_key = SigningKey :: from_bytes ( & [ 0u8 ; 32 ] ) ;
382- let challenge = IronShieldChallenge :: new (
383- "test_website" . to_string ( ) ,
384- 1000 , // Medium difficulty.
385- dummy_key,
386- [ 0x00 ; 32 ] ,
387- ) ;
388-
389- // Solve with single-threaded version.
390- let single_result = find_solution_single_threaded ( & challenge, None ) ;
391- assert ! ( single_result. is_ok( ) , "Single-threaded should find solution" ) ;
392-
393- // Solve with multithreaded version.
394- let multi_result = find_solution_multi_threaded ( & challenge, None , None , None , None ) ;
395- assert ! ( multi_result. is_ok( ) , "Multi-threaded should find solution" ) ;
396-
397- let single_response = single_result. unwrap ( ) ;
398- let multi_response = multi_result. unwrap ( ) ;
399-
400- // Both solutions should be valid (but may be different nonces).
401- assert ! ( crate :: verify:: verify_ironshield_solution( & single_response) ,
402- "Single-threaded solution should be valid" ) ;
403- assert ! ( crate :: verify:: verify_ironshield_solution( & multi_response) ,
404- "Multi-threaded solution should be valid" ) ;
405-
406- // Both should have the same challenge signature.
407- assert_eq ! ( single_response. solved_challenge. challenge_signature, multi_response. solved_challenge. challenge_signature) ;
408- }
409-
410341 #[ test]
411342 #[ cfg( all( feature = "parallel" , not( feature = "no-parallel" ) ) ) ]
412343 fn test_find_solution_multi_threaded_deterministic_correctness ( ) {
@@ -421,7 +352,7 @@ mod tests {
421352 ) ;
422353
423354 // Should find a solution relatively quickly with 50% probability per attempt.
424- let result = find_solution_multi_threaded ( & challenge, None , None , None , None ) ;
355+ let result = find_solution ( & challenge, None , None , None , None ) ;
425356 assert ! ( result. is_ok( ) , "Should find solution for medium difficulty challenge" ) ;
426357
427358 let response = result. unwrap ( ) ;
0 commit comments