Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
radicle: add missing `review_react` methods
Merged did:key:z6MkkfM3...sVz5 opened 9 months ago
1 file changed +30 -0 3a470035 4e08eef8
modified crates/radicle/src/cob/patch.rs
@@ -1965,6 +1965,20 @@ impl<R: ReadRepository> store::Transaction<Patch, R> {
        )))
    }

+
    /// React to a review.
+
    pub fn review_react(
+
        &mut self,
+
        review: ReviewId,
+
        reaction: Reaction,
+
        active: bool,
+
    ) -> Result<(), store::Error> {
+
        self.push(Action::ReviewReact {
+
            review,
+
            reaction,
+
            active,
+
        })
+
    }
+

    /// Redact a patch review.
    pub fn redact_review(&mut self, review: ReviewId) -> Result<(), store::Error> {
        self.push(Action::ReviewRedact { review })
@@ -2328,6 +2342,22 @@ where
        })
    }

+
    /// React to a review.
+
    pub fn review_react<G>(
+
        &mut self,
+
        review: ReviewId,
+
        reaction: Reaction,
+
        active: bool,
+
        signer: &Device<G>,
+
    ) -> Result<EntryId, Error>
+
    where
+
        G: crypto::signature::Signer<crypto::Signature>,
+
    {
+
        self.transaction("React to review", signer, |tx| {
+
            tx.review_react(review, reaction, active)
+
        })
+
    }
+

    /// Redact a patch review.
    pub fn redact_review<G>(
        &mut self,