macro_rules! try_construct_did {
    ($public:expr, $network:expr) => { ... };
    ($public:expr) => { ... };
}
Expand description

Creates a new IOTA DID from a public key and optional network.

Errors

Errors if the IotaDID is invalid.

Example

let did = try_construct_did!(b"public-key")?;
assert_eq!(did.as_str(), "did:iota:2xQiiGHDq5gCi1H7utY1ni7cf65fTay3G11S4xKp1vkS");

let did = try_construct_did!(b"public-key", "com")?;
assert_eq!(
  did.as_str(),
  "did:iota:com:2xQiiGHDq5gCi1H7utY1ni7cf65fTay3G11S4xKp1vkS"
);