Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/accounting_tests.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | BOOST_AUTO_TEST_CASE(acc_orderupgrade) { | ||||
BOOST_CHECK(results[Amount::zero()].nTime == 1333333333); | BOOST_CHECK(results[Amount::zero()].nTime == 1333333333); | ||||
BOOST_CHECK(1 == vpwtx[0]->nOrderPos); | BOOST_CHECK(1 == vpwtx[0]->nOrderPos); | ||||
BOOST_CHECK(results[2 * SATOSHI].nTime == 1333333336); | BOOST_CHECK(results[2 * SATOSHI].nTime == 1333333336); | ||||
BOOST_CHECK(results[3 * SATOSHI].nTime == 1333333330); | BOOST_CHECK(results[3 * SATOSHI].nTime == 1333333330); | ||||
BOOST_CHECK(results[3 * SATOSHI].strComment.empty()); | BOOST_CHECK(results[3 * SATOSHI].strComment.empty()); | ||||
wtx.mapValue["comment"] = "y"; | wtx.mapValue["comment"] = "y"; | ||||
{ | { | ||||
CMutableTransaction tx(wtx); | CMutableTransaction tx(*wtx.tx); | ||||
// Just to change the hash :) | // Just to change the hash :) | ||||
--tx.nLockTime; | --tx.nLockTime; | ||||
wtx.SetTx(MakeTransactionRef(std::move(tx))); | wtx.SetTx(MakeTransactionRef(std::move(tx))); | ||||
} | } | ||||
pwalletMain->AddToWallet(wtx); | pwalletMain->AddToWallet(wtx); | ||||
vpwtx.push_back(&pwalletMain->mapWallet.at(wtx.GetId())); | vpwtx.push_back(&pwalletMain->mapWallet.at(wtx.GetId())); | ||||
vpwtx[1]->nTimeReceived = (unsigned int)1333333336; | vpwtx[1]->nTimeReceived = (unsigned int)1333333336; | ||||
wtx.mapValue["comment"] = "x"; | wtx.mapValue["comment"] = "x"; | ||||
{ | { | ||||
CMutableTransaction tx(wtx); | CMutableTransaction tx(*wtx.tx); | ||||
// Just to change the hash :) | // Just to change the hash :) | ||||
--tx.nLockTime; | --tx.nLockTime; | ||||
wtx.SetTx(MakeTransactionRef(std::move(tx))); | wtx.SetTx(MakeTransactionRef(std::move(tx))); | ||||
} | } | ||||
pwalletMain->AddToWallet(wtx); | pwalletMain->AddToWallet(wtx); | ||||
vpwtx.push_back(&pwalletMain->mapWallet.at(wtx.GetId())); | vpwtx.push_back(&pwalletMain->mapWallet.at(wtx.GetId())); | ||||
vpwtx[2]->nTimeReceived = (unsigned int)1333333329; | vpwtx[2]->nTimeReceived = (unsigned int)1333333329; | ||||
vpwtx[2]->nOrderPos = -1; | vpwtx[2]->nOrderPos = -1; | ||||
Show All 34 Lines |