Skip to content

Commit

Permalink
Merge pull request #31 from evannetwork/feature/add-published-verific…
Browse files Browse the repository at this point in the history
…ation

add verification of published flag and update default url
  • Loading branch information
S3bb1 authored Aug 22, 2023
2 parents 126b00e + e8ebba4 commit 004580e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Fixes

- Add verification of "published" flag when creating a did

### Deprecations

Expand Down
21 changes: 12 additions & 9 deletions src/vade_sidetree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use std::error::Error;
use std::os::raw::c_void;
use vade::{VadePlugin, VadePluginResultValue};

const DEFAULT_URL: &str = "https://sidetree.evan.network/3.0/";
const DEFAULT_URL: &str = "https://sidetree.equs.qa-idm.bc-labs.dev/3.0/";
const EVAN_METHOD: &str = "did:evan";
const METHOD_REGEX: &str = r#"^(.*):0x(.*)$"#;
const DID_SIDETREE: &str = "sidetree";
Expand Down Expand Up @@ -234,16 +234,19 @@ impl VadePlugin for VadeSidetree {
)
.await?;
if res != "Not Found" {
update_found = true;
} else {
task::sleep(time::Duration::from_millis(1_000)).await;
timeout_counter += 1;
if timeout_counter == 120 {
return Ok(VadePluginResultValue::Success(Some(
"Error waiting for DID create".to_string(),
)));
let did_doc: SidetreeDidDocument = serde_json::from_str(&res)?;
if did_doc.did_document_metadata.method.published == true {
update_found = true;
break;
}
}
task::sleep(time::Duration::from_millis(1_000)).await;
timeout_counter += 1;
if timeout_counter == 120 {
return Ok(VadePluginResultValue::Success(Some(
"Error waiting for DID create".to_string(),
)));
}
}
}

Expand Down

0 comments on commit 004580e

Please sign in to comment.