|
4 | 4 |
|
5 | 5 | #include <test/data/bip341_wallet_vectors.json.h>
|
6 | 6 |
|
| 7 | +#include <addresstype.h> |
7 | 8 | #include <key.h>
|
8 | 9 | #include <key_io.h>
|
9 | 10 | #include <script/script.h>
|
@@ -130,9 +131,8 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_success)
|
130 | 131 | BOOST_CHECK(solutions[1] == ToByteVector(uint256::ONE));
|
131 | 132 |
|
132 | 133 | // TxoutType::ANCHOR
|
133 |
| - std::vector<unsigned char> anchor_bytes{0x4e, 0x73}; |
134 | 134 | s.clear();
|
135 |
| - s << OP_1 << anchor_bytes; |
| 135 | + s << OP_1 << ANCHOR_BYTES; |
136 | 136 | BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::ANCHOR);
|
137 | 137 | BOOST_CHECK(solutions.empty());
|
138 | 138 |
|
@@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE(script_standard_Solver_failure)
|
212 | 212 |
|
213 | 213 | // TxoutType::ANCHOR but wrong witness version
|
214 | 214 | s.clear();
|
215 |
| - s << OP_2 << std::vector<unsigned char>{0x4e, 0x73}; |
| 215 | + s << OP_2 << ANCHOR_BYTES; |
216 | 216 | BOOST_CHECK(!s.IsPayToAnchor());
|
217 | 217 | BOOST_CHECK_EQUAL(Solver(s, solutions), TxoutType::WITNESS_UNKNOWN);
|
218 | 218 |
|
@@ -284,9 +284,8 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
284 | 284 | BOOST_CHECK(std::get<WitnessV1Taproot>(address) == WitnessV1Taproot(xpk));
|
285 | 285 |
|
286 | 286 | // TxoutType::ANCHOR
|
287 |
| - std::vector<unsigned char> anchor_bytes{0x4e, 0x73}; |
288 | 287 | s.clear();
|
289 |
| - s << OP_1 << anchor_bytes; |
| 288 | + s << OP_1 << ANCHOR_BYTES; |
290 | 289 | BOOST_CHECK(ExtractDestination(s, address));
|
291 | 290 | BOOST_CHECK(std::get<PayToAnchor>(address) == PayToAnchor());
|
292 | 291 |
|
@@ -379,9 +378,8 @@ BOOST_AUTO_TEST_CASE(script_standard_GetScriptFor_)
|
379 | 378 | BOOST_CHECK(result == expected);
|
380 | 379 |
|
381 | 380 | // PayToAnchor
|
382 |
| - std::vector<unsigned char> anchor_bytes{0x4e, 0x73}; |
383 | 381 | expected.clear();
|
384 |
| - expected << OP_1 << anchor_bytes; |
| 382 | + expected << OP_1 << ANCHOR_BYTES; |
385 | 383 | result = GetScriptForDestination(PayToAnchor());
|
386 | 384 | BOOST_CHECK(result == expected);
|
387 | 385 | }
|
|
0 commit comments