(&self)
| 687 | } |
| 688 | |
| 689 | fn list_operation_heads(&self) -> PristineResult<Vec<(OperationScope, OperationHeads)>> { |
| 690 | let table = match self.txn.open_table(OP_HEADS) { |
| 691 | Ok(table) => table, |
| 692 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 693 | return Err(PristineError::OperationSchemaUnavailable); |
| 694 | } |
| 695 | Err(error) => return Err(error.into()), |
| 696 | }; |
| 697 | let mut rows = Vec::new(); |
| 698 | for entry in table.iter()? { |
| 699 | let (key, value) = entry?; |
| 700 | let scope = |
| 701 | decode_operation_scope(key.value()).map_err(operation_serialization_error)?; |
| 702 | let heads = |
| 703 | decode_operation_heads(value.value()).map_err(operation_serialization_error)?; |
| 704 | for head in heads.as_slice() { |
| 705 | if OperationTxnT::get_operation(self, *head)?.is_none() { |
| 706 | return Err(PristineError::OperationNotFound { |
| 707 | id: head.to_string(), |
| 708 | }); |
| 709 | } |
| 710 | } |
| 711 | rows.push((scope, heads)); |
| 712 | } |
| 713 | Ok(rows) |
| 714 | } |
| 715 | |
| 716 | fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> { |
| 717 | if OperationTxnT::get_operation(self, operation)?.is_none() { |
no test coverage detected