MCPcopy Index your code
hub / github.com/bcoin-org/bcoin / toItems

Method toItems

lib/script/script.js:195–208  ·  view source on GitHub ↗

* Convert script to stack items. * @returns {Buffer[]}

()

Source from the content-addressed store, hash-verified

193 */
194
195 toItems() {
196 const items = [];
197
198 for (const op of this.code) {
199 const data = op.toPush();
200
201 if (!data)
202 throw new Error('Non-push opcode in script.');
203
204 items.push(data);
205 }
206
207 return items;
208 }
209
210 /**
211 * Inject data from stack items.

Callers 1

toStackMethod · 0.95

Calls 2

toPushMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected