MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / compute_new_state

Function compute_new_state

atomic-core/src/apply/change.rs:139–141  ·  view source on GitHub ↗

Compute the new Merkle state after applying a change. The Merkle state is computed incrementally: `new_state = Hash(old_state || change_hash)` This provides a unique identifier for the sequence of changes applied to a view. # Arguments `current_state` - The view's current Merkle state `change_hash` - The hash of the change being applied # Returns The new Merkle state after applying the chang

(current_state: &Merkle, change_hash: &Hash)

Source from the content-addressed store, hash-verified

137/// assert_eq!(new_state, new_state2);
138/// ```
139pub fn compute_new_state(current_state: &Merkle, change_hash: &Hash) -> Merkle {
140 current_state.next(change_hash)
141}
142
143/// Describes a change that should be applied to a view.
144///

Calls 1

nextMethod · 0.45