11 #include <boost/test/unit_test.hpp>
14 #define NUM_MULTIPLES_UNIT 100000
17 #define NUM_MULTIPLES_CENT 10000
20 #define NUM_MULTIPLES_1BTC 10000
23 #define NUM_MULTIPLES_50BTC 420000
35 bool static TestPair(uint64_t dec, uint64_t enc) {
61 for (uint64_t i = 0; i < 100000; i++)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
An encapsulated private key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
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 (see script.h)
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 CompressScript(const CScript &script, CompressedScript &out)
uint64_t DecompressAmount(uint64_t x)
uint64_t CompressAmount(uint64_t n)
Compress amount.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
std::vector< unsigned char > ToByteVector(const T &in)
static constexpr CAmount CENT