diff --git a/radicle-httpd/src/api/json.rs b/radicle-httpd/src/api/json.rs index 2b1d7dbae..3fa310ccb 100644 --- a/radicle-httpd/src/api/json.rs +++ b/radicle-httpd/src/api/json.rs @@ -14,7 +14,7 @@ use radicle::cob::thread; use radicle::cob::thread::CommentId; use radicle::cob::{ActorId, Author, Reaction, Timestamp}; use radicle::git::RefString; -use radicle::node::AliasStore; +use radicle::node::{Alias, AliasStore}; use radicle::prelude::NodeId; use radicle::storage::{git, refs, ReadRepository}; use radicle_surf::blob::Blob; @@ -146,7 +146,7 @@ pub(crate) fn patch( } /// Returns JSON for an `author` and fills in `alias` when present. -fn author(author: &Author, alias: Option) -> Value { +fn author(author: &Author, alias: Option) -> Value { match alias { Some(alias) => json!({ "id": author.id, @@ -157,7 +157,7 @@ fn author(author: &Author, alias: Option) -> Value { } /// Returns JSON for a patch `Merge` and fills in `alias` when present. -fn merge(merge: &Merge, nid: &NodeId, alias: Option) -> Value { +fn merge(merge: &Merge, nid: &NodeId, alias: Option) -> Value { match alias { Some(alias) => json!({ "author": { @@ -180,7 +180,7 @@ fn merge(merge: &Merge, nid: &NodeId, alias: Option) -> Value { } /// Returns JSON for a patch `Review` and fills in `alias` when present. -fn review(nid: &NodeId, alias: Option, review: &Review) -> Value { +fn review(nid: &NodeId, alias: Option, review: &Review) -> Value { match alias { Some(alias) => json!({ "author": { diff --git a/radicle-httpd/src/test.rs b/radicle-httpd/src/test.rs index aad3054d0..82967df09 100644 --- a/radicle-httpd/src/test.rs +++ b/radicle-httpd/src/test.rs @@ -16,9 +16,11 @@ use radicle::crypto::ssh::keystore::MemorySigner; use radicle::crypto::ssh::Keystore; use radicle::crypto::{KeyPair, Seed, Signer}; use radicle::git::{raw as git2, RefString}; +use radicle::node; use radicle::node::address as AddressStore; use radicle::node::routing as RoutingStore; use radicle::node::tracking::store as TrackingStore; +use radicle::profile; use radicle::profile::Home; use radicle::storage::ReadStorage; use radicle::Storage; @@ -63,6 +65,9 @@ pub fn profile(home: &Path, seed: [u8; 32]) -> radicle::Profile { storage, keystore, public_key: keypair.pk.into(), + config: profile::Config { + node: node::Config::new(node::Alias::new("seed")), + }, } }