Supports execution of multiple scripts chained together
Overview
Thanks for creating this project, I have found it quite nice to use recently in an educational context.
Made a very small addition that I have found useful, which just reads in multiple files concatenated together. This was nice for the question of "does script X unlock script Y". Figured I'd PR it in case it's useful for others!
Testing
Try writing up two scripts and execute them together
Ex.
Signed-off-by: Michael Maurer <maurer.mi@northeastern.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Supports execution of multiple scripts chained together
Overview
Thanks for creating this project, I have found it quite nice to use recently in an educational context.
Made a very small addition that I have found useful, which just reads in multiple files concatenated together. This was nice for the question of "does script X unlock script Y". Figured I'd PR it in case it's useful for others!
Testing
Try writing up two scripts and execute them together
Ex.
Executing:
$ btcexec ./makes-eight.bs ./checks-equal-to-eight.bs Script in hex: 517693769376935887 Script size: 9 bytes -------------------------------------------------- Execution ended. Success: true Final stack: <01> Stats: ExecStats { max_nb_stack_items: 2, opcode_count: 0, start_validation_weight: 51, validation_weight: 51, } Time elapsed: 0msExecuting with --debug
)$ btcexec ./makes-eight.bs ./checks-equal-to-eight.bs --debug Script in hex: 517693769376935887 Script size: 9 bytes -------------------------------------------------- Remaining script: OP_PUSHNUM_1 OP_DUP OP_ADD OP_DUP OP_ADD OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: AltStack: -------------------------------------------------- Remaining script: OP_DUP OP_ADD OP_DUP OP_ADD OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <01> AltStack: -------------------------------------------------- Remaining script: OP_ADD OP_DUP OP_ADD OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <01> <01> AltStack: -------------------------------------------------- Remaining script: OP_DUP OP_ADD OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <02> AltStack: -------------------------------------------------- Remaining script: OP_ADD OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <02> <02> AltStack: -------------------------------------------------- Remaining script: OP_DUP OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <04> AltStack: -------------------------------------------------- Remaining script: OP_ADD OP_PUSHNUM_8 OP_EQUAL Stack: <04> <04> AltStack: -------------------------------------------------- Remaining script: OP_PUSHNUM_8 OP_EQUAL Stack: <08> AltStack: -------------------------------------------------- Remaining script: OP_EQUAL Stack: <08> <08> AltStack: -------------------------------------------------- Remaining script: Stack: <01> AltStack: -------------------------------------------------- Execution ended. Success: true Final stack: <01> Stats: ExecStats { max_nb_stack_items: 2, opcode_count: 0, start_validation_weight: 51, validation_weight: 51, } Time elapsed: 0ms