MCPcopy
hub / github.com/bcoin-org/bcoin / getSubscript

Method getSubscript

lib/script/script.js:446–462  ·  view source on GitHub ↗

* Get the script's "subscript" starting at a separator. * @param {Number} index - The last separator to sign/verify beyond. * @returns {Script} Subscript.

(index)

Source from the content-addressed store, hash-verified

444 */
445
446 getSubscript(index) {
447 if (index === 0)
448 return this.clone();
449
450 const script = new Script();
451
452 for (let i = index; i < this.code.length; i++) {
453 const op = this.code[i];
454
455 if (op.value === -1)
456 break;
457
458 script.code.push(op);
459 }
460
461 return script.compile();
462 }
463
464 /**
465 * Get the script's "subscript" starting at a separator.

Callers 2

executeMethod · 0.95
tx-test.jsFile · 0.80

Calls 3

cloneMethod · 0.95
compileMethod · 0.95
pushMethod · 0.45

Tested by

no test coverage detected