1 // Copyright (c) 2016 The Zcash developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or https://www.opensource.org/licenses/mit-license.php .
5 #ifndef ZCASH_UTIL_TEST_H
6 #define ZCASH_UTIL_TEST_H
9 #include "wallet/wallet.h"
10 #include "zcash/JoinSplit.hpp"
11 #include "zcash/Note.hpp"
12 #include "zcash/NoteEncryption.hpp"
13 #include "zcash/zip32.h"
16 CWalletTx GetValidSproutReceive(ZCJoinSplit& params,
17 const libzcash::SproutSpendingKey& sk,
21 CWalletTx GetInvalidCommitmentSproutReceive(ZCJoinSplit& params,
22 const libzcash::SproutSpendingKey& sk,
26 libzcash::SproutNote GetSproutNote(ZCJoinSplit& params,
27 const libzcash::SproutSpendingKey& sk,
28 const CTransaction& tx, size_t js, size_t n);
29 CWalletTx GetValidSproutSpend(ZCJoinSplit& params,
30 const libzcash::SproutSpendingKey& sk,
31 const libzcash::SproutNote& note,
35 static const std::string T_SECRET_REGTEST = "cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN";
37 struct TestSaplingNote {
38 libzcash::SaplingNote note;
39 SaplingMerkleTree tree;
42 const Consensus::Params& RegtestActivateSapling();
44 void RegtestDeactivateSapling();
46 const Consensus::Params& RegtestActivateBlossom(bool updatePow, int blossomActivationHeight = Consensus::NetworkUpgrade::ALWAYS_ACTIVE);
48 void RegtestDeactivateBlossom();
50 libzcash::SaplingExtendedSpendingKey GetTestMasterSaplingSpendingKey();
52 CKey AddTestCKeyToKeyStore(CBasicKeyStore& keyStore);
55 * Generate a dummy SaplingNote and a SaplingMerkleTree with that note's commitment.
57 TestSaplingNote GetTestSaplingNote(const libzcash::SaplingPaymentAddress& pa, CAmount value);
59 CWalletTx GetValidSaplingReceive(const Consensus::Params& consensusParams,
60 CBasicKeyStore& keyStore,
61 const libzcash::SaplingExtendedSpendingKey &sk,
64 #endif // ZCASH_UTIL_TEST_H