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

Rename document1 to did1 in README example. #400

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,21 @@ use identity::iota::IotaDocument;
async fn main() -> Result<()> {
pretty_env_logger::init();

// The Stronghold settings for the storage
// The Stronghold settings for the storage.
let snapshot: PathBuf = "./example-strong.hodl".into();
let password: String = "my-password".into();

// Create a new Account with Stronghold as the storage adapter
// Create a new Account with Stronghold as the storage adapter.
let account: Account = Account::builder()
.storage(AccountStorage::Stronghold(snapshot, Some(password)))
.build()
.await?;

// Create a new Identity with default settings
// Create a new Identity with default settings.
let snapshot1: IdentitySnapshot = account.create_identity(IdentityCreate::default()).await?;
cycraig marked this conversation as resolved.
Show resolved Hide resolved

// Retrieve the DID from the newly created Identity state.
let document1: &IotaDID = snapshot1.identity().try_did()?;
let did1: &IotaDID = snapshot1.identity().try_did()?;
cycraig marked this conversation as resolved.
Show resolved Hide resolved

println!("[Example] Local Snapshot = {:#?}", snapshot1);
cycraig marked this conversation as resolved.
Show resolved Hide resolved
println!("[Example] Local Document = {:#?}", snapshot1.identity().to_document()?);
cycraig marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -124,7 +124,7 @@ async fn main() -> Result<()> {
// Fetch the DID Document from the Tangle
//
// This is an optional step to ensure DID Document consistency.
let resolved: IotaDocument = account.resolve_identity(document1).await?;
let resolved: IotaDocument = account.resolve_identity(did1).await?;
cycraig marked this conversation as resolved.
Show resolved Hide resolved

println!("[Example] Tangle Document = {:#?}", resolved);

Expand Down