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 <cstdint>
9#include <string>
10#include <vector>
11
12struct IguanaResult;
13struct IguanaStacks;
14struct IguanaTrace;
16
18public:
19 virtual bool Format(const IguanaResult &) = 0;
20 virtual ~IguanaFormatter(){};
21};
22
24public:
25 virtual bool Format(const IguanaResult &result) override;
26
27private:
28 bool FormatTrace(const std::string &title, const IguanaTrace &trace,
29 const ScriptExecutionMetrics &metrics);
30 void FormatStacks(const IguanaStacks &stacks);
32};
33
35public:
36 virtual bool Format(const IguanaResult &result) override;
37
38private:
39 bool FormatTrace(const std::string &title, const IguanaTrace &trace,
40 const ScriptExecutionMetrics &metrics,
41 size_t topStackSize);
42 void TopStackSize(const IguanaTrace &trace, size_t &topStackSize,
43 size_t &topAltStackSize);
44 void FormatStacks(const IguanaStacks &stacks, size_t topStackSize);
45 void FormatStack(const std::vector<std::vector<uint8_t>> &stack);
47};
48
49#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.