diff options
Diffstat (limited to 'src/federation/fork.rs')
| -rw-r--r-- | src/federation/fork.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/federation/fork.rs b/src/federation/fork.rs index c5ce727..0333a52 100644 --- a/src/federation/fork.rs +++ b/src/federation/fork.rs @@ -1,8 +1,9 @@ //! Forks (`docs/federation.md`, Forks): a node holding a federation's history makes the //! root of a fork at heads it holds, by a version (`make`), and checks one it is given //! (`check`): whether it builds that root at its heads, what it holds that those heads -//! lack, what the fork's version changes of the one current there, and, party by party, -//! the keys the fork's version gives where they aren't the keys the party had there. A +//! lack, what the fork's version changes of the one current there, and so who writes the +//! places holding a value, and, party by party, the keys the fork's version gives where +//! they aren't the keys the party had there. A //! node that doesn't hold that history takes a fork's root on its operator's word, who //! names the fork by its root's ID (`--store-id`). //! @@ -64,6 +65,9 @@ pub(crate) struct Check { /// What the fork's version changes of the version current at those heads, a line each /// (`client::changes`): its rules among them, whose order says who writes where. pub(crate) changes: Vec<String>, + /// Of the places holding a value there, those whose writer the fork's version changes, + /// a line each (`client::writers`). + pub(crate) writers: Vec<String>, /// Each party whose keys the fork's version gives otherwise than the party had at /// those heads, with its keys there and in the fork. pub(crate) keys: Vec<(String, Vec<String>, Vec<String>)>, @@ -90,6 +94,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str why, lacking: Vec::new(), changes: Vec::new(), + writers: Vec::new(), keys: Vec::new(), }); } @@ -97,6 +102,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str let at = store.state_at(heads); let current = at.current(); let changes = super::client::changes(¤t.json, &version.json); + let writers = super::client::writers(current, version, at.values().keys().map(String::as_str)); let sorted = |mut keys: Vec<String>| { keys.sort(); keys @@ -129,6 +135,7 @@ pub(crate) fn check(store: &Store<Federation>, root: &[u8]) -> Result<Check, Str why, lacking, changes, + writers, keys, }) } @@ -170,6 +177,7 @@ mod tests { why: None, lacking: Vec::new(), changes: check.changes.clone(), + writers: Vec::new(), keys: Vec::new(), } ); |
