diff --git a/did_core/did_methods/did_peer/src/peer_did/numalgos/numalgo2/encoding.rs b/did_core/did_methods/did_peer/src/peer_did/numalgos/numalgo2/encoding.rs index 80c3a90109..7155d5e8b6 100644 --- a/did_core/did_methods/did_peer/src/peer_did/numalgos/numalgo2/encoding.rs +++ b/did_core/did_methods/did_peer/src/peer_did/numalgos/numalgo2/encoding.rs @@ -197,7 +197,7 @@ mod tests { .routing_keys(vec![ServiceKeyKind::Reference( "did:example:somemediator#somekey".parse().unwrap(), )]) - .accept(vec!["didcomm/aip2;env=rfc587".into()]) + .accept(vec!["didcomm/v2".into(), "didcomm/aip2;env=rfc587".into()]) .build(); let service = Service::new( @@ -214,17 +214,14 @@ mod tests { let did = append_encoded_service_segment(did.to_string(), &did_document).unwrap(); let did_parsed = PeerDid::::parse(did.clone()).unwrap(); - let DidResolutionOutput { did_document, .. } = - PeerDidResolver::resolve_peerdid2(&did_parsed, PublicKeyEncoding::Base58) - .await - .unwrap(); + let ddo = did_parsed.to_did_doc(PublicKeyEncoding::Base58).unwrap(); let did_expected_parsed = PeerDid::::parse(did_expected.clone()).unwrap(); let ddo_expected = did_expected_parsed .to_did_doc(PublicKeyEncoding::Base58) .unwrap(); - assert_eq!(did_document, ddo_expected); + assert_eq!(ddo, ddo_expected); assert_eq!(did, did_expected); } diff --git a/did_core/did_methods/did_peer/src/peer_did/validate.rs b/did_core/did_methods/did_peer/src/peer_did/validate.rs index 6d80c22d61..80dec914ba 100644 --- a/did_core/did_methods/did_peer/src/peer_did/validate.rs +++ b/did_core/did_methods/did_peer/src/peer_did/validate.rs @@ -6,7 +6,7 @@ use crate::error::DidPeerError; static GROUP_NUMALGO_0_AND_1: &str = r"([01](z)([1-9a-km-zA-HJ-NP-Z]{5,200}))"; static GROUP_NUMALGO_2: &str = - r"(2((.[AEVID](z)([1-9a-km-zA-HJ-NP-Z]{5,200}))+(.(S)[0-9a-zA-Z=]*)?))"; + r"(2((.[AEVID](z)([1-9a-km-zA-HJ-NP-Z]{5,200}))?(.(S)[0-9a-zA-Z=]*)?))"; static GROUP_NUMALGO_3: &str = r"(3\.[0-9a-fA-F]{64})"; pub static PEER_DID_REGEX: Lazy = Lazy::new(|| {