pub fn fold_node_states<'a, I>(events: I) -> HashMap<NodeId, String>where
I: IntoIterator<Item = &'a ChainEvent>,Expand description
Fold a sequence of chain events into node_id → current state.
Rules:
causal.node.addseeds the node with optionalstatefrom payload, else leaves it unmapped until a state event arrives.causal.node.statesetsto(last write wins in event order).causal.node.removedrops the node from the map.
Events of other kinds are ignored. Order is the fold order — pass chain order (ascending sequence).