Skip to content

Commit

Permalink
Improve example output
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <[email protected]>
  • Loading branch information
Patrik-Stas committed Oct 31, 2023
1 parent 4b17e8b commit ba1f8f2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions did_peer/examples/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,19 @@ fn demo() -> Result<(), Box<dyn Error>> {
.add_verification_method(verification_method)
.add_service(service)
.build();
println!("diddoc: {}", ddo);
println!("Did document: \n{}", serde_json::to_string_pretty(&ddo)?);

let peer_did_2 = PeerDid::<Numalgo2>::from_did_doc(ddo.clone())?;
println!("PeerDid numalgo(2): {}", peer_did_2);
println!("as did:peer numalgo(2): {}", peer_did_2);

let peer_did_3 = PeerDid::<Numalgo3>::from_did_doc(ddo)?;
println!("PeerDid numalgo(3): {}", peer_did_3);
println!("as did:peer numalgo(3): {}", peer_did_3);

let peer_did_3_v2 = peer_did_2.to_numalgo3()?;
println!("Converted PeerDid numalgo(3): {}", peer_did_3_v2);
println!(
"as did:peer numalgo(2) converted to numalgo(3): {}",
peer_did_3_v2
);

Ok(())
}
Expand Down

0 comments on commit ba1f8f2

Please sign in to comment.