Skip to content

Commit

Permalink
fix can_validate_domain test
Browse files Browse the repository at this point in the history
  • Loading branch information
wulfraem committed Nov 21, 2024
1 parent 16bb6c6 commit ba2a99a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bindings/grpc/tests/api/domain_linkage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}]
}),
Expand Down

0 comments on commit ba2a99a

Please sign in to comment.