Return full operation data, receipts, verification, and current head scopes.
(
&self,
operation_id: OperationId,
)
| 321 | |
| 322 | /// Return full operation data, receipts, verification, and current head scopes. |
| 323 | pub fn operation_details( |
| 324 | &self, |
| 325 | operation_id: OperationId, |
| 326 | ) -> Result<OperationDetails, RepositoryError> { |
| 327 | let txn = self.pristine.read_txn().map_err(pristine_error)?; |
| 328 | let operation = txn |
| 329 | .get_operation(operation_id) |
| 330 | .map_err(pristine_error)? |
| 331 | .ok_or_else(|| RepositoryError::OperationNotFound { |
| 332 | selector: operation_id.to_string(), |
| 333 | })?; |
| 334 | let mut receipts = txn |
| 335 | .get_effect_receipts(operation_id) |
| 336 | .map_err(pristine_error)?; |
| 337 | sort_receipts(&mut receipts); |
| 338 | let verification = operation_verification_state(&receipts); |
| 339 | let mut head_of: Vec<OperationScope> = txn |
| 340 | .list_operation_heads() |
| 341 | .map_err(pristine_error)? |
| 342 | .into_iter() |
| 343 | .filter_map(|(scope, heads)| heads.as_slice().contains(&operation_id).then_some(scope)) |
| 344 | .collect(); |
| 345 | head_of.sort_unstable(); |
| 346 | Ok(OperationDetails { |
| 347 | operation, |
| 348 | receipts, |
| 349 | verification, |
| 350 | head_of, |
| 351 | }) |
| 352 | } |
| 353 | |
| 354 | /// Prepare a native remote command before its protocol mutation begins. |
| 355 | pub fn prepare_remote_operation( |