Use Did in a bunch more places

Instead of showing just public keys we need to show the fully qualified
spec for a NID which is prefixed by `did🔑` While we want to maintain
`Author` and `ActorId` for internal use.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-02-16 18:01:42 +01:00
committed by Alexis Sellier
parent 7e9b9c944b
commit 3cf1accddd
3 changed files with 16 additions and 22 deletions
+2 -10
View File
@@ -9,8 +9,7 @@ use serde_json::{json, Value};
use radicle::cob::issue::{Issue, IssueId};
use radicle::cob::patch::{Patch, PatchId};
use radicle::cob::thread::{self, CommentId};
use radicle::cob::{OpId, Timestamp};
use radicle::identity::PublicKey;
use radicle::cob::{Author, OpId, Timestamp};
use radicle_surf::blob::Blob;
use radicle_surf::tree::Tree;
use radicle_surf::{Commit, Stats};
@@ -130,11 +129,6 @@ fn name_in_path(path: &str) -> &str {
}
}
#[derive(Serialize)]
struct Author {
id: PublicKey,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct Comment {
@@ -156,9 +150,7 @@ impl<'a> FromIterator<(&'a CommentId, &'a thread::Comment)> for Comments {
for (id, comment) in iter {
comments.push(Comment {
id: id.to_owned(),
author: Author {
id: comment.author(),
},
author: comment.author().into(),
body: comment.body().to_owned(),
reactions: [],
timestamp: comment.timestamp(),