use toast_api::deepseek::{DeepSeekPOW, PowChallenge};
use serde_json::json;
#[test]
fn test_wasm_compatibility() {
let challenge_json = json!({
"algorithm": "sha3_256",
"challenge": "abc123",
"salt": "salt123",
"difficulty": 0.25, "expire_at": 1735689600_u64,
"signature": "sig123",
"target_path": "/api/v0/chat/completion"
});
let challenge: PowChallenge = serde_json::from_value(challenge_json).unwrap();
let pow_solver = DeepSeekPOW::new().unwrap();
let result1 = pow_solver.solve_challenge(&challenge);
let result2 = pow_solver.solve_challenge(&challenge);
assert!(result1.is_ok(), "First solve attempt failed: {:?}", result1.err());
assert!(result2.is_ok(), "Second solve attempt failed: {:?}", result2.err());
assert_eq!(result1.unwrap(), result2.unwrap(), "Results should be deterministic");
println!("WASM compatibility test passed!");
}