Skip to content

Commit 5739c55

Browse files
committed
Bump min version to allow testing, fix scriptpubkey min version.
1 parent 38f2bda commit 5739c55

4 files changed

Lines changed: 81 additions & 41 deletions

File tree

include/bitcoin/server/protocols/protocol_electrum_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class BCS_API protocol_electrum_version
3838
using rpc_interface = interface::electrum;
3939

4040
static constexpr electrum::version minimum = electrum::version::v1_0;
41-
static constexpr electrum::version maximum = electrum::version::v1_6;
41+
static constexpr electrum::version maximum = electrum::version::v1_7;
4242

4343
inline protocol_electrum_version(const auto& session,
4444
const network::channel::ptr& channel,

src/protocols/electrum/protocol_electrum_scripts.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_get_balance(
4141
if (stopped(ec))
4242
return;
4343

44-
if (at_least(electrum::version::v1_7))
44+
if (!at_least(electrum::version::v1_7))
4545
{
4646
send_code(error::wrong_version);
4747
return;
@@ -71,7 +71,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_get_history(
7171
if (stopped(ec))
7272
return;
7373

74-
if (at_least(electrum::version::v1_7))
74+
if (!at_least(electrum::version::v1_7))
7575
{
7676
send_code(error::wrong_version);
7777
return;
@@ -101,7 +101,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_get_mempool(
101101
if (stopped(ec))
102102
return;
103103

104-
if (at_least(electrum::version::v1_7))
104+
if (!at_least(electrum::version::v1_7))
105105
{
106106
send_code(error::wrong_version);
107107
return;
@@ -131,7 +131,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_list_unspent(
131131
if (stopped(ec))
132132
return;
133133

134-
if (at_least(electrum::version::v1_7))
134+
if (!at_least(electrum::version::v1_7))
135135
{
136136
send_code(error::wrong_version);
137137
return;
@@ -161,7 +161,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_subscribe(
161161
if (stopped(ec))
162162
return;
163163

164-
if (at_least(electrum::version::v1_7))
164+
if (!at_least(electrum::version::v1_7))
165165
{
166166
send_code(error::wrong_version);
167167
return;
@@ -195,7 +195,7 @@ void protocol_electrum::handle_blockchain_scriptpubkey_unsubscribe(
195195
if (stopped(ec))
196196
return;
197197

198-
if (at_least(electrum::version::v1_7))
198+
if (!at_least(electrum::version::v1_7))
199199
{
200200
send_code(error::wrong_version);
201201
return;

test/protocols/electrum/electrum_scripts.cpp

Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BOOST_FIXTURE_TEST_SUITE(electrum_disabled_address_tests, electrum_disabled_addr
3434
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__no_address_index__not_implemented)
3535
{
3636
BOOST_REQUIRE(!query_.address_enabled());
37-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
37+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
3838

3939
const auto request = R"({"id":901,"method":"blockchain.scriptpubkey.get_balance","params":["%1%"]})" "\n";
4040
const auto response = get((boost::format(request) % bogus_script).str());
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__no_address_i
4545
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__no_address_index__not_implemented)
4646
{
4747
BOOST_REQUIRE(!query_.address_enabled());
48-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
48+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
4949

5050
const auto request = R"({"id":1001,"method":"blockchain.scriptpubkey.get_history","params":["%1%"]})" "\n";
5151
const auto response = get((boost::format(request) % bogus_script).str());
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__no_address_i
5656
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__no_address_index__not_implemented)
5757
{
5858
BOOST_REQUIRE(!query_.address_enabled());
59-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
59+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
6060

6161
const auto request = R"({"id":1001,"method":"blockchain.scriptpubkey.get_mempool","params":["%1%"]})" "\n";
6262
const auto response = get((boost::format(request) % bogus_script).str());
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__no_address_i
6767
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__no_address_index__not_implemented)
6868
{
6969
BOOST_REQUIRE(!query_.address_enabled());
70-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
70+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
7171

7272
const auto request = R"({"id":1001,"method":"blockchain.scriptpubkey.listunspent","params":["%1%"]})" "\n";
7373
const auto response = get((boost::format(request) % bogus_script).str());
@@ -84,16 +84,25 @@ BOOST_FIXTURE_TEST_SUITE(electrum_tests, electrum_ten_block_setup_fixture)
8484
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__missing_arguments__dropped)
8585
{
8686
BOOST_REQUIRE(query_.address_enabled());
87-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
87+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
8888

8989
const auto response = get(R"({"id":901,"method":"blockchain.scriptpubkey.get_balance","params":[]})" "\n");
9090
REQUIRE_NO_THROW_TRUE(response.at("dropped").as_bool());
9191
}
9292

93+
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__insufficient_version__dropped)
94+
{
95+
BOOST_REQUIRE(handshake(electrum::version::v1_6));
96+
97+
const auto response = get(R"({"id":902,"method":"blockchain.scriptpubkey.get_balance","params":[""]})" "\n");
98+
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
99+
BOOST_REQUIRE_EQUAL(response.at("error").as_object().at("code").as_int64(), wrong_version.value());
100+
}
101+
93102
// Not yet.
94-
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__empty_v1_7__wrong_version)
103+
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__obsoleted_version__wrong_version)
95104
////{
96-
//// BOOST_REQUIRE(handshake(electrum::version::v1_7));
105+
//// BOOST_REQUIRE(handshake(electrum::version::v1_8));
97106
////
98107
//// const auto response = get(R"({"id":902,"method":"blockchain.scriptpubkey.get_balance","params":[""]})" "\n");
99108
//// REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -102,7 +111,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__missing_argu
102111

103112
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__invalid_address__invalid_argument)
104113
{
105-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
114+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
106115

107116
const auto response = get(R"({"id":903,"method":"blockchain.scriptpubkey.get_balance","params":["invalid"]})" "\n");
108117
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -111,7 +120,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__invalid_addr
111120

112121
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__not_found_address__zero)
113122
{
114-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
123+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
115124

116125
const auto request = R"({"id":904,"method":"blockchain.scriptpubkey.get_balance","params":["%1%"]})" "\n";
117126
const auto response = get((boost::format(request) % bogus_script).str());
@@ -126,7 +135,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__not_found_ad
126135

127136
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__confirmed_and_unconfirmed_address__expected)
128137
{
129-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
138+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
130139

131140
// Add one confirmed p2sh/p2kh block and one unconfirmed.
132141
BOOST_REQUIRE(query_.set(test::bogus_block10, database::context{ 0, 10, 0 }, false, false));
@@ -152,16 +161,25 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_balance__confirmed_an
152161
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__missing_arguments__dropped)
153162
{
154163
BOOST_REQUIRE(query_.address_enabled());
155-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
164+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
156165

157166
const auto response = get(R"({"id":1002,"method":"blockchain.scriptpubkey.get_history","params":[]})" "\n");
158167
REQUIRE_NO_THROW_TRUE(response.at("dropped").as_bool());
159168
}
160169

170+
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__insufficient_version__dropped)
171+
{
172+
BOOST_REQUIRE(handshake(electrum::version::v1_6));
173+
174+
const auto response = get(R"({"id":902,"method":"blockchain.scriptpubkey.get_history","params":[""]})" "\n");
175+
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
176+
BOOST_REQUIRE_EQUAL(response.at("error").as_object().at("code").as_int64(), wrong_version.value());
177+
}
178+
161179
// Not yet.
162-
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__empty_v1_7__wrong_version)
180+
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__obsoleted_version__wrong_version)
163181
////{
164-
//// BOOST_REQUIRE(handshake(electrum::version::v1_7));
182+
//// BOOST_REQUIRE(handshake(electrum::version::v1_8));
165183
////
166184
//// const auto response = get(R"({"id":1003,"method":"blockchain.scriptpubkey.get_history","params":[""]})" "\n");
167185
//// REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -170,7 +188,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__missing_argu
170188

171189
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__invalid_address__invalid_argument)
172190
{
173-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
191+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
174192

175193
const auto response = get(R"({"id":1004,"method":"blockchain.scriptpubkey.get_history","params":["invalid"]})" "\n");
176194
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -179,7 +197,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__invalid_addr
179197

180198
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__not_found_address__empty)
181199
{
182-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
200+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
183201

184202
const auto request = R"({"id":1005,"method":"blockchain.scriptpubkey.get_history","params":["%1%"]})" "\n";
185203
const auto response = get((boost::format(request) % bogus_script).str());
@@ -188,7 +206,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__not_found_ad
188206

189207
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__confirmed_and_unconfirmed_address__expected)
190208
{
191-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
209+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
192210

193211
// Add one confirmed p2sh/p2kh block and one unconfirmed (mirrors the get_balance confirmed test).
194212
BOOST_REQUIRE(query_.set(test::bogus_block10, database::context{ 0, 10, 0 }, false, false));
@@ -207,20 +225,23 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__confirmed_an
207225
const auto& tx1 = history.at(0).as_object();
208226
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
209227
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
228+
BOOST_CHECK(!tx1.contains("fee"));
210229
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 10);
211230
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
212231

213232
const auto hash2 = test::bogus_block11.transactions_ptr()->at(0)->hash(false);
214233
const auto& tx2 = history.at(1).as_object();
215234
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
216235
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
236+
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
217237
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), 0); // rooted
218238
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
219239

220240
const auto hash3 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
221241
const auto& tx3 = history.at(2).as_object();
222242
REQUIRE_NO_THROW_TRUE(tx3.at("height").is_int64());
223243
REQUIRE_NO_THROW_TRUE(tx3.at("tx_hash").is_string());
244+
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
224245
BOOST_REQUIRE_EQUAL(tx3.at("height").as_int64(), -1); // not rooted
225246
BOOST_REQUIRE_EQUAL(tx3.at("tx_hash").as_string(), encode_hash(hash3));
226247
}
@@ -230,16 +251,25 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_history__confirmed_an
230251
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__missing_arguments__dropped)
231252
{
232253
BOOST_REQUIRE(query_.address_enabled());
233-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
254+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
234255

235256
const auto response = get(R"({"id":1002,"method":"blockchain.scriptpubkey.get_mempool","params":[]})" "\n");
236257
REQUIRE_NO_THROW_TRUE(response.at("dropped").as_bool());
237258
}
238259

260+
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__insufficient_version__dropped)
261+
{
262+
BOOST_REQUIRE(handshake(electrum::version::v1_6));
263+
264+
const auto response = get(R"({"id":902,"method":"blockchain.scriptpubkey.get_mempool","params":[""]})" "\n");
265+
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
266+
BOOST_REQUIRE_EQUAL(response.at("error").as_object().at("code").as_int64(), wrong_version.value());
267+
}
268+
239269
// Not yet.
240-
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__empty_v1_7__wrong_version)
270+
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__obsoleted_version__wrong_version)
241271
////{
242-
//// BOOST_REQUIRE(handshake(electrum::version::v1_7));
272+
//// BOOST_REQUIRE(handshake(electrum::version::v1_8));
243273
////
244274
//// const auto response = get(R"({"id":1003,"method":"blockchain.scriptpubkey.get_mempool","params":[""]})" "\n");
245275
//// REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -248,7 +278,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__missing_argu
248278

249279
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__invalid_address__invalid_argument)
250280
{
251-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
281+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
252282

253283
const auto response = get(R"({"id":1004,"method":"blockchain.scriptpubkey.get_mempool","params":["invalid"]})" "\n");
254284
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -257,7 +287,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__invalid_addr
257287

258288
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__not_found_address__empty)
259289
{
260-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
290+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
261291

262292
const auto request = R"({"id":1005,"method":"blockchain.scriptpubkey.get_mempool","params":["%1%"]})" "\n";
263293
const auto response = get((boost::format(request) % bogus_script).str());
@@ -266,7 +296,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__not_found_ad
266296

267297
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__confirmed_and_unconfirmed_address__expected)
268298
{
269-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
299+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
270300

271301
// Add one confirmed p2sh/p2kh block and one unconfirmed (mirrors the get_balance confirmed test).
272302
BOOST_REQUIRE(query_.set(test::bogus_block10, database::context{ 0, 10, 0 }, false, false));
@@ -285,13 +315,14 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__confirmed_an
285315
const auto& tx1 = history.at(0).as_object();
286316
REQUIRE_NO_THROW_TRUE(tx1.at("height").is_int64());
287317
REQUIRE_NO_THROW_TRUE(tx1.at("tx_hash").is_string());
288-
BOOST_REQUIRE_EQUAL(tx1.at("height").as_int64(), 0); // rooted
318+
BOOST_CHECK_EQUAL(tx1.at("fee").as_int64(), floored_subtract(5'000'000'000 + 5'000'000'000, 0x10 + 0x11 + 0x12 + 0x13 + 0x14));
289319
BOOST_REQUIRE_EQUAL(tx1.at("tx_hash").as_string(), encode_hash(hash1));
290320

291321
const auto hash2 = test::bogus_block12.transactions_ptr()->at(0)->hash(false);
292322
const auto& tx2 = history.at(1).as_object();
293323
REQUIRE_NO_THROW_TRUE(tx2.at("height").is_int64());
294324
REQUIRE_NO_THROW_TRUE(tx2.at("tx_hash").is_string());
325+
BOOST_CHECK_EQUAL(tx2.at("fee").as_int64(), floored_subtract(0x10 + 0x11, 0x0a));
295326
BOOST_REQUIRE_EQUAL(tx2.at("height").as_int64(), -1); // not rooted
296327
BOOST_REQUIRE_EQUAL(tx2.at("tx_hash").as_string(), encode_hash(hash2));
297328
}
@@ -301,16 +332,25 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_get_mempool__confirmed_an
301332
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__missing_arguments__dropped)
302333
{
303334
BOOST_REQUIRE(query_.address_enabled());
304-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
335+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
305336

306337
const auto response = get(R"({"id":1002,"method":"blockchain.scriptpubkey.listunspent","params":[]})" "\n");
307338
REQUIRE_NO_THROW_TRUE(response.at("dropped").as_bool());
308339
}
309340

341+
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__insufficient_version__dropped)
342+
{
343+
BOOST_REQUIRE(handshake(electrum::version::v1_6));
344+
345+
const auto response = get(R"({"id":902,"method":"blockchain.scriptpubkey.listunspent","params":[""]})" "\n");
346+
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
347+
BOOST_REQUIRE_EQUAL(response.at("error").as_object().at("code").as_int64(), wrong_version.value());
348+
}
349+
310350
// Not yet.
311-
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__empty_v1_7__wrong_version)
351+
////BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__obsoleted_version__wrong_version)
312352
////{
313-
//// BOOST_REQUIRE(handshake(electrum::version::v1_7));
353+
//// BOOST_REQUIRE(handshake(electrum::version::v1_8));
314354
////
315355
//// const auto response = get(R"({"id":1003,"method":"blockchain.scriptpubkey.listunspent","params":[""]})" "\n");
316356
//// REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -319,7 +359,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__missing_arg
319359

320360
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__invalid_address__invalid_argument)
321361
{
322-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
362+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
323363

324364
const auto response = get(R"({"id":1004,"method":"blockchain.scriptpubkey.listunspent","params":["invalid"]})" "\n");
325365
REQUIRE_NO_THROW_TRUE(response.at("error").as_object().at("code").is_int64());
@@ -328,7 +368,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__invalid_add
328368

329369
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__not_found_address__empty)
330370
{
331-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
371+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
332372

333373
const auto request = R"({"id":1005,"method":"blockchain.scriptpubkey.listunspent","params":["%1%"]})" "\n";
334374
const auto response = get((boost::format(request) % bogus_script).str());
@@ -337,7 +377,7 @@ BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__not_found_a
337377

338378
BOOST_AUTO_TEST_CASE(electrum__blockchain_scriptpubkey_list_unspent__confirmed_and_unconfirmed_address__expected)
339379
{
340-
BOOST_REQUIRE(handshake(electrum::version::v1_1));
380+
BOOST_REQUIRE(handshake(electrum::version::v1_7));
341381

342382
// Add one confirmed p2sh/p2kh block and one unconfirmed (mirrors the get_balance confirmed test).
343383
BOOST_REQUIRE(query_.set(test::bogus_block10, database::context{ 0, 10, 0 }, false, false));

0 commit comments

Comments
 (0)