* Re-encode the script internally. Useful if you * changed something manually in the `code` array. * @returns {Script}
()
| 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. |
no test coverage detected