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++)
uint64_t CompressAmount(uint64_t n)
Compress amount.
BOOST_AUTO_TEST_CASE(compress_amounts)
static bool TestEncode(uint64_t in)
CPubKey GetPubKey() const
Compute the public key from a private key.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
#define NUM_MULTIPLES_CENT
#define NUM_MULTIPLES_UNIT
static bool TestPair(uint64_t dec, uint64_t enc)
#define NUM_MULTIPLES_1BTC
bool CompressScript(const CScript &script, CompressedScript &out)
BOOST_AUTO_TEST_SUITE_END()
An encapsulated public key.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
#define NUM_MULTIPLES_50BTC
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
std::vector< unsigned char > ToByteVector(const T &in)
#define BOOST_CHECK_EQUAL(v1, v2)
Serialized script, used inside transaction inputs and outputs.
A reference to a CScript: the Hash160 of its serialization.
static constexpr CAmount CENT
An encapsulated private key.
uint64_t DecompressAmount(uint64_t x)
static bool TestDecode(uint64_t in)
#define BOOST_CHECK(expr)
static constexpr CAmount COIN
The amount of satoshis in one BTC.