MCPcopy Create free account
hub / github.com/ElementsProject/lightning / build_bytes

Function build_bytes

plugins/lsps-plugin/src/core/tlv.rs:343–349  ·  view source on GitHub ↗
(type_: u64, value: &[u8])

Source from the content-addressed store, hash-verified

341 }
342
343 fn build_bytes(type_: u64, value: &[u8]) -> Vec<u8> {
344 let mut v = Vec::new();
345 v.extend(super::encode_bigsize(type_));
346 v.extend(super::encode_bigsize(value.len() as u64));
347 v.extend(value);
348 v
349 }
350
351 #[test]
352 fn encode_then_decode_roundtrip() -> Result<()> {

Calls 1

encode_bigsizeFunction · 0.85

Tested by 2