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

Method parse

plugins/lsps-plugin/src/cln_adapters/hooks.rs:71–76  ·  view source on GitHub ↗

Parse and validate everything upfront

(v: Value)

Source from the content-addressed store, hash-verified

69impl CustomMsgHook {
70 /// Parse and validate everything upfront
71 pub fn parse(v: Value) -> Option<Self> {
72 let raw: CustomMsgHookRaw = serde_json::from_value(v).ok()?;
73 let peer_id = raw.peer_id;
74 let payload = decode_lsps0_frame_hex(&raw.payload)?;
75 Some(Self { peer_id, payload })
76 }
77}
78
79fn decode_lsps0_frame_hex(hex_str: &str) -> Option<Vec<u8>> {

Callers 10

from_strMethod · 0.80
deserializeMethod · 0.80
list_all_examplesFunction · 0.80
parse_optionsFunction · 0.80
mainFunction · 0.80
test_contextFunction · 0.80
test_peerFunction · 0.80
test_peer_idFunction · 0.80
test_peer_idFunction · 0.80
test_peer_idFunction · 0.80

Calls 1

decode_lsps0_frame_hexFunction · 0.85

Tested by 5

test_contextFunction · 0.64
test_peerFunction · 0.64
test_peer_idFunction · 0.64
test_peer_idFunction · 0.64
test_peer_idFunction · 0.64