Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
kitchen_sink.cpp
Go to the documentation of this file.
1// Copyright (c) 2020-present The Bitcoin Core 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#include <common/messages.h>
6#include <merkleblock.h>
7#include <node/types.h>
9#include <rpc/util.h>
11#include <test/fuzz/fuzz.h>
12#include <test/fuzz/util.h>
13#include <util/translation.h>
14
15#include <array>
16#include <cstdint>
17#include <optional>
18#include <vector>
19
22
23namespace {
24constexpr TransactionError ALL_TRANSACTION_ERROR[] = {
25 TransactionError::MISSING_INPUTS,
26 TransactionError::ALREADY_IN_UTXO_SET,
27 TransactionError::MEMPOOL_REJECTED,
28 TransactionError::MEMPOOL_ERROR,
29 TransactionError::MAX_FEE_EXCEEDED,
30};
31}; // namespace
32
33// The fuzzing kitchen sink: Fuzzing harness for functions that need to be
34// fuzzed but a.) don't belong in any existing fuzzing harness file, and
35// b.) are not important enough to warrant their own fuzzing harness file.
std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon)
static constexpr auto ALL_FEE_ESTIMATE_HORIZONS
std::string ConsumeRandomLengthString(size_t max_length)
T PickValueInArray(const T(&array)[size])
#define FUZZ_TARGET(...)
Definition fuzz.h:35
std::vector< unsigned char > BitsToBytes(const std::vector< bool > &bits)
std::vector< bool > BytesToBits(const std::vector< unsigned char > &bytes)
is a home for simple string functions returning descriptive messages that are used in RPC and GUI int...
bilingual_str TransactionErrorString(const TransactionError err)
Definition messages.cpp:127
TransactionError
Definition types.h:28
is a home for public enum and struct type definitions that are used internally by node code,...
std::optional< OutputType > ParseOutputType(std::string_view type)
const std::string & FormatOutputType(OutputType type)
OutputType
Definition outputtype.h:18
static constexpr auto OUTPUT_TYPES
Definition outputtype.h:26
UniValue JSONRPCTransactionError(TransactionError terr, const std::string &err_string)
Definition util.cpp:408
RPCErrorCode RPCErrorFromTransactionError(TransactionError terr)
Definition util.cpp:391
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
Definition util.h:57
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:73
assert(!tx.IsCoinBase())
FuzzedDataProvider & fuzzed_data_provider
Definition fees.cpp:38