MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / get_effect_receipts

Method get_effect_receipts

atomic-core/src/pristine/txn/read.rs:716–737  ·  view source on GitHub ↗
(&self, operation: OperationId)

Source from the content-addressed store, hash-verified

714 }
715
716 fn get_effect_receipts(&self, operation: OperationId) -> PristineResult<Vec<EffectReceipt>> {
717 if OperationTxnT::get_operation(self, operation)?.is_none() {
718 return Err(PristineError::OperationNotFound {
719 id: operation.to_string(),
720 });
721 }
722 let table = match self.txn.open_table(EFFECT_RECEIPTS) {
723 Ok(table) => table,
724 Err(redb::TableError::TableDoesNotExist(_)) => {
725 return Err(PristineError::OperationSchemaUnavailable);
726 }
727 Err(error) => return Err(error.into()),
728 };
729 let start = encode_effect_receipt_key(operation, EffectReceiptId::from_bytes([0; 32]));
730 let end = encode_effect_receipt_key(operation, EffectReceiptId::from_bytes([u8::MAX; 32]));
731 let mut receipts = Vec::new();
732 for entry in table.range::<&[u8; 64]>(&start..=&end)? {
733 let (key, value) = entry?;
734 receipts.push(decode_effect_receipt_row(key.value(), value.value())?);
735 }
736 Ok(receipts)
737 }
738}
739
740// WorkingCopyTxnT Implementation

Calls 5

is_noneMethod · 0.80
valueMethod · 0.80
pushMethod · 0.45