 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
7 #include <validation.h>
13 #include <boost/test/unit_test.hpp>
42 BOOST_CHECK_EQUAL(tx->vout[0].nValue, recipient.nAmount + leftover_input_amount - fee);
43 BOOST_CHECK_GT(fee, 0);
71 int64_t target_weight = EMPTY_INPUT_WEIGHT + additional_weight;
75 for (
unsigned int i = 0; i < expected_stack_sizes.size(); ++i) {
An input of a transaction.
bool FillInputToWeight(CTxIn &txin, int64_t target_weight)
std::shared_ptr< const CTransaction > CTransactionRef
#define BOOST_FIXTURE_TEST_SUITE(a, b)
BOOST_AUTO_TEST_SUITE_END()
std::shared_ptr< CWallet > wallet
CScriptWitness scriptWitness
Only serialized through CTransaction.
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
std::optional< OutputType > m_change_type
Override the default change type if set, ignored if destChange is set.
std::optional< CFeeRate > m_feerate
Override the wallet's m_pay_tx_fee if set.
int64_t CAmount
Amount in satoshis (Can be negative)
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
bool CreateTransaction(CWallet &wallet, const std::vector< CRecipient > &vecSend, CTransactionRef &tx, CAmount &nFeeRet, int &nChangePosInOut, bilingual_str &error, const CCoinControl &coin_control, FeeCalculation &fee_calc_out, bool sign)
Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also cr...
std::unique_ptr< CWallet > CreateSyncedWallet(interfaces::Chain &chain, CChain &cchain, ArgsManager &args, const CKey &key)
static int64_t GetTransactionInputWeight(const CTxIn &txin)
std::unique_ptr< ChainstateManager > chainman
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
bool error(const char *fmt, const Args &... args)
static constexpr CAmount COIN
The amount of satoshis in one BTC.
static void TestFillInputToWeight(int64_t additional_weight, std::vector< int64_t > expected_stack_sizes)
BOOST_FIXTURE_TEST_CASE(SubtractFee, TestChain100Setup)
#define BOOST_CHECK(expr)
std::vector< std::vector< unsigned char > > stack
#define BOOST_CHECK_EQUAL(v1, v2)
std::unique_ptr< interfaces::Chain > chain