MCPcopy Create free account
hub / github.com/ElementsProject/elements / simplicity_bitcoin_decodeJet

Function simplicity_bitcoin_decodeJet

src/simplicity/bitcoin/primitive.c:101–107  ·  view source on GitHub ↗

Decode a Bitcoin specific jet from 'stream' into 'node'. * All jets begin with a bit prefix of '1' which needs to have already been consumed from the 'stream'. * Returns 'SIMPLICITY_ERR_DATA_OUT_OF_RANGE' if the stream's prefix doesn't match any valid code for a jet. * Returns 'SIMPLICITY_ERR_BITSTRING_EOF' if not enough bits are available in the 'stream'. * In the above error cases, 'dag' may

Source from the content-addressed store, hash-verified

99 * NULL != stream
100 */
101simplicity_err simplicity_bitcoin_decodeJet(dag_node* node, bitstream* stream) {
102 jetName name;
103 simplicity_err error = decodePrimitive(&name, stream);
104 if (!IS_OK(error)) return error;
105 *node = jetNode(name);
106 return SIMPLICITY_NO_ERROR;
107}

Callers

nothing calls this directly

Calls 3

IS_OKFunction · 0.85
decodePrimitiveFunction · 0.70
jetNodeFunction · 0.70

Tested by

no test coverage detected