Verify that all dependencies of a change are present in the repository. Before a change can be applied, all changes it depends on must already be registered in the repository. This function checks for any missing dependencies. # Arguments `txn` - The transaction to check against `change` - The change whose dependencies to verify # Returns A vector of missing dependency hashes. Empty if all de
(
txn: &T,
change: &Change,
)
| 60 | /// } |
| 61 | /// ``` |
| 62 | pub fn verify_dependencies<T: GraphTxnT>( |
| 63 | txn: &T, |
| 64 | change: &Change, |
| 65 | ) -> Result<Vec<Hash>, PristineError> { |
| 66 | let mut missing = Vec::new(); |
| 67 | |
| 68 | for dep_hash in change.dependencies() { |
| 69 | if txn.get_internal(dep_hash)?.is_none() { |
| 70 | missing.push(*dep_hash); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | Ok(missing) |
| 75 | } |
| 76 | |
| 77 | /// Check if a change has already been applied to a view. |
| 78 | /// |
no test coverage detected