Skip to content

Commit

Permalink
refactor: reorganize examples directory and update imports
Browse files Browse the repository at this point in the history
fix: update path for identity_sui_name_tbd in examples/Cargo.toml

feat: add linked verifiable presentation example and update dependencies
  • Loading branch information
itsyaasir authored and wulfraem committed Nov 20, 2024
1 parent 8d30555 commit 02fd855
Show file tree
Hide file tree
Showing 42 changed files with 1,014 additions and 3,175 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ members = [
"identity_jose",
"identity_eddsa_verifier",
"identity_sui_name_tbd",
"examples/iota",
"examples/kinesis",
"examples",
]

exclude = ["bindings/wasm", "bindings/grpc"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;

use examples_kinesis::get_memstorage;
use examples::get_memstorage;

/// Demonstrates how to create a DID Document and publish it on chain.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2020-2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_memstorage;
use examples_kinesis::TEST_GAS_BUDGET;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_memstorage;
use examples::TEST_GAS_BUDGET;
use identity_iota::core::json;
use identity_iota::core::FromJson;
use identity_iota::core::Timestamp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;

use examples_kinesis::get_memstorage;
use examples::get_memstorage;
use identity_iota::iota::IotaDocument;
use identity_iota::prelude::Resolver;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2020-2023 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_memstorage;
use examples_kinesis::TEST_GAS_BUDGET;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_memstorage;
use examples::TEST_GAS_BUDGET;
use identity_iota::iota::IotaDID;
use identity_iota::iota::IotaDocument;

Expand All @@ -14,8 +14,12 @@ async fn main() -> anyhow::Result<()> {
// create new client to interact with chain and get funded account with keys
let storage = get_memstorage()?;
let identity_client = get_client_and_create_account(&storage).await?;

// create new DID document and publish it
let (document, _) = create_kinesis_did_document(&identity_client, &storage).await?;

println!("Published DID document: {document:#}");

let did: IotaDID = document.id().clone();

// Deactivate the DID by publishing an empty document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
//!
//! cargo run --release --example 5_create_vc

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_memstorage;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_memstorage;
use identity_eddsa_verifier::EdDSAJwsVerifier;
use identity_iota::core::Object;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

use std::collections::HashMap;

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_memstorage;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_memstorage;
use identity_eddsa_verifier::EdDSAJwsVerifier;
use identity_iota::core::Object;
use identity_iota::credential::DecodedJwtCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
//! cargo run --release --example 7_revoke_vc

use anyhow::anyhow;
use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_memstorage;
use examples_kinesis::TEST_GAS_BUDGET;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_memstorage;
use examples::TEST_GAS_BUDGET;
use identity_eddsa_verifier::EdDSAJwsVerifier;
use identity_iota::core::json;
use identity_iota::core::FromJson;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use examples_kinesis::create_kinesis_did_document;
use examples_kinesis::get_client_and_create_account;
use examples_kinesis::get_stronghold_storage;
use examples_kinesis::random_stronghold_path;
use examples::create_kinesis_did_document;
use examples::get_client_and_create_account;
use examples::get_stronghold_storage;
use examples::random_stronghold_path;
use identity_eddsa_verifier::EdDSAJwsVerifier;
use identity_iota::credential::Jws;
use identity_iota::document::verifiable::JwsVerificationOptions;
Expand Down
Loading

0 comments on commit 02fd855

Please sign in to comment.