Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

[V2.0] DID fragments instead of MethodID #266

Merged
merged 24 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ members = [
"streams",
]

resolver = "2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

required because of an identity feature (Identity also needs this now)


[profile.dev]
incremental = true
4 changes: 2 additions & 2 deletions lets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tangle-client = ["iota-client/async", "futures", "iota-crypto/blake2b"]
# Enable the wasm-compatible IOTA-Tangle transport client (incompatile with `tangle-client` feature due to `iota-client/async` using `tokio`. Implies `std` feature)
tangle-client-wasm = ["iota-client/wasm", "futures"]
# Enable Iota Identity for use with Streams
did = ["identity", "serde"]
did = ["identity_iota", "serde"]
# # Enable synchronized transports using parking-lot
sync-parking-lot = ["parking_lot"]
# # Enable synchronized transports using spin
Expand All @@ -41,7 +41,7 @@ hex = {version = "0.4", default-features = false}

# Optional dependencies
futures = {version = "0.3.8", default-features = false, optional = true}
identity = {git = "https://github.com/iotaledger/identity.rs", rev = "86edaad", default-features = false, features = ["async"], optional = true}
identity_iota = {git = "https://github.com/iotaledger/identity.rs", rev = "d3920c2", default-features = false, optional = true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing that this rev already takes the new package name used for releasing to crates.io, I wonder if we couldn't actually use version = "0.6.1" instead of using the git rev. We will have to do it anyway at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didnt work due to an identity error internally when compiling :P

error[E0432]: unresolved import `identity_did::revocation`
  --> /home/brord/.cargo/registry/src/github.com-1ecc6299db9ec823/identity_iota_client-0.6.1/src/credential/credential_validator.rs:11:19
   |
11 | use identity_did::revocation::RevocationBitmap;
   |                   ^^^^^^^^^^ could not find `revocation` in `identity_did`

iota-client = {version = "1.1.1", default-features = false, optional = true}
parking_lot = {version = "0.11.2", default-features = false, optional = true}
serde = {version = "1.0", default-features = false, features = ["derive"], optional = true}
Expand Down
8 changes: 6 additions & 2 deletions lets/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ impl AppAddr {
let id_bytes = identifier.as_bytes();
// Create spongos to squeeze topic into final 8 bytes
let squeezed_topic: [u8; 8] = Spongos::<KeccakF1600>::init().sponge(base_topic);
assert_eq!(id_bytes.len(), 32, "identifier must be 32 bytes long");
addr[..32].copy_from_slice(id_bytes);
if id_bytes.len() > 32 {
let squeezed_id: [u8; 32] = Spongos::<KeccakF1600>::init().sponge(id_bytes);
addr[..32].copy_from_slice(&squeezed_id)
} else {
addr[..32].copy_from_slice(id_bytes);
}
kwek20 marked this conversation as resolved.
Show resolved Hide resolved
addr[32..].copy_from_slice(&squeezed_topic);
Self::new(addr)
}
Expand Down
282 changes: 0 additions & 282 deletions lets/src/id/did.rs

This file was deleted.

Loading