Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: add cob storage for MockRepository
Fintan Halpenny committed 2 years ago
commit 8239a1d0ace922812c6121039f159c98341749b3
parent a1b41542b8274d9d17d4da03b111d3b4a80f1576
1 file changed +85 -0
modified radicle/src/test/storage.rs
@@ -1,4 +1,5 @@
use std::collections::HashMap;
+
use std::convert::Infallible;
use std::io;
use std::path::{Path, PathBuf};
use std::str::FromStr;
@@ -313,3 +314,87 @@ impl SignRepository for MockRepository {
        todo!()
    }
}
+

+
impl radicle_cob::Store for MockRepository {}
+

+
impl radicle_cob::object::Storage for MockRepository {
+
    type ObjectsError = Infallible;
+
    type TypesError = Infallible;
+
    type UpdateError = Infallible;
+
    type RemoveError = Infallible;
+

+
    fn objects(
+
        &self,
+
        _typename: &radicle_cob::TypeName,
+
        _object_id: &radicle_cob::ObjectId,
+
    ) -> Result<radicle_cob::object::Objects, Self::ObjectsError> {
+
        todo!()
+
    }
+

+
    fn types(
+
        &self,
+
        _typename: &radicle_cob::TypeName,
+
    ) -> Result<
+
        std::collections::BTreeMap<radicle_cob::ObjectId, radicle_cob::object::Objects>,
+
        Self::TypesError,
+
    > {
+
        todo!()
+
    }
+

+
    fn update(
+
        &self,
+
        _identifier: &radicle_crypto::PublicKey,
+
        _typename: &radicle_cob::TypeName,
+
        _object_id: &radicle_cob::ObjectId,
+
        _entry: &radicle_cob::EntryId,
+
    ) -> Result<(), Self::UpdateError> {
+
        todo!()
+
    }
+

+
    fn remove(
+
        &self,
+
        _identifier: &radicle_crypto::PublicKey,
+
        _typename: &radicle_cob::TypeName,
+
        _object_id: &radicle_cob::ObjectId,
+
    ) -> Result<(), Self::RemoveError> {
+
        todo!()
+
    }
+
}
+

+
impl radicle_cob::change::Storage for MockRepository {
+
    type StoreError = radicle_cob::git::change::error::Create;
+
    type LoadError = radicle_cob::git::change::error::Load;
+
    type ObjectId = Oid;
+
    type Parent = Oid;
+
    type Signatures = radicle_cob::signatures::ExtendedSignature;
+

+
    fn store<G>(
+
        &self,
+
        _resource: Option<Self::Parent>,
+
        _related: Vec<Self::Parent>,
+
        _signer: &G,
+
        _template: radicle_cob::change::Template<Self::ObjectId>,
+
    ) -> Result<
+
        radicle_cob::change::store::Entry<Self::Parent, Self::ObjectId, Self::Signatures>,
+
        Self::StoreError,
+
    >
+
    where
+
        G: radicle_crypto::Signer,
+
    {
+
        todo!()
+
    }
+

+
    fn load(
+
        &self,
+
        _id: Self::ObjectId,
+
    ) -> Result<
+
        radicle_cob::change::store::Entry<Self::Parent, Self::ObjectId, Self::Signatures>,
+
        Self::LoadError,
+
    > {
+
        todo!()
+
    }
+

+
    fn parents_of(&self, _id: &Oid) -> Result<Vec<Oid>, Self::LoadError> {
+
        todo!()
+
    }
+
}