36 std::cout <<
"Script executed without errors" << std::endl;
46 }
else if (opcode ==
OP_0 || (opcode >=
OP_1 && opcode <=
OP_16)) {
56 std::cout <<
"======= " << title <<
" =======" << std::endl;
67 std::cout << std::endl;
83 std::cerr << title <<
" failed execution: ";
84 if (
trace.errorMsg.size() > 0) {
85 std::cerr <<
trace.errorMsg;
89 std::cerr << std::endl;
98 stacks.
stack.size() == 1 ?
"" :
"s");
99 if (stacks.
stack.empty()) {
100 std::cout <<
" (empty stack)";
102 std::cout << std::endl;
110 " Altstack (%d item%s):", stacks.
altstack.size(),
111 stacks.
altstack.size() == 1 ?
"" :
"s")
123 std::cout <<
"Number of sigChecks: " << metrics.
nSigChecks << std::endl;
136 std::cout <<
"scriptName,index,opcode,";
138 std::cout <<
"stack " << idx <<
",";
141 std::cout <<
"altstack " << idx <<
",";
143 std::cout << std::endl;
163 std::cout <<
"Script executed without errors" << std::endl;
191 std::cout << std::endl;
199 std::cout <<
traceName <<
" failed execution: ";
200 if (
trace.errorMsg.size() > 0) {
201 std::cout <<
trace.errorMsg;
205 std::cout << std::endl;
225 for (
const std::vector<uint8_t> &item : stack) {
227 std::cout <<
"(empty)";
229 std::cout <<
"\"" <<
HexStr(item) <<
"\"";
237 std::cout <<
"#sigChecks"
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
std::string GetOpName(opcodetype opcode)
opcodetype
Script opcodes.
std::string ScriptErrorString(const ScriptError serror)
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
IguanaTrace traceScriptSig
IguanaTrace traceScriptPubKey
ScriptExecutionMetrics metrics
std::optional< IguanaTrace > traceRedeemScript
std::vector< std::vector< uint8_t > > stack
std::vector< std::vector< uint8_t > > altstack
std::vector< uint8_t > pushdata
std::vector< IguanaTraceEntry > entries
Struct for holding cumulative results from executing a script or a sequence of scripts.