MCPcopy Create free account
hub / github.com/dfinity/orbit / cbor_encode

Function cbor_encode

libs/orbit-essentials/src/http.rs:50–59  ·  view source on GitHub ↗

Encoding

(value: &impl Serialize)

Source from the content-addressed store, hash-verified

48
49// Encoding
50fn cbor_encode(value: &impl Serialize) -> Vec<u8> {
51 let mut serializer = serde_cbor::Serializer::new(Vec::new());
52 serializer
53 .self_describe()
54 .expect("Failed to self describe CBOR");
55 value
56 .serialize(&mut serializer)
57 .expect("Failed to serialize value");
58 serializer.into_inner()
59}
60
61pub fn certified_data_for_skip_certification() -> [u8; 32] {
62 skip_certification_asset_tree().digest()

Callers 2

test_cbor_encodeFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_cbor_encodeFunction · 0.68