Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: remove DelegatesOnly scope
Fintan Halpenny committed 3 years ago
commit 5902236d0a4b2ee92058ffc7f4294d5fa526eb5d
parent 39be7db1e90ba4361db37c40360b63c66b1d5c75
2 files changed +2 -7
modified radicle-node/src/service/tracking/store.rs
@@ -309,8 +309,8 @@ mod test {

        assert!(db.track_repo(&id, Scope::All).unwrap());
        assert_eq!(db.repo_entry(&id).unwrap().unwrap().0, Scope::All);
-
        assert!(db.track_repo(&id, Scope::DelegatesOnly).unwrap());
-
        assert_eq!(db.repo_entry(&id).unwrap().unwrap().0, Scope::DelegatesOnly);
+
        assert!(db.track_repo(&id, Scope::Trusted).unwrap());
+
        assert_eq!(db.repo_entry(&id).unwrap().unwrap().0, Scope::Trusted);
    }

    #[test]
modified radicle/src/node/tracking.rs
@@ -94,8 +94,6 @@ impl TryFrom<&sqlite::Value> for Policy {
pub enum Scope {
    /// Track remotes of nodes that are already tracked.
    Trusted,
-
    /// Track remotes of repository delegates.
-
    DelegatesOnly,
    /// Track all remotes.
    All,
}
@@ -104,7 +102,6 @@ impl fmt::Display for Scope {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Scope::Trusted => f.write_str("trusted"),
-
            Scope::DelegatesOnly => f.write_str("delegates-only"),
            Scope::All => f.write_str("all"),
        }
    }
@@ -120,7 +117,6 @@ impl FromStr for Scope {
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "trusted" => Ok(Self::Trusted),
-
            "delegates-only" => Ok(Self::DelegatesOnly),
            "all" => Ok(Self::All),
            _ => Err(ParseScopeError(s.to_string())),
        }
@@ -136,7 +132,6 @@ impl sqlite::BindableWithIndex for Scope {
    ) -> sqlite::Result<()> {
        let s = match self {
            Self::Trusted => "trusted",
-
            Self::DelegatesOnly => "delegates-only",
            Self::All => "all",
        };
        s.bind(stmt, i)