(&self, operation: OperationId)
| 131 | } |
| 132 | |
| 133 | fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> { |
| 134 | if OperationTxnT::get_operation(self, operation)?.is_none() { |
| 135 | return Err(PristineError::OperationNotFound { |
| 136 | id: operation.to_string(), |
| 137 | }); |
| 138 | } |
| 139 | let table = match self.txn.open_table(EFFECT_RECEIPTS) { |
| 140 | Ok(table) => table, |
| 141 | Err(redb::TableError::TableDoesNotExist(_)) => { |
| 142 | return Err(PristineError::OperationSchemaUnavailable); |
| 143 | } |
| 144 | Err(error) => return Err(error.into()), |
| 145 | }; |
| 146 | let start = encode_effect_receipt_key(operation, EffectReceiptId::from_bytes([0; 32])); |
| 147 | let end = encode_effect_receipt_key(operation, EffectReceiptId::from_bytes([u8::MAX; 32])); |
| 148 | let mut receipts = Vec::new(); |
| 149 | for entry in table.range::<&[u8; 64]>(&start..=&end)? { |
| 150 | let (key, value) = entry?; |
| 151 | receipts.push(decode_effect_receipt_row(key.value(), value.value())?); |
| 152 | } |
| 153 | Ok(receipts) |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | impl OperationMutTxnT for WriteTxn<'_> { |
no test coverage detected