Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/wallet_tests.cpp
// Copyright (c) 2012-2016 The Bitcoin Core developers | // Copyright (c) 2012-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "wallet/wallet.h" | #include "wallet/wallet.h" | ||||
#include "chainparams.h" | #include "chainparams.h" | ||||
#include "config.h" | #include "config.h" | ||||
#include "consensus/validation.h" | #include "consensus/validation.h" | ||||
#include "rpc/server.h" | #include "rpc/server.h" | ||||
#include "test/test_bitcoin.h" | #include "test/test_bitcoin.h" | ||||
#include "validation.h" | #include "validation.h" | ||||
#include "wallet/coincontrol.h" | |||||
#include "wallet/rpcdump.h" | #include "wallet/rpcdump.h" | ||||
#include "wallet/test/wallet_test_fixture.h" | #include "wallet/test/wallet_test_fixture.h" | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
▲ Show 20 Lines • Show All 702 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
CWalletTx &AddTx(CRecipient recipient) { | CWalletTx &AddTx(CRecipient recipient) { | ||||
CWalletTx wtx; | CWalletTx wtx; | ||||
CReserveKey reservekey(wallet.get()); | CReserveKey reservekey(wallet.get()); | ||||
Amount fee; | Amount fee; | ||||
int changePos = -1; | int changePos = -1; | ||||
std::string error; | std::string error; | ||||
CCoinControl coinControl; | |||||
Fabien: Why changing the name from the original PR ? | |||||
jasonbcoxAuthorUnsubmitted Done Inline ActionsI don't recall doing this. Will fix. jasonbcox: I don't recall doing this. Will fix. | |||||
BOOST_CHECK(wallet->CreateTransaction({recipient}, wtx, reservekey, fee, | BOOST_CHECK(wallet->CreateTransaction({recipient}, wtx, reservekey, fee, | ||||
changePos, error)); | changePos, error, coinControl)); | ||||
CValidationState state; | CValidationState state; | ||||
BOOST_CHECK(wallet->CommitTransaction(wtx, reservekey, nullptr, state)); | BOOST_CHECK(wallet->CommitTransaction(wtx, reservekey, nullptr, state)); | ||||
CMutableTransaction blocktx; | CMutableTransaction blocktx; | ||||
{ | { | ||||
LOCK(wallet->cs_wallet); | LOCK(wallet->cs_wallet); | ||||
blocktx = | blocktx = | ||||
CMutableTransaction(*wallet->mapWallet.at(wtx.GetId()).tx); | CMutableTransaction(*wallet->mapWallet.at(wtx.GetId()).tx); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |
Why changing the name from the original PR ?