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

Function run

tests/fuzz/fuzz-bolt12-invrequest-decode.c:183–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void run(const u8 *data, size_t size)
184{
185 struct tlv_invoice_request *invreq, *decoded_invreq;
186 const char *fail = NULL, *encoded_invreq;
187
188 invreq = invrequest_decode(tmpctx, (const char *)data, size,
189 /*feature_set=*/NULL, /*must_be_chain=*/NULL, &fail);
190 if (!invreq)
191 goto cleanup;
192
193 encoded_invreq = invrequest_encode(tmpctx, invreq);
194
195 decoded_invreq = invrequest_decode(tmpctx, encoded_invreq, strlen(encoded_invreq),
196 NULL, NULL, &fail);
197 assert(!fail);
198 assert(decoded_invreq);
199 assert(tlv_invoice_request_eq(invreq, decoded_invreq));
200
201cleanup:
202 clean_tmpctx();
203}

Callers

nothing calls this directly

Calls 4

invrequest_decodeFunction · 0.85
invrequest_encodeFunction · 0.85
tlv_invoice_request_eqFunction · 0.85
clean_tmpctxFunction · 0.85

Tested by

no test coverage detected