INNER CODE UNIT · Rust
js_compat_sr25519
tangle-network/blueprint · crates/auth/src/lib.rs:387
fn js_compat_sr25519() {
// Test Sr25519 compatibility with JavaScript
// See `fixtures/sign_sr25519.ts` for the original JavaScript code that generates this data.
let data = serde_json::json!({
"pub_key": "d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",
"key_type": "Sr25519",
"challenge": "0000000000000000000000000000000000000000000000000000000000000000",
"signature": "f05fa2a2074d5295a34aae0d5383792a6cc34304c9cb4f6a0c577df4b374fe7bab051bd7570415578ba2da67e056d8f89b420d2e5b82412dc0f0e02877b9e48c",
"expires_at": 0
});
let req: VerifyChallengeRequest = serde_json::from_value(data).unwrap();
let result = verify_challenge(
&req.challenge,
&req.signature,
&req.challenge_request.pub_key,
req.challenge_request.key_type,
);