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

Function decode_operation_row

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

Source from the content-addressed store, hash-verified

17}
18
19fn decode_operation_row(key: &[u8; OperationId::SIZE], bytes: &[u8]) -> PristineResult<Operation> {
20 let key_id = OperationId::from_bytes(*key);
21 let operation = decode_operation(bytes).map_err(operation_serialization_error)?;
22 if operation.id() != key_id {
23 return Err(PristineError::Inconsistent {
24 message: format!(
25 "OPERATIONS key {} contains canonical operation {}",
26 key_id,
27 operation.id()
28 ),
29 });
30 }
31 Ok(operation)
32}
33
34fn decode_effect_receipt_row(key: &[u8; 64], bytes: &[u8]) -> PristineResult<EffectReceipt> {
35 let (key_operation, key_receipt) = decode_effect_receipt_key(key);

Callers 3

get_operationMethod · 0.70
list_operationsMethod · 0.70
put_operationMethod · 0.70

Calls 2

decode_operationFunction · 0.85
idMethod · 0.45

Tested by

no test coverage detected