diff --git a/bindings/grpc/tests/api/domain_linkage.rs b/bindings/grpc/tests/api/domain_linkage.rs index 05819710d..96b7b933a 100644 --- a/bindings/grpc/tests/api/domain_linkage.rs +++ b/bindings/grpc/tests/api/domain_linkage.rs @@ -125,16 +125,25 @@ async fn can_validate_domain() -> anyhow::Result<()> { did_configuration: configuration_resource.to_string(), }) .await?; - let did_id = IotaDocument::from_json(&did)?.id().to_string(); + + // created and updated are retrieved directly from the contract and not from the given DID document, + // so we'll replace them with values from the result for the check here + let validated_did_response = response.into_inner(); + let mut did_document: IotaDocument = IotaDocument::from_json(&did)?; + let did_id = did_document.id().to_string(); + let response_did_document: IotaDocument = + serde_json::from_str(&validated_did_response.linked_dids.as_ref().unwrap().valid[0].did).unwrap(); + did_document.metadata.created = response_did_document.metadata.created; + did_document.metadata.updated = response_did_document.metadata.updated; assert_eq!( - response.into_inner(), + validated_did_response, ValidateDomainResponse { linked_dids: Some(LinkedDids { invalid: vec![], valid: vec![ValidDid { service_id: did_id, - did: did.to_string().clone(), + did: did_document.to_string().clone(), credential: jwt.as_str().to_string(), }] }),