From 92a14b671f5c4ed99618dd38f8bf60bb6987660a Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Wed, 19 Apr 2023 11:31:09 +0100 Subject: [PATCH] cli: use Doc::canonical in rad inspect A project may exist within storage without the local operator not having a fork of the project. Use Doc::canonical in rad inspect to retrieve the canonical identity document for use during inspection. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-cli/src/commands/inspect.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicle-cli/src/commands/inspect.rs b/radicle-cli/src/commands/inspect.rs index c53fe811..df564454 100644 --- a/radicle-cli/src/commands/inspect.rs +++ b/radicle-cli/src/commands/inspect.rs @@ -8,7 +8,7 @@ use anyhow::{anyhow, Context as _}; use chrono::prelude::*; use json_color::{Color, Colorizer}; -use radicle::crypto::Unverified; +use radicle::crypto::{Unverified, Verified}; use radicle::identity::Untrusted; use radicle::identity::{Doc, Id}; use radicle::storage::{ReadRepository, ReadStorage}; @@ -120,9 +120,10 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { let profile = ctx.profile()?; let storage = &profile.storage; let signer = term::signer(&profile)?; - let project = storage - .get(signer.public_key(), id)? + let repo = storage + .repository(id) .context("No project with the given RID exists")?; + let project = Doc::::canonical(&repo)?; match options.target { Target::Refs => {