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

Function decode_operation_row

atomic-core/src/pristine/txn/read.rs:64–77  ·  view source on GitHub ↗
(key: &[u8; OperationId::SIZE], bytes: &[u8])

Source from the content-addressed store, hash-verified

62}
63
64fn decode_operation_row(key: &[u8; OperationId::SIZE], bytes: &[u8]) -> PristineResult<Operation> {
65 let key_id = OperationId::from_bytes(*key);
66 let operation = decode_operation(bytes).map_err(operation_serialization_error)?;
67 if operation.id() != key_id {
68 return Err(PristineError::Inconsistent {
69 message: format!(
70 "OPERATIONS key {} contains canonical operation {}",
71 key_id,
72 operation.id()
73 ),
74 });
75 }
76 Ok(operation)
77}
78
79fn decode_effect_receipt_row(key: &[u8; 64], bytes: &[u8]) -> PristineResult<EffectReceipt> {
80 let (key_operation, key_receipt) = decode_effect_receipt_key(key);

Callers 2

get_operationMethod · 0.70
list_operationsMethod · 0.70

Calls 2

decode_operationFunction · 0.85
idMethod · 0.45

Tested by

no test coverage detected