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

Function compute_new_state

atomic-core/src/apply/change.rs:201–203  ·  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

199/// assert_eq!(new_state, new_state2);
200/// ```
201pub fn compute_new_state(current_state: &Merkle, change_hash: &Hash) -> Merkle {
202 current_state.next(change_hash)
203}
204
205/// Describes a change that should be applied to a view.
206///

Calls 1

nextMethod · 0.45