mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 18:40:39 +08:00
radicle: return verified doc
The `identity_doc_at` and `identity_doc` methods on `ReadRepository` returned the unverified identity document. Every usage of these methods would always verify the document after. Simplify the code by calling verified in the methods and directly return the verified identity document. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -55,6 +55,7 @@ impl Context {
|
||||
let repo = storage.repository(id)?;
|
||||
let (_, head) = repo.head()?;
|
||||
let DocAt { doc, .. } = repo.identity_doc()?;
|
||||
|
||||
let payload = doc.project()?;
|
||||
let delegates = doc.delegates;
|
||||
let issues = issue::Issues::open(&repo)?.counts()?;
|
||||
|
||||
@@ -90,6 +90,7 @@ async fn project_root_handler(
|
||||
let Ok(repo) = storage.repository(id) else { return None };
|
||||
let Ok((_, head)) = repo.head() else { return None };
|
||||
let Ok(DocAt { doc, .. }) = repo.identity_doc() else { return None };
|
||||
|
||||
let Ok(payload) = doc.project() else { return None };
|
||||
let Ok(issues) = issue::Issues::open(&repo) else { return None };
|
||||
let Ok(issues) = issues.counts() else { return None };
|
||||
|
||||
@@ -62,6 +62,8 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(finto): we should turn `git::RefString` to `git::Qualified`,
|
||||
// since all these refs SHOULD be `Qualified`.
|
||||
/// The published state of a local repository.
|
||||
#[derive(Default, Clone, Debug, PartialEq, Eq, Serialize)]
|
||||
pub struct Refs(BTreeMap<git::RefString, Oid>);
|
||||
|
||||
Reference in New Issue
Block a user