5#include <test/data/key_io_invalid.json.h>
6#include <test/data/key_io_valid.json.h>
17#include <boost/test/unit_test.hpp>
31 for (
unsigned int idx = 0; idx <
tests.size(); idx++) {
34 if (test.
size() < 3) {
64 if (
c >=
'a' &&
c <=
'z') {
66 }
else if (
c >=
'A' &&
c <=
'Z') {
89 for (
unsigned int idx = 0; idx <
tests.size(); idx++) {
129 for (
unsigned int idx = 0; idx <
tests.size(); idx++) {
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a scriptPubKey for the destination.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
std::optional< ChainType > ChainTypeFromString(std::string_view chain)
An encapsulated private key.
bool IsValid() const
Check whether this private key is valid.
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
Serialized script, used inside transaction inputs and outputs.
const std::string & get_str() const
const UniValue & find_value(std::string_view key) const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
const UniValue & get_obj() const
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
std::string HexStr(const std::span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
UniValue read_json(std::string_view jsondata)
CTxDestination DecodeDestination(const std::string &str, std::string &error_msg, std::vector< int > *error_locations)
std::string EncodeSecret(const CKey &key)
std::string EncodeDestination(const CTxDestination &dest)
CKey DecodeSecret(const std::string &str)
BOOST_AUTO_TEST_CASE(key_io_valid_parse)
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::vector< Byte > ParseHex(std::string_view hex_str)
Like TryParseHex, but returns an empty vector on invalid input.
constexpr std::array tests
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.