radicle/cob/identity: Tighten initial revision

Make `Identity::new` private, to have more control over the initial
revision of the COB. Also assert that the author of the revision is the
solve delegate of the initial revision, i.e., the "founder".
This commit is contained in:
Lorenz Leutgeb
2026-08-23 20:51:13 +02:00
parent 675b82f344
commit 96d74ea9ba
+7 -1
View File
@@ -198,8 +198,14 @@ impl std::ops::Deref for Identity {
}
impl Identity {
pub fn new(root: Revision) -> Self {
fn new(root: Revision) -> Self {
let root_id = root.id;
let founder = *root.author.id();
debug_assert_eq!(
*root.doc.delegates(),
crate::identity::doc::Delegates::from(founder)
);
Self {
root: root_id,