![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include "wallet/test/wallet_test_fixture.h"#include "consensus/merkle.h"#include "primitives/block.h"#include "random.h"#include "sapling/note.h"#include "sapling/noteencryption.h"#include "sapling/transaction_builder.h"#include "test/librust/utiltest.h"#include "wallet/wallet.h"#include <boost/filesystem.hpp>#include <boost/test/unit_test.hpp>Go to the source code of this file.
Classes | |
| struct | SaplingSpendValues |
| struct | FakeBlock |
Functions | |
| void | setupWallet (CWallet &wallet) |
| CWalletTx & | SetWalletNotesData (CWallet *wallet, CWalletTx &wtx) |
| CWalletTx & | AddShieldedBalanceToWallet (CAmount inputAmount, const std::vector< ShieldedDestination > &vDest, CWallet *wallet, const Consensus::Params &consensusParams) |
| Creates and send a tx with an input of 'inputAmount' to 'vDest'. More... | |
| CWalletTx & | AddShieldedBalanceToWallet (const libzcash::SaplingPaymentAddress &sendTo, CAmount amount, CWallet &wallet, const Consensus::Params &consensusParams, libzcash::SaplingExtendedSpendingKey &extskOut) |
| SaplingSpendValues | UpdateWalletInternalNotesData (CWalletTx &wtx, const SaplingOutPoint &sapPoint, CWallet &wallet) |
| Update the wallet internally as if the wallet would had received a valid block containing wtx. More... | |
| BOOST_AUTO_TEST_CASE (GetShieldedSimpleCachedCreditAndDebit) | |
| Validates: 1) CWalletTx getCredit for shielded credit. More... | |
| libzcash::SaplingPaymentAddress | getNewDummyShieldedAddress () |
| CWalletTx & | buildTxAndLoadToWallet (CWallet &wallet, const libzcash::SaplingExtendedSpendingKey &extskOut, const SaplingSpendValues &sapSpendValues, libzcash::SaplingPaymentAddress dest, const CAmount &destAmount, const Consensus::Params &consensus) |
| BOOST_AUTO_TEST_CASE (VerifyShieldedToRemoteShieldedCachedBalance) | |
| Validates shielded to remote shielded + change cached balances. More... | |
| FakeBlock | SimpleFakeMine (CWalletTx &wtx, SaplingMerkleTree ¤tTree, CWallet &wallet) |
| BOOST_AUTO_TEST_CASE (GetShieldedAvailableCredit) | |
| Test: 1) receive two shielded notes on the same tx. More... | |
Variables | |
| CAmount | fee = COIN |
| CWalletTx& AddShieldedBalanceToWallet | ( | CAmount | inputAmount, |
| const std::vector< ShieldedDestination > & | vDest, | ||
| CWallet * | wallet, | ||
| const Consensus::Params & | consensusParams | ||
| ) |
Creates and send a tx with an input of 'inputAmount' to 'vDest'.
Definition at line 44 of file wallet_shielded_balances_tests.cpp.
| CWalletTx& AddShieldedBalanceToWallet | ( | const libzcash::SaplingPaymentAddress & | sendTo, |
| CAmount | amount, | ||
| CWallet & | wallet, | ||
| const Consensus::Params & | consensusParams, | ||
| libzcash::SaplingExtendedSpendingKey & | extskOut | ||
| ) |
Definition at line 67 of file wallet_shielded_balances_tests.cpp.
| BOOST_AUTO_TEST_CASE | ( | GetShieldedAvailableCredit | ) |
Test: 1) receive two shielded notes on the same tx.
2) check available credit. 3) spend one of them. 4) force available credit cache recalculation and validate the updated amount.
Definition at line 314 of file wallet_shielded_balances_tests.cpp.
| BOOST_AUTO_TEST_CASE | ( | GetShieldedSimpleCachedCreditAndDebit | ) |
Validates: 1) CWalletTx getCredit for shielded credit.
Incoming spendable shielded balance must be cached in the cacheableAmounts.
2) CWalletTx getDebit & getCredit for shielded debit to transparent address. Same wallet as point (1), spending half of the credit received in (1) to a transparent remote address. The other half of the balance - minus fee - must appear as credit (shielded change).
Definition at line 129 of file wallet_shielded_balances_tests.cpp.
| BOOST_AUTO_TEST_CASE | ( | VerifyShieldedToRemoteShieldedCachedBalance | ) |
Validates shielded to remote shielded + change cached balances.
Definition at line 234 of file wallet_shielded_balances_tests.cpp.
| CWalletTx& buildTxAndLoadToWallet | ( | CWallet & | wallet, |
| const libzcash::SaplingExtendedSpendingKey & | extskOut, | ||
| const SaplingSpendValues & | sapSpendValues, | ||
| libzcash::SaplingPaymentAddress | dest, | ||
| const CAmount & | destAmount, | ||
| const Consensus::Params & | consensus | ||
| ) |
Definition at line 202 of file wallet_shielded_balances_tests.cpp.
| libzcash::SaplingPaymentAddress getNewDummyShieldedAddress | ( | ) |
Definition at line 195 of file wallet_shielded_balances_tests.cpp.
| void setupWallet | ( | CWallet & | wallet | ) |
Definition at line 23 of file wallet_shielded_balances_tests.cpp.
Definition at line 30 of file wallet_shielded_balances_tests.cpp.
| FakeBlock SimpleFakeMine | ( | CWalletTx & | wtx, |
| SaplingMerkleTree & | currentTree, | ||
| CWallet & | wallet | ||
| ) |
Definition at line 287 of file wallet_shielded_balances_tests.cpp.
| SaplingSpendValues UpdateWalletInternalNotesData | ( | CWalletTx & | wtx, |
| const SaplingOutPoint & | sapPoint, | ||
| CWallet & | wallet | ||
| ) |
Update the wallet internally as if the wallet would had received a valid block containing wtx.
Then return the note, anchor and witness for any subsequent spending process.
Definition at line 88 of file wallet_shielded_balances_tests.cpp.
| CAmount fee = COIN |
Definition at line 19 of file wallet_shielded_balances_tests.cpp.