Use Txid in COutpoint

This commit is contained in:
dergoegge committed 2023-11-21 13:15:44 +00:00
1 parent d752349029
commit 9e58c5bcd9
48 files changed
+124 -114

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ static void CheckMaxWeightComputation(const std::string& script_str, const std::
{
std::vector script_data(ParseHex(script_str));
CScript script(script_data.begin(), script_data.end());
CTxIn input(uint256(), 0, script);
CTxIn input(Txid{}, 0, script);
for (const auto& s : witness_str_stack) {
input.scriptWitness.stack.push_back(ParseHex(s));
+1 -1
View File
@@ -100,7 +100,7 @@ FUZZ_TARGET(wallet_notifications, .init = initialize_setup)
// Add the initial entry
chain.emplace_back();
auto& [coins, block]{chain.back()};
coins.emplace(total_amount, COutPoint{uint256::ONE, 1});
coins.emplace(total_amount, COutPoint{Txid::FromUint256(uint256::ONE), 1});
}
LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 200)
{
+3 -3
View File
@@ -946,7 +946,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestingSetup)
CMutableTransaction mtx;
mtx.vout.emplace_back(COIN, GetScriptForDestination(op_dest));
mtx.vin.emplace_back(g_insecure_rand_ctx.rand256(), 0);
mtx.vin.emplace_back(Txid::FromUint256(g_insecure_rand_ctx.rand256()), 0);
const auto& tx_id_to_spend = wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInMempool{})->GetHash();
{
@@ -963,12 +963,12 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestingSetup)
mtx.vin.clear();
mtx.vin.emplace_back(tx_id_to_spend, 0);
wallet.transactionAddedToMempool(MakeTransactionRef(mtx));
const auto good_tx_id{mtx.GetHash().ToUint256()};
const auto good_tx_id{mtx.GetHash()};
{
// Verify balance update for the new tx and the old one
LOCK(wallet.cs_wallet);
const CWalletTx* new_wtx = wallet.GetWalletTx(good_tx_id);
const CWalletTx* new_wtx = wallet.GetWalletTx(good_tx_id.ToUint256());
BOOST_CHECK_EQUAL(CachedTxGetAvailableCredit(wallet, *new_wtx), 1 * COIN);
// Now the old wtx