node: Rename "user"

In some cases to "public key" and in other cases to "remote".

Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Alexis Sellier
2022-09-13 10:16:05 +02:00
parent 4e9b60dee0
commit 46ee08aaf3
6 changed files with 34 additions and 30 deletions
+3 -3
View File
@@ -38,7 +38,7 @@ impl fmt::Debug for Storage {
}
impl ReadStorage for Storage {
fn user_id(&self) -> &UserId {
fn public_key(&self) -> &UserId {
self.signer.public_key()
}
@@ -53,7 +53,7 @@ impl ReadStorage for Storage {
fn get(&self, id: &ProjId) -> Result<Option<Project>, Error> {
// TODO: Don't create a repo here if it doesn't exist?
// Perhaps for checking we could have a `contains` method?
let local = self.user_id();
let local = self.public_key();
let repo = self.repository(id)?;
if let Some(doc) = repo.identity(local)? {
@@ -424,7 +424,7 @@ mod tests {
let signer = MockSigner::new(&mut rng);
let storage = Storage::open(tmp.path(), signer).unwrap();
let proj_id = arbitrary::gen::<ProjId>(1);
let alice = *storage.user_id();
let alice = *storage.public_key();
let project = storage.repository(&proj_id).unwrap();
let backend = &project.backend;
let sig = git2::Signature::now(&alice.to_string(), "anonymous@radicle.xyz").unwrap();