14#include <boost/test/unit_test.hpp>
38 const auto& txr = *res;
40 BOOST_CHECK_EQUAL(txr.tx->vout[0].nValue, recipient.nAmount + leftover_input_amount - txr.fee);
41 BOOST_CHECK_GT(txr.fee, 0);
69 for (
int i = 0; i < 4; i++) CreateAndProcessBlock({},
GetScriptForRawPubKey(coinbaseKey.GetPubKey()));
74 std::vector<COutput> coins = available_coins.All();
76 std::set<COutPoint> preset_inputs = {coins[0].outpoint, coins[1].outpoint, coins[2].outpoint};
84 for (
const auto& outpoint : preset_inputs) {
85 coin_control.
Select(outpoint);
103 recipients[0].fSubtractFeeFromAmount =
false;
int64_t CAmount
Amount in satoshis (Can be negative)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
#define Assert(val)
Identity function.
std::optional< OutputType > m_change_type
Override the default change type if set, ignored if destChange is set.
PreselectedInput & Select(const COutPoint &outpoint)
Lock-in the given output for spending.
bool m_allow_other_inputs
If true, the selection process can add extra unselected inputs from the wallet while requires all sel...
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
std::optional< CFeeRate > m_feerate
Override the wallet's m_pay_tx_fee if set.
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
util::Result< CreatedTransactionResult > CreateTransaction(CWallet &wallet, const std::vector< CRecipient > &vecSend, std::optional< unsigned int > change_pos, const CCoinControl &coin_control, bool sign)
Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also cr...
BOOST_FIXTURE_TEST_CASE(wallet_coinsresult_test, BasicTestingSetup)
std::unique_ptr< CWallet > CreateSyncedWallet(interfaces::Chain &chain, CChain &cchain, const CKey &key)
CoinsResult AvailableCoins(const CWallet &wallet, const CCoinControl *coinControl, std::optional< CFeeRate > feerate, const CoinFilterParams ¶ms)
Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType.
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
std::unique_ptr< ChainstateManager > chainman
std::unique_ptr< interfaces::Chain > chain
#define WITH_LOCK(cs, code)
Run code while locking a mutex.