Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Wrap EvalScript in a ScriptExecution class #10729
+35
−8
Conversation
luke-jr
referenced this pull request
Jul 3, 2017
Open
Move script flag to/from-string logic from tests to script/interpreter #10730
fanquake
added
the
Validation
label
Jul 3, 2017
| @@ -174,7 +174,34 @@ class MutableTransactionSignatureChecker : public TransactionSignatureChecker | ||
| MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn) : TransactionSignatureChecker(&txTo, nInIn, amountIn), txTo(*txToIn) {} | ||
| }; | ||
| -bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* error = NULL); | ||
| +class ScriptExecution { |
| + typedef std::vector<unsigned char> StackElementType; | ||
| + typedef std::vector<StackElementType> StackType; | ||
| + | ||
| + const CScript& script; |
promag
Jul 4, 2017
Contributor
When that happens either make it public, create a getter or an Inspect method?
| + | ||
| + ScriptExecution(StackType& stack, const CScript&, unsigned int flags, const BaseSignatureChecker&, SigVersion); | ||
| + | ||
| + bool Eval(ScriptError* error = NULL); |
| + | ||
| +inline bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* error = NULL) | ||
| +{ | ||
| + return ScriptExecution(stack, script, flags, checker, sigversion).Eval(error); |
promag
Jul 4, 2017
Contributor
Move stack to ::Eval() for the time being as this is an output (also remove stack member from class)?
luke-jr
added some commits
Jun 28, 2017
|
Rebased |
|
Concept ACK, will review |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
luke-jr commentedJul 3, 2017
When we last discussed making scripts debuggable (sometime after #3901), the plan was to instead trace execution rather than single-step through it.
This is the first step toward that goal. The full implementation can be found on my
script_debuggerbranch.