Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
Signed-off-by: George Mulhearn <[email protected]>
  • Loading branch information
gmulhearn-anonyome committed Jun 21, 2024
1 parent 9866a2a commit 7ad8670
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ mod tests {
);

let mut did_document = DidDocument::new(Did::parse(did_full.clone()).unwrap());
did_document.add_key_agreement_object(vm_0);
did_document.add_key_agreement_ref(vm_0.id().to_owned());
did_document.add_verification_method(vm_0);
did_document.add_authentication_ref(vm_1.id().to_owned());
did_document.add_verification_method(vm_1);

let did = append_encoded_key_segments(did.to_string(), &did_document).unwrap();
Expand Down Expand Up @@ -269,7 +271,7 @@ mod tests {
let mut did_document = DidDocument::new(did_full.parse().unwrap());
did_document.add_assertion_method_object(vm_0);
did_document.add_key_agreement_object(vm_1);
did_document.add_verification_method(vm_2);
did_document.add_authentication_object(vm_2);

let did = append_encoded_key_segments(did.to_string(), &did_document).unwrap();
assert_eq!(did, did_full);
Expand All @@ -294,6 +296,7 @@ mod tests {

let mut did_document = DidDocument::new(did_full.parse().unwrap());
did_document.add_verification_method(vm);
did_document.add_authentication_ref(DidUrl::from_fragment(reference.to_string()).unwrap());
did_document.add_key_agreement_ref(DidUrl::from_fragment(reference.to_string()).unwrap());

let did = append_encoded_key_segments(did.to_string(), &did_document).unwrap();
Expand Down
22 changes: 10 additions & 12 deletions did_core/did_methods/did_peer/tests/fixtures/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,27 @@ pub static DID_DOC_BASIC: &str = r##"
"alsoKnownAs": ["did:peer:3zQmaTbkb2T8CbKPzXSCgsdWHxgX3qvjmpmTQwfATu3crFCv"],
"verificationMethod": [
{
"id": "#6MkqRYqQ",
"id": "#key-1",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkiXSwiYSI6WyJkaWRjb21tL3YyIiwiZGlkY29tbS9haXAyO2Vudj1yZmM1ODciXX0",
"publicKeyBase58": "JhNWeSVLMYccCk7iopQW4guaSJTojqpMEELgSLhKwRr"
},
{
"id": "#key-2",
"type": "Ed25519VerificationKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkiXSwiYSI6WyJkaWRjb21tL3YyIiwiZGlkY29tbS9haXAyO2Vudj1yZmM1ODciXX0",
"publicKeyBase58": "ByHnpUCFb1vAfh9CFZ8ZkmUZguURW8nSw889hy6rD8L7"
},
{
"id": "#6MkgoLTn",
"id": "#key-3",
"type": "Ed25519VerificationKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkiXSwiYSI6WyJkaWRjb21tL3YyIiwiZGlkY29tbS9haXAyO2Vudj1yZmM1ODciXX0",
"publicKeyBase58": "3M5RCDjPTWPkKSN3sxUmmMqHbmRPegYP1tjcKyrDbt9J"
}
],
"authentication": [],
"authentication": ["#key-2", "#key-3"],
"assertionMethod": [],
"keyAgreement": [
{
"id": "#6LSbysY2",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkiXSwiYSI6WyJkaWRjb21tL3YyIiwiZGlkY29tbS9haXAyO2Vudj1yZmM1ODciXX0",
"publicKeyBase58": "JhNWeSVLMYccCk7iopQW4guaSJTojqpMEELgSLhKwRr"
}
],
"keyAgreement": ["#key-1"],
"capabilityInvocation": [],
"capabilityDelegation": [],
"service": [
Expand Down
21 changes: 10 additions & 11 deletions did_core/did_methods/did_peer/tests/fixtures/no_routing_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,27 @@ pub static DID_DOC_NO_ROUTING_KEYS: &str = r##"
"alsoKnownAs": ["did:peer:3zQmVKBM36ZvoTCEecoNWAmLvDcePbksQ2Ag2pxyGa24eUp8"],
"verificationMethod": [
{
"id": "#6MkqRYqQ",
"id": "#key-1",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9",
"publicKeyMultibase": "z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc"
},
{
"id": "#key-2",
"type": "Ed25519VerificationKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9",
"publicKeyMultibase": "z6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V"
},
{
"id": "#6MkgoLTn",
"id": "#key-3",
"type": "Ed25519VerificationKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9",
"publicKeyMultibase": "z6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg"
}
],
"authentication": [],
"authentication": ["#key-2", "#key-3"],
"assertionMethod": [],
"keyAgreement": [
{
"id": "#6LSbysY2",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.Vz6MkgoLTnTypo3tDRwCkZXSccTPHRLhF4ZnjhueYAFpEX6vg.SeyJpZCI6IiNzZXJ2aWNlLTAiLCJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludCJ9",
"publicKeyMultibase": "z6LSbysY2xFMRpGMhb7tFTLMpeuPRaqaWM1yECx2AtzE3KCc"
}
],
"keyAgreement": ["#key-1"],
"capabilityInvocation": [],
"capabilityDelegation": [],
"service": [
Expand Down
19 changes: 9 additions & 10 deletions did_core/did_methods/did_peer/tests/fixtures/no_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ pub static DID_DOC_NO_SERVICES: &str = r##"
"alsoKnownAs": ["did:peer:3zQmdysQimott3jS93beGPVX8sTRSRFJWt1FsihPcSy9kZfB"],
"verificationMethod": [
{
"id": "#6MkqRYqQ",
"id": "#key-1",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V",
"publicKeyMultibase": "z6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud"
},
{
"id": "#key-2",
"type": "Ed25519VerificationKey2020",
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V",
"publicKeyMultibase": "z6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V"
}
],
"authentication": [],
"authentication": ["#key-2"],
"assertionMethod": [],
"keyAgreement": [
{
"id": "#6LSpSrLx",
"type": "X25519KeyAgreementKey2020",
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V",
"publicKeyMultibase": "z6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud"
}
],
"keyAgreement": ["#key-1"],
"capabilityInvocation": [],
"capabilityDelegation": []
}
Expand Down

0 comments on commit 7ad8670

Please sign in to comment.