nit in 78897500676f7ab1b197da56c0a676efcb49ec41 : I guess there is no real risk in having them public, due to the types involved, but if you wanted to make them protected, it could be done with this diff:
0diff --git a/src/wallet/sqlite.h b/src/wallet/sqlite.h
1index 57876bd83c..ce703f8f13 100644
2--- a/src/wallet/sqlite.h
3+++ b/src/wallet/sqlite.h
4@@ -75,6 +75,14 @@ private:
5 void SetupSQLStatements();
6 bool ExecStatement(sqlite3_stmt* stmt, std::span<const std::byte> blob);
7
8+protected:
9+
10+ bool ReadKey(DataStream&& key, DataStream& value) override;
11+ bool WriteKey(DataStream&& key, DataStream&& value, bool overwrite = true) override;
12+ bool EraseKey(DataStream&& key) override;
13+ bool HasKey(DataStream&& key) override;
14+ bool ErasePrefix(std::span<const std::byte> prefix) override;
15+
16 public:
17 explicit SQLiteBatch(SQLiteDatabase& database);
18 ~SQLiteBatch() override { Close(); }
19@@ -89,14 +97,6 @@ public:
20 bool TxnCommit() override;
21 bool TxnAbort() override;
22 bool HasActiveTxn() override { return m_txn; }
23-
24- // DO NOT CALL DIRECTLY, use DatabaseBatch::Read, Write, Erase, Exists, and ErasePrefix.
25- // These functions are public for testing only.
26- bool ReadKey(DataStream&& key, DataStream& value) override;
27- bool WriteKey(DataStream&& key, DataStream&& value, bool overwrite = true) override;
28- bool EraseKey(DataStream&& key) override;
29- bool HasKey(DataStream&& key) override;
30- bool ErasePrefix(std::span<const std::byte> prefix) override;
31 };
32
33 /** An instance of this class represents one SQLite3 database.
34diff --git a/src/wallet/test/util.cpp b/src/wallet/test/util.cpp
35index 5162baed9f..95255b7062 100644
36--- a/src/wallet/test/util.cpp
37+++ b/src/wallet/test/util.cpp
38@@ -79,6 +79,10 @@ void TestUnloadWallet(std::shared_ptr<CWallet>&& wallet)
39 WaitForDeleteWallet(std::move(wallet));
40 }
41
42+struct SQLiteBatchTest:public SQLiteBatch{
43+using SQLiteBatch::WriteKey;
44+};
45+
46 std::unique_ptr<WalletDatabase> DuplicateMockDatabase(WalletDatabase& database)
47 {
48 std::unique_ptr<DatabaseBatch> batch_orig = database.MakeBatch();
49@@ -86,7 +90,7 @@ std::unique_ptr<WalletDatabase> DuplicateMockDatabase(WalletDatabase& database)
50
51 std::unique_ptr<WalletDatabase> new_db = CreateMockableWalletDatabase();
52 std::unique_ptr<DatabaseBatch> new_db_batch = new_db->MakeBatch();
53- SQLiteBatch* batch_new = dynamic_cast<SQLiteBatch*>(new_db_batch.get());
54+ auto* batch_new = dynamic_cast<SQLiteBatchTest*>(new_db_batch.get());
55 Assert(batch_new);
56
57 while (true) {