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

Function simplicity_parse_sequence

src/simplicity/jets.c:1395–1405  ·  view source on GitHub ↗

parse_sequence : TWO^32 |- S (TWO^16 + TWO^16) */

Source from the content-addressed store, hash-verified

1393
1394/* parse_sequence : TWO^32 |- S (TWO^16 + TWO^16) */
1395bool simplicity_parse_sequence(frameItem* dst, frameItem src, const txEnv* env) {
1396 (void) env; /* env is unused. */
1397 uint_fast32_t nSequence = simplicity_read32(&src);
1398 if (writeBit(dst, nSequence < ((uint_fast32_t)1 << 31))) {
1399 writeBit(dst, nSequence & ((uint_fast32_t)1 << 22));
1400 simplicity_write16(dst, nSequence & 0xffff);
1401 } else {
1402 skipBits(dst, 17);
1403 }
1404 return true;
1405}
1406
1407/* simplicity_tapdata_init : ONE |- CTX8 */
1408bool simplicity_tapdata_init(frameItem* dst, frameItem src, const txEnv* env) {

Callers

nothing calls this directly

Calls 2

writeBitFunction · 0.85
skipBitsFunction · 0.85

Tested by

no test coverage detected