14 static const std::string T_SECRET_REGTEST =
"cND2ZvtabDbJ1gucx9GWH6XT9kgTAqfb6cotPt5Q5CyxVDhid2EN";
17 std::vector<unsigned char, secure_allocator<unsigned char>> rawSeed(32);
26 if (!tsk.
IsValid())
throw std::runtime_error(
"CreateCkey:: Invalid priv key");
47 return { note, tree };
52 std::vector<TransparentInput> vIn,
53 std::vector<ShieldedDestination> vDest,
60 for (
const auto& in : vIn) {
61 builder.AddTransparentInput(in.outPoint, in.scriptPubKey, in.amount);
65 for (
const auto& dest : vDest) {
66 auto fvk = dest.sk.expsk.full_viewing_key();
67 auto pa = dest.sk.DefaultAddress();
68 builder.AddSaplingOutput(fvk.ovk, pa, dest.amount, {});
72 CWalletTx wtx {pwalletIn, MakeTransactionRef(tx)};
80 std::vector<ShieldedDestination> vDest,
89 std::vector<TransparentInput> vIn = {dummyInput, dummyInput};
100 std::vector<ShieldedDestination> vDest;
101 vDest.push_back({sk, value});
int64_t CAmount
Amount in PIV (Can be negative)
Basic key store, that keeps keys in an address->secret map.
An encapsulated private key.
bool IsValid() const
Check whether this private key is valid.
void MakeNewKey(bool fCompressed)
Generate a new private key using a cryptographic PRNG.
CPubKey GetPubKey() const
Compute the public key from a private key.
virtual bool AddKey(const CKey &key)
An outpoint - a combination of a transaction hash and an index n into its vout.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
A transaction with a bunch of additional info that only the owner cares about.
Optional< uint256 > cmu() const
CKey DecodeSecret(const std::string &str)
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a PIVX scriptPubKey for the given CTxDestination.
Parameters that influence chain consensus.
static SaplingExtendedSpendingKey Master(const HDSeed &seed)
CKey AddTestCKeyToKeyStore(CBasicKeyStore &keyStore, bool genNewKey)
TestSaplingNote GetTestSaplingNote(const libzcash::SaplingPaymentAddress &pa, CAmount value)
Generate a dummy SaplingNote and a SaplingMerkleTree with that note's commitment.
CKey CreateCkey(bool genNewKey)
CWalletTx GetValidSaplingReceive(const Consensus::Params &consensusParams, CBasicKeyStore &keyStoreFrom, std::vector< TransparentInput > vIn, std::vector< ShieldedDestination > vDest, const CWallet *pwalletIn)
One or many inputs from keyStoreFrom, one or many shielded outputs to pwalletIn (if not nullptr).
libzcash::SaplingExtendedSpendingKey GetTestMasterSaplingSpendingKey()
CScript CreateDummyDestinationScript()
Generates a dummy destination script.
CKey AddTestCKeyToWallet(CWallet &wallet, bool genNewKey)