(&self)
| 104 | } |
| 105 | |
| 106 | fn list_operation_heads(&self) -> PristineResult<Vec<(OperationScope, OperationHeads)>> { |
| 107 | let table = match self.txn.open_table(OP_HEADS) { |
| 108 | Ok(table) => table, |
| 109 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 110 | return Err(PristineError::OperationSchemaUnavailable); |
| 111 | } |
| 112 | Err(error) => return Err(error.into()), |
| 113 | }; |
| 114 | let mut rows = Vec::new(); |
| 115 | for entry in table.iter()? { |
| 116 | let (key, value) = entry?; |
| 117 | let scope = |
| 118 | decode_operation_scope(key.value()).map_err(operation_serialization_error)?; |
| 119 | let heads = |
| 120 | decode_operation_heads(value.value()).map_err(operation_serialization_error)?; |
| 121 | for head in heads.as_slice() { |
| 122 | if OperationTxnT::get_operation(self, *head)?.is_none() { |
| 123 | return Err(PristineError::OperationNotFound { |
| 124 | id: head.to_string(), |
| 125 | }); |
| 126 | } |
| 127 | } |
| 128 | rows.push((scope, heads)); |
| 129 | } |
| 130 | Ok(rows) |
| 131 | } |
| 132 | |
| 133 | fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> { |
| 134 | if OperationTxnT::get_operation(self, operation)?.is_none() { |
nothing calls this directly
no test coverage detected