14 #include <boost/test/unit_test.hpp>
23 std::vector<unsigned char, secure_allocator<unsigned char>> rawSeed(32);
27 for (uint32_t i = 0; i < 1000; i++) {
28 auto sk = m.Derive(i);
36 BOOST_ASSERT(boost::get<libzcash::SaplingExtendedSpendingKey>(&spendingkey2) !=
nullptr);
37 auto sk2 = boost::get<libzcash::SaplingExtendedSpendingKey>(spendingkey2);
49 BOOST_ASSERT(boost::get<libzcash::SaplingPaymentAddress>(&paymentaddr2) !=
nullptr);
50 auto addr2 = boost::get<libzcash::SaplingPaymentAddress>(paymentaddr2);
60 std::vector<unsigned char, secure_allocator<unsigned char>> rawSeed(32);
64 for (uint32_t i = 0; i < 1000; i++) {
69 sk_string.substr(0, 26) ==
75 BOOST_CHECK(boost::get<libzcash::SaplingExtendedSpendingKey>(&spendingkey2) !=
nullptr);
76 auto sk2 = boost::get<libzcash::SaplingExtendedSpendingKey>(spendingkey2);
81 auto extfvk = sk.ToXFVK();
84 vk_string.substr(0, 7) ==
90 BOOST_CHECK(boost::get<libzcash::SaplingExtendedFullViewingKey>(&viewingkey2) !=
nullptr);
91 auto extfvk2 = boost::get<libzcash::SaplingExtendedFullViewingKey>(viewingkey2);
96 auto addr = sk.DefaultAddress();
100 addr_string.substr(0, 2) ==
106 BOOST_CHECK(boost::get<libzcash::SaplingPaymentAddress>(&paymentaddr2) !=
nullptr);
107 auto addr2 = boost::get<libzcash::SaplingPaymentAddress>(paymentaddr2);
bool IsValidPaymentAddress(const libzcash::PaymentAddress &zaddr)
Check whether a PaymentAddress is not an InvalidEncoding.
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
const CChainParams & Params()
Return the currently selected parameters.
static const std::string REGTEST
static const std::string MAIN
Chain name strings.
@ SAPLING_PAYMENT_ADDRESS
@ SAPLING_EXTENDED_SPEND_KEY
BOOST_AUTO_TEST_SUITE_END()
libzcash::SpendingKey DecodeSpendingKey(const std::string &str)
std::string EncodePaymentAddress(const libzcash::PaymentAddress &zaddr)
libzcash::ViewingKey DecodeViewingKey(const std::string &str)
std::string EncodeViewingKey(const libzcash::ViewingKey &vk)
libzcash::PaymentAddress DecodePaymentAddress(const std::string &str)
std::string EncodeSpendingKey(const libzcash::SpendingKey &zkey)
boost::variant< InvalidEncoding, SaplingExtendedSpendingKey > SpendingKey
#define BOOST_FIXTURE_TEST_SUITE(a, b)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(ps_address_test)
SaplingExtendedSpendingKey Derive(uint32_t i) const
static SaplingExtendedSpendingKey Master(const HDSeed &seed)
bool IsValidSpendingKey(const libzcash::SpendingKey &zkey)
Check whether a SpendingKey is not an InvalidEncoding.
bool IsValidViewingKey(const libzcash::ViewingKey &vk)
Check whether a ViewingKey is not an InvalidEncoding.