Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
iguana_formatter.h
Go to the documentation of this file.
1// Copyright (c) 2024 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_IGUANA_IGUANA_FORMATTER_H
6#define BITCOIN_IGUANA_IGUANA_FORMATTER_H
7
8#include <string>
9#include <vector>
10
11struct IguanaResult;
12struct IguanaStacks;
13struct IguanaTrace;
15
17public:
18 virtual bool Format(const IguanaResult &) = 0;
19 virtual ~IguanaFormatter(){};
20};
21
23public:
24 virtual bool Format(const IguanaResult &result) override;
25
26private:
27 bool FormatTrace(const std::string &title, const IguanaTrace &trace,
28 const ScriptExecutionMetrics &metrics);
29 void FormatStacks(const IguanaStacks &stacks);
31};
32
34public:
35 virtual bool Format(const IguanaResult &result) override;
36
37private:
38 bool FormatTrace(const std::string &title, const IguanaTrace &trace,
39 const ScriptExecutionMetrics &metrics,
40 size_t topStackSize);
41 void TopStackSize(const IguanaTrace &trace, size_t &topStackSize,
42 size_t &topAltStackSize);
43 void FormatStacks(const IguanaStacks &stacks, size_t topStackSize);
44 void FormatStack(const std::vector<std::vector<uint8_t>> &stack);
46};
47
48#endif // BITCOIN_IGUANA_IGUANA_FORMATTER_H
void FormatStack(const std::vector< std::vector< uint8_t > > &stack)
bool FormatTrace(const std::string &title, const IguanaTrace &trace, const ScriptExecutionMetrics &metrics, size_t topStackSize)
void FormatExecutionMetrics(const ScriptExecutionMetrics &metrics)
void TopStackSize(const IguanaTrace &trace, size_t &topStackSize, size_t &topAltStackSize)
virtual bool Format(const IguanaResult &result) override
void FormatStacks(const IguanaStacks &stacks, size_t topStackSize)
void FormatStacks(const IguanaStacks &stacks)
bool FormatTrace(const std::string &title, const IguanaTrace &trace, const ScriptExecutionMetrics &metrics)
void FormatExecutionMetrics(const ScriptExecutionMetrics &metrics)
virtual bool Format(const IguanaResult &result) override
virtual bool Format(const IguanaResult &)=0
virtual ~IguanaFormatter()
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...
Definition random.h:85
Struct for holding cumulative results from executing a script or a sequence of scripts.