aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-11-11 16:54:51 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-02 18:28:22 -0800
commitc3f5673a6304e3ea9fa56fff66b6ea1cb73cc98f (patch)
treebbf3dcfb1a227471e9a4fe802dfe0d0f22191916 /src/wallet/test
parenta1883536b455b889f1ebfca9e50d1e0ef28a7731 (diff)
downloadbitcoin-c3f5673a6304e3ea9fa56fff66b6ea1cb73cc98f.tar.xz
Make CWalletTx store a CTransactionRef instead of inheriting
Diffstat (limited to 'src/wallet/test')
-rw-r--r--src/wallet/test/accounting_tests.cpp4
-rw-r--r--src/wallet/test/wallet_tests.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/test/accounting_tests.cpp b/src/wallet/test/accounting_tests.cpp
index a833be13d0..eb14d176bd 100644
--- a/src/wallet/test/accounting_tests.cpp
+++ b/src/wallet/test/accounting_tests.cpp
@@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade)
{
CMutableTransaction tx(wtx);
--tx.nLockTime; // Just to change the hash :)
- *static_cast<CTransaction*>(&wtx) = CTransaction(tx);
+ wtx.SetTx(MakeTransactionRef(std::move(tx)));
}
pwalletMain->AddToWallet(wtx);
vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);
@@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade)
{
CMutableTransaction tx(wtx);
--tx.nLockTime; // Just to change the hash :)
- *static_cast<CTransaction*>(&wtx) = CTransaction(tx);
+ wtx.SetTx(MakeTransactionRef(std::move(tx)));
}
pwalletMain->AddToWallet(wtx);
vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index ecbbcb145d..8085706a99 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -42,7 +42,7 @@ static void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = fa
// so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe()
tx.vin.resize(1);
}
- CWalletTx* wtx = new CWalletTx(&wallet, tx);
+ CWalletTx* wtx = new CWalletTx(&wallet, MakeTransactionRef(std::move(tx)));
if (fIsFromMe)
{
wtx->fDebitCached = true;