v30.3-roots.1 · Commit 4: [PATCH 04/68] fix(wallet): preserve Roots database hardening on Core 30.3
src/wallet/test/wallet_tests.cpp
Before: src/wallet/test/wallet_tests.cpp · After: src/wallet/test/wallet_tests.cpp
File metadata
index bcff25931a3efe7472311704317b5146f45991a7..b46f8eaff14d250a6bc1c75ee567f11f2bf4a4c5 100644
Download original patch · Release notes
Diff rows 1–23 of 23. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/wallet/test/wallet_tests.cpp
CHANGED
|
@@ -615,9 +615,10 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
|
|
| 615 |
});
|
| 616 |
std::string error;
|
| 617 |
m_coinbase_txns.push_back(CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 618 |
-
auto block_tx = TestSimpleSpend(*m_coinbase_txns[0], 0, coinbaseKey, GetScriptForRawPubKey(key.GetPubKey()));
|
|
|
|
| 619 |
m_coinbase_txns.push_back(CreateAndProcessBlock({block_tx}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 620 |
-
auto mempool_tx = TestSimpleSpend(*m_coinbase_txns[1], 0, coinbaseKey, GetScriptForRawPubKey(key.GetPubKey()));
|
| 621 |
BOOST_CHECK(m_node.chain->broadcastTransaction(MakeTransactionRef(mempool_tx), DEFAULT_TRANSACTION_MAXFEE, false, error));
|
| 622 |
|
| 623 |
|
|
@@ -657,9 +658,9 @@ BOOST_FIXTURE_TEST_CASE(CreateWallet, TestChain100Setup)
|
|
| 657 |
auto handler = HandleLoadWallet(context, [&](std::unique_ptr<interfaces::Wallet> wallet) {
|
| 658 |
BOOST_CHECK(rescan_completed);
|
| 659 |
m_coinbase_txns.push_back(CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 660 |
-
block_tx = TestSimpleSpend(*m_coinbase_txns[2], 0, coinbaseKey, GetScriptForRawPubKey(key.GetPubKey()));
|
| 661 |
m_coinbase_txns.push_back(CreateAndProcessBlock({block_tx}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 662 |
-
mempool_tx = TestSimpleSpend(*m_coinbase_txns[3], 0, coinbaseKey, GetScriptForRawPubKey(key.GetPubKey()));
|
| 663 |
BOOST_CHECK(m_node.chain->broadcastTransaction(MakeTransactionRef(mempool_tx), DEFAULT_TRANSACTION_MAXFEE, false, error));
|
| 664 |
m_node.validation_signals->SyncWithValidationInterfaceQueue();
|
| 665 |
});
|
|
|
|
| 615 |
});
|
| 616 |
std::string error;
|
| 617 |
m_coinbase_txns.push_back(CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 618 |
+
const CScript wallet_script{GetScriptForDestination(PKHash{key.GetPubKey()})};
|
| 619 |
+
auto block_tx = TestSimpleSpend(*m_coinbase_txns[0], 0, coinbaseKey, wallet_script);
|
| 620 |
m_coinbase_txns.push_back(CreateAndProcessBlock({block_tx}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 621 |
+
auto mempool_tx = TestSimpleSpend(*m_coinbase_txns[1], 0, coinbaseKey, wallet_script);
|
| 622 |
BOOST_CHECK(m_node.chain->broadcastTransaction(MakeTransactionRef(mempool_tx), DEFAULT_TRANSACTION_MAXFEE, false, error));
|
| 623 |
|
| 624 |
|
|
|
|
| 658 |
auto handler = HandleLoadWallet(context, [&](std::unique_ptr<interfaces::Wallet> wallet) {
|
| 659 |
BOOST_CHECK(rescan_completed);
|
| 660 |
m_coinbase_txns.push_back(CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 661 |
+
block_tx = TestSimpleSpend(*m_coinbase_txns[2], 0, coinbaseKey, wallet_script);
|
| 662 |
m_coinbase_txns.push_back(CreateAndProcessBlock({block_tx}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);
|
| 663 |
+
mempool_tx = TestSimpleSpend(*m_coinbase_txns[3], 0, coinbaseKey, wallet_script);
|
| 664 |
BOOST_CHECK(m_node.chain->broadcastTransaction(MakeTransactionRef(mempool_tx), DEFAULT_TRANSACTION_MAXFEE, false, error));
|
| 665 |
m_node.validation_signals->SyncWithValidationInterfaceQueue();
|
| 666 |
});
|