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

Function test_json_codec

plugins/src/codec.rs:184–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

182
183 #[test]
184 fn test_json_codec() {
185 let tests = vec![json!({"hello": "world"})];
186
187 for t in tests.iter() {
188 let mut codec = JsonCodec::default();
189 let mut buf = BytesMut::new();
190 codec.encode(t.clone(), &mut buf).unwrap();
191 let decoded = codec.decode(&mut buf).unwrap().unwrap();
192 assert_eq!(&decoded, t);
193 }
194 }
195}

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected