Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli: Fix `rad id show` delegate output
Merged did:key:z6MksFqX...wzpT opened 1 year ago

We were not showing the correct list of delegates, we were always showing the “current” list.

2 files changed +42 -1 db98daec cc7d0cf3
modified radicle-cli/examples/rad-id.md
@@ -122,6 +122,42 @@ date Thu, 15 Dec 2022 17:28:04 +0000

```

+
We can use `rad id show` to show the changes of an accepted update:
+

+
```
+
$ rad id show 0ca42d376bd566631083c8913cf86bec722da392
+
╭────────────────────────────────────────────────────────────────────────╮
+
│ Title    Add Bob                                                       │
+
│ Revision 0ca42d376bd566631083c8913cf86bec722da392                      │
+
│ Blob     053541ba7b90534b35dd8718e0ceaa408979b02b                      │
+
│ Author   did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi      │
+
│ State    accepted                                                      │
+
│ Quorum   yes                                                           │
+
│                                                                        │
+
│ Add Bob as a delegate                                                  │
+
├────────────────────────────────────────────────────────────────────────┤
+
│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice (you) │
+
╰────────────────────────────────────────────────────────────────────────╯
+

+
@@ -1,13 +1,14 @@
+
 {
+
   "payload": {
+
     "xyz.radicle.project": {
+
       "defaultBranch": "master",
+
       "description": "Radicle Heartwood Protocol & Stack",
+
       "name": "heartwood"
+
     }
+
   },
+
   "delegates": [
+
-    "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
+
+    "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
+
+    "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk"
+
   ],
+
-  "threshold": 1
+
+  "threshold": 2
+
 }
+
```
+

Note that once a revision is accepted, it can't be edited, redacted or otherwise
acted upon:

modified radicle-cli/src/commands/id.rs
@@ -472,7 +472,12 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
        }
        Operation::ShowRevision { revision } => {
            let revision = get(revision, &identity, &repo)?;
-
            print(revision, &current, &repo, &profile)?;
+
            let previous = revision.parent.unwrap_or(revision.id);
+
            let previous = identity
+
                .revision(&previous)
+
                .ok_or(anyhow!("revision `{previous}` not found"))?;
+

+
            print(revision, previous, &repo, &profile)?;
        }
    }
    Ok(())