Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: validate production in debug mode
Fintan Halpenny committed 3 years ago
commit 3bfea696426f929d60dcbdf8ee136e45c0b7c20f
parent 024218014b88a097015e32a4fe7c059969ef01ce
1 file changed +10 -0
modified radicle-node/src/worker/fetch.rs
@@ -398,6 +398,16 @@ impl<'a> StagingPhaseFinal<'a> {
        let head = production.set_identity_head()?;
        log::debug!(target: "worker", "'refs/rad/id' for {} set to {head}", production.id);

+
        #[cfg(test)]
+
        // N.b. This is to prevent us from shooting ourselves in the
+
        // foot with storage inconsistencies.
+
        radicle::debug_assert_matches!(
+
            production.validate(),
+
            Ok(()),
+
            "repository {} is not valid",
+
            production.id,
+
        );
+

        Ok((updates, remotes))
    }