5#include <test/data/blockfilters.json.h>
8#include <blockfilter.h>
17#include <boost/test/unit_test.hpp>
24 for (
int i = 0; i < 100; ++i) {
133 if (!json.read(json_tests::blockfilters) || !json.isArray()) {
139 for (
unsigned int i = 0; i <
tests.size(); i++) {
143 if (test.
size() == 1) {
145 }
else if (test.
size() < 7) {
150 unsigned int pos = 0;
151 test[pos++].
getInt<
int>();
164 tx_undo.vprevout.emplace_back(txout, 0,
false);
const std::string & BlockFilterTypeName(BlockFilterType filter_type)
Get the human-readable name for a filter type.
bool BlockFilterTypeByName(std::string_view name, BlockFilterType &filter_type)
Find a filter type by its human-readable name.
BOOST_AUTO_TEST_CASE(gcsfilter_test)
#define Assert(val)
Identity function.
Complete block filter struct as defined in BIP 157.
std::vector< CTransactionRef > vtx
Undo information for a CBlock.
std::vector< CTxUndo > vtxundo
Serialized script, used inside transaction inputs and outputs.
An output of a transaction.
Undo information for a CTransaction.
Double ended buffer combining vector and stream-like interfaces.
This implements a Golomb-coded set as defined in BIP 158.
std::vector< unsigned char > Element
std::unordered_set< Element, ByteVectorHash > ElementSet
const Params & GetParams() const LIFETIMEBOUND
bool Match(const Element &element) const
Checks if the element may be in the set.
const std::vector< unsigned char > & GetEncoded() const LIFETIMEBOUND
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const UniValue & get_array() const
static std::optional< uint256 > FromHex(std::string_view str)
bool DecodeHexBlk(CBlock &block, const std::string &strHexBlk)
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
std::vector< Byte > ParseHex(std::string_view hex_str)
Like TryParseHex, but returns an empty vector on invalid input.
A mutable version of CTransaction.
std::vector< CTxOut > vout
uint32_t m_M
Inverse false positive rate.
uint8_t m_P
Golomb-Rice coding parameter.
constexpr std::array tests
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.