* Convert script to stack items. * @returns {Buffer[]}
()
| 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. |