28 args.
AddArg(
"-tx",
"Raw tx hex to run the debugger for (required)",
34 args.
AddArg(
"-scriptpubkey",
35 "Hex of the scriptPubKey of the output being spent (required)",
38 "Value (in sats) of the output being spent (required)",
41 strprintf(
"Output format for the debug trace (Options: human, "
54 std::cerr <<
"Error parsing command line arguments: " <<
error
65 std::cout <<
"Usage: iguana [options]" << std::endl;
71 std::unique_ptr<IguanaFormatter>
formatter;
77 std::cerr <<
"Unsupported output format " <<
outputFormat << std::endl;
85 if (!args.
IsArgSet(
"-scriptpubkey")) {
92 std::cerr <<
"Missing required args " <<
Join(
missingArgs,
", ") <<
". "
93 <<
"Provide -h to see a description for each." << std::endl;
106 if (inputIndex < 0 || tx.
vin.size() <= (
size_t)inputIndex) {
107 std::cerr <<
"Transaction doesn't have input index " << inputIndex
117 CTxOut txout(value, scriptPubKey);
bool HelpRequested(const ArgsManager &args)
void SetupHelpOptions(ArgsManager &args)
Add help options to the args manager.
bool ParseParameters(int argc, const char *const argv[], std::string &error)
std::string GetHelpMessage() const
Get the help string.
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
void AddArg(const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat)
Add argument.
Double ended buffer combining vector and stream-like interfaces.
A mutable version of CTransaction.
Serialized script, used inside transaction inputs and outputs.
An output of a transaction.
Users of this module must hold an ECCVerifyHandle.
std::string FormatFullVersion()
const std::function< std::string(const char *)> G_TRANSLATION_FUN
Translate string to current locale using Qt.
const int64_t DEFAULT_INPUT_INDEX
const std::string DEFAULT_FORMAT
void SetupIguanaArgs(ArgsManager &args)
bool error(const char *fmt, const Args &...args)
static constexpr uint32_t STANDARD_SCRIPT_VERIFY_FLAGS
Standard script verification flags that standard transactions will comply with.
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...
Span< const std::byte > MakeByteSpan(V &&v) noexcept
auto Join(const std::vector< T > &list, const BaseType &separator, UnaryOp unary_op) -> decltype(unary_op(list.at(0)))
Join a list of items.
static constexpr Amount satoshi() noexcept
template std::vector< std::byte > ParseHex(std::string_view)