Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add verification of published flag and update default url #31

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading