@@ -36,6 +36,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
36
36
// P2PK compressed
37
37
{
38
38
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
39
+ keystore.SetupLegacyScriptPubKeyMan ();
39
40
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
40
41
scriptPubKey = GetScriptForRawPubKey (pubkeys[0 ]);
41
42
@@ -52,6 +53,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
52
53
// P2PK uncompressed
53
54
{
54
55
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
56
+ keystore.SetupLegacyScriptPubKeyMan ();
55
57
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
56
58
scriptPubKey = GetScriptForRawPubKey (uncompressedPubkey);
57
59
@@ -68,6 +70,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
68
70
// P2PKH compressed
69
71
{
70
72
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
73
+ keystore.SetupLegacyScriptPubKeyMan ();
71
74
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
72
75
scriptPubKey = GetScriptForDestination (PKHash (pubkeys[0 ]));
73
76
@@ -84,6 +87,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
84
87
// P2PKH uncompressed
85
88
{
86
89
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
90
+ keystore.SetupLegacyScriptPubKeyMan ();
87
91
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
88
92
scriptPubKey = GetScriptForDestination (PKHash (uncompressedPubkey));
89
93
@@ -100,6 +104,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
100
104
// P2SH
101
105
{
102
106
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
107
+ keystore.SetupLegacyScriptPubKeyMan ();
103
108
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
104
109
105
110
CScript redeemScript = GetScriptForDestination (PKHash (pubkeys[0 ]));
@@ -123,6 +128,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
123
128
// (P2PKH inside) P2SH inside P2SH (invalid)
124
129
{
125
130
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
131
+ keystore.SetupLegacyScriptPubKeyMan ();
126
132
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
127
133
128
134
CScript redeemscript_inner = GetScriptForDestination (PKHash (pubkeys[0 ]));
@@ -140,6 +146,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
140
146
// (P2PKH inside) P2SH inside P2WSH (invalid)
141
147
{
142
148
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
149
+ keystore.SetupLegacyScriptPubKeyMan ();
143
150
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
144
151
145
152
CScript redeemscript = GetScriptForDestination (PKHash (pubkeys[0 ]));
@@ -157,6 +164,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
157
164
// P2WPKH inside P2WSH (invalid)
158
165
{
159
166
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
167
+ keystore.SetupLegacyScriptPubKeyMan ();
160
168
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
161
169
162
170
CScript witnessscript = GetScriptForDestination (WitnessV0KeyHash (PKHash (pubkeys[0 ])));
@@ -172,6 +180,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
172
180
// (P2PKH inside) P2WSH inside P2WSH (invalid)
173
181
{
174
182
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
183
+ keystore.SetupLegacyScriptPubKeyMan ();
175
184
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
176
185
177
186
CScript witnessscript_inner = GetScriptForDestination (PKHash (pubkeys[0 ]));
@@ -189,6 +198,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
189
198
// P2WPKH compressed
190
199
{
191
200
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
201
+ keystore.SetupLegacyScriptPubKeyMan ();
192
202
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
193
203
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
194
204
@@ -203,6 +213,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
203
213
// P2WPKH uncompressed
204
214
{
205
215
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
216
+ keystore.SetupLegacyScriptPubKeyMan ();
206
217
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
207
218
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (uncompressedKey));
208
219
@@ -221,6 +232,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
221
232
// scriptPubKey multisig
222
233
{
223
234
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
235
+ keystore.SetupLegacyScriptPubKeyMan ();
224
236
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
225
237
226
238
scriptPubKey = GetScriptForMultisig (2 , {uncompressedPubkey, pubkeys[1 ]});
@@ -251,6 +263,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
251
263
// P2SH multisig
252
264
{
253
265
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
266
+ keystore.SetupLegacyScriptPubKeyMan ();
254
267
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
255
268
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (uncompressedKey));
256
269
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[1 ]));
@@ -271,6 +284,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
271
284
// P2WSH multisig with compressed keys
272
285
{
273
286
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
287
+ keystore.SetupLegacyScriptPubKeyMan ();
274
288
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
275
289
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
276
290
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[1 ]));
@@ -296,6 +310,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
296
310
// P2WSH multisig with uncompressed key
297
311
{
298
312
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
313
+ keystore.SetupLegacyScriptPubKeyMan ();
299
314
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
300
315
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (uncompressedKey));
301
316
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[1 ]));
@@ -321,6 +336,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
321
336
// P2WSH multisig wrapped in P2SH
322
337
{
323
338
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
339
+ keystore.SetupLegacyScriptPubKeyMan ();
324
340
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
325
341
326
342
CScript witnessScript = GetScriptForMultisig (2 , {pubkeys[0 ], pubkeys[1 ]});
@@ -347,6 +363,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
347
363
// OP_RETURN
348
364
{
349
365
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
366
+ keystore.SetupLegacyScriptPubKeyMan ();
350
367
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
351
368
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
352
369
@@ -360,6 +377,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
360
377
// witness unspendable
361
378
{
362
379
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
380
+ keystore.SetupLegacyScriptPubKeyMan ();
363
381
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
364
382
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
365
383
@@ -373,6 +391,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
373
391
// witness unknown
374
392
{
375
393
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
394
+ keystore.SetupLegacyScriptPubKeyMan ();
376
395
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
377
396
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
378
397
@@ -386,6 +405,7 @@ BOOST_AUTO_TEST_CASE(ismine_standard)
386
405
// Nonstandard
387
406
{
388
407
CWallet keystore (chain.get (), WalletLocation (), WalletDatabase::CreateDummy ());
408
+ keystore.SetupLegacyScriptPubKeyMan ();
389
409
LOCK (keystore.GetLegacyScriptPubKeyMan ()->cs_KeyStore );
390
410
BOOST_CHECK (keystore.GetLegacyScriptPubKeyMan ()->AddKey (keys[0 ]));
391
411
0 commit comments