mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user