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

Method compile

lib/script/script.js:371–388  ·  view source on GitHub ↗

* Re-encode the script internally. Useful if you * changed something manually in the `code` array. * @returns {Script}

()

Source from the content-addressed store, hash-verified

369 */
370
371 compile() {
372 if (this.code.length === 0)
373 return this.clear();
374
375 let size = 0;
376
377 for (const op of this.code)
378 size += op.getSize();
379
380 const bw = bio.write(size);
381
382 for (const op of this.code)
383 op.toWriter(bw);
384
385 this.raw = bw.render();
386
387 return this;
388 }
389
390 /**
391 * Write the script to a buffer writer.

Callers 15

fromArrayMethod · 0.95
fromItemsMethod · 0.95
getSubscriptMethod · 0.95
removeSeparatorsMethod · 0.95
findAndDeleteMethod · 0.95
fromMultisigMethod · 0.95
fromNulldataMethod · 0.95
fromCommitmentMethod · 0.95
randomInputScriptFunction · 0.95
createCoinbaseMethod · 0.45
getCoinbaseMethod · 0.45
_createTemplateMethod · 0.45

Calls 5

clearMethod · 0.95
renderMethod · 0.80
getSizeMethod · 0.45
writeMethod · 0.45
toWriterMethod · 0.45

Tested by

no test coverage detected