Skip to content

Commit

Permalink
doc and extra docs
Browse files Browse the repository at this point in the history
Signed-off-by: gmulhearn <gmulhearn@proton.me>
  • Loading branch information
gmulhearn committed Oct 20, 2024
1 parent 410770e commit 93eff9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The repository contains Rust crates to build
- [`did_sov`](did_core/did_methods/did_resolver_sov) - https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html
- [`did_web`](did_core/did_methods/did_resolver_web) - https://w3c-ccg.github.io/did-method-web/
- [`did_key`](did_core/did_methods/did_key) - https://w3c-ccg.github.io/did-method-key/
- [`did_jwk`](did_core/did_methods/did_jwk) - https://github.com/quartzjer/did-jwk/blob/main/spec.md

# Contact
Do you have a question ❓Are you considering using our components? 🚀 We'll be excited to hear from you. 👋
Expand Down
24 changes: 19 additions & 5 deletions did_core/did_methods/did_jwk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ mod tests {
format!("did:jwk:{}", valid_encoded_jwk())
}

fn invalid_did_jwk_string() -> String {
fn invalid_did_jwk_string_wrong_method() -> String {
format!("did:sov:{}", valid_encoded_jwk())
}

fn invalid_did_jwk_string_invalid_id() -> String {
"did:jwk:somenonsense".to_string()
}

Expand Down Expand Up @@ -214,8 +218,13 @@ mod tests {
}

#[test]
fn test_deserialize_error() {
assert!(serde_json::from_str::<DidJwk>(&invalid_did_jwk_string()).is_err());
fn test_deserialize_error_wrong_method() {
assert!(serde_json::from_str::<DidJwk>(&invalid_did_jwk_string_wrong_method()).is_err());
}

#[test]
fn test_deserialize_error_invalid_id() {
assert!(serde_json::from_str::<DidJwk>(&invalid_did_jwk_string_invalid_id()).is_err());
}

#[test]
Expand All @@ -227,8 +236,13 @@ mod tests {
}

#[test]
fn test_parse_error() {
assert!(DidJwk::parse(invalid_did_jwk_string()).is_err());
fn test_parse_error_wrong_method() {
assert!(DidJwk::parse(invalid_did_jwk_string_wrong_method()).is_err());
}

#[test]
fn test_parse_error_invalid_id() {
assert!(DidJwk::parse(invalid_did_jwk_string_invalid_id()).is_err());
}

#[test]
Expand Down

0 comments on commit 93eff9e

Please sign in to comment.