12#include <boost/test/unit_test.hpp>
15#define NUM_MULTIPLES_UNIT 100000
18#define NUM_MULTIPLES_CENT 10000
21#define NUM_MULTIPLES_1BTC 10000
24#define NUM_MULTIPLES_50BTC 420000
62 for (
uint64_t i = 0; i < 100000; i++)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
An encapsulated private key.
CPubKey GetPubKey() const
Compute the public key from a private key.
An encapsulated public key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization.
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
BOOST_AUTO_TEST_CASE(compress_amounts)
static bool TestEncode(uint64_t in)
static bool TestPair(uint64_t dec, uint64_t enc)
#define NUM_MULTIPLES_CENT
#define NUM_MULTIPLES_1BTC
#define NUM_MULTIPLES_UNIT
static bool TestDecode(uint64_t in)
#define NUM_MULTIPLES_50BTC
bool DecompressScript(CScript &script, unsigned int nSize, const CompressedScript &in)
bool CompressScript(const CScript &script, CompressedScript &out)
uint64_t DecompressAmount(uint64_t x)
uint64_t CompressAmount(uint64_t n)
Compress amount.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
CKey GenerateRandomKey(bool compressed) noexcept
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
static constexpr CAmount CENT
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.