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

Function validate_can_apply

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

Check if applying a change would succeed (without actually applying). This performs validation checks: - Change not already on view - All dependencies present # Arguments `txn` - The transaction to check against `view` - The view to check `change_id` - The internal ID of the change `change_hash` - The hash of the change `change` - The change to validate # Returns `Ok(())` if the change can be

(
    txn: &T,
    view: &ViewState,
    change_id: NodeId,
    change_hash: &Hash,
    change: &Change,
)

Source from the content-addressed store, hash-verified

266///
267/// `Ok(())` if the change can be applied, or an error describing why not.
268pub fn validate_can_apply<T: ViewTxnT + GraphTxnT>(
269 txn: &T,
270 view: &ViewState,
271 change_id: NodeId,
272 change_hash: &Hash,
273 change: &Change,
274) -> Result<(), LocalApplyError> {
275 validate_can_apply_with_frontier(txn, view, change_id, change_hash, change).map(|_| ())
276}
277
278/// Validate application and return the verified causal knowledge for conflict checks.
279pub fn validate_can_apply_with_frontier<T: ViewTxnT + GraphTxnT>(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected