bitcoin-util-test.json raw
1 [
2 { "exec": "./bitcoin-util",
3 "args": ["foo"],
4 "return_code": 1,
5 "error_txt": "Error parsing command line arguments: Invalid command 'foo'",
6 "description": ""
7 },
8 { "exec": "./bitcoin-util",
9 "args": ["help"],
10 "return_code": 1,
11 "error_txt": "Error parsing command line arguments: Invalid command 'help'",
12 "description": "`help` raises an error. Use `-help`"
13 },
14 { "exec": "./bitcoin-util",
15 "args": ["grind"],
16 "return_code": 1,
17 "error_txt": "Must specify block header to grind",
18 "description": ""
19 },
20 { "exec": "./bitcoin-util",
21 "args": ["grind", "1", "2"],
22 "return_code": 1,
23 "error_txt": "Must specify block header to grind",
24 "description": ""
25 },
26 { "exec": "./bitcoin-util",
27 "args": ["grind", "aa"],
28 "return_code": 1,
29 "error_txt": "Could not decode block header",
30 "description": ""
31 },
32 {
33 "exec": "./bitcoin-util",
34 "args": ["netmagic"],
35 "return_code": 0,
36 "output_cmp": "netmagic-mainnet.hex",
37 "description": "netmagic returns mainnet magic bytes"
38 },
39 {
40 "exec": "./bitcoin-util",
41 "args": ["-regtest", "netmagic"],
42 "return_code": 0,
43 "output_cmp": "netmagic-regtest.hex",
44 "description": "netmagic returns regtest magic bytes"
45 },
46 {
47 "exec": "./bitcoin-util",
48 "args": ["-testnet", "netmagic"],
49 "return_code": 0,
50 "output_cmp": "netmagic-testnet.hex",
51 "description": "netmagic returns testnet magic bytes"
52 },
53 {
54 "exec": "./bitcoin-util",
55 "args": ["-testnet4", "netmagic"],
56 "return_code": 0,
57 "output_cmp": "netmagic-testnet4.hex",
58 "description": "netmagic returns testnet4 magic bytes"
59 },
60 {
61 "exec": "./bitcoin-util",
62 "args": ["-signet", "netmagic"],
63 "return_code": 0,
64 "output_cmp": "netmagic-signet.hex",
65 "description": "netmagic returns signet magic bytes"
66 },
67 {
68 "exec": "./bitcoin-util",
69 "args": ["-signet", "-signetchallenge=512102f7561d208dd9ae99bf497273e16f389bdbd6c4742ddb8e6b216e64fa2928ad8f51ae", "netmagic"],
70 "return_code": 0,
71 "output_cmp": "netmagic-signet-custom.hex",
72 "description": "netmagic returns custom signet magic bytes"
73 },
74 {
75 "exec": "./bitcoin-util",
76 "args": ["netmagic", "extra_arg"],
77 "return_code": 1,
78 "error_txt": "netmagic does not take arguments",
79 "description": "netmagic rejects extra arguments"
80 },
81 { "exec": "./bitcoin-tx",
82 "args": ["-create", "nversion=1"],
83 "output_cmp": "blanktxv1.hex",
84 "description": "Creates a blank v1 transaction"
85 },
86 { "exec": "./bitcoin-tx",
87 "args": ["-json","-create", "nversion=1"],
88 "output_cmp": "blanktxv1.json",
89 "description": "Creates a blank v1 transaction (output in json)"
90 },
91 { "exec": "./bitcoin-tx",
92 "args": ["-"],
93 "input": "blanktxv2.hex",
94 "output_cmp": "blanktxv2.hex",
95 "description": "Creates a blank transaction when nothing is piped into bitcoin-tx"
96 },
97 { "exec": "./bitcoin-tx",
98 "args": ["-json","-create"],
99 "output_cmp": "blanktxv2.json",
100 "description": "Creates a blank transaction (output in json)"
101 },
102 { "exec": "./bitcoin-tx",
103 "args": ["-json","-"],
104 "input": "blanktxv2.hex",
105 "output_cmp": "blanktxv2.json",
106 "description": "Creates a blank transaction when nothing is piped into bitcoin-tx (output in json)"
107 },
108 { "exec": "./bitcoin-tx",
109 "args": ["-create", "nversion=+1"],
110 "return_code": 1,
111 "error_txt": "error: Invalid TX version requested",
112 "description": "Tests the check for invalid nversion value"
113 },
114 { "exec": "./bitcoin-tx",
115 "args": ["-create", "nversion=1foo"],
116 "return_code": 1,
117 "error_txt": "error: Invalid TX version requested",
118 "description": "Tests the check for invalid nversion value"
119 },
120 { "exec": "./bitcoin-tx",
121 "args": ["-", "delin=1"],
122 "input": "tx394b54bb.hex",
123 "output_cmp": "tt-delin1-out.hex",
124 "description": "Deletes a single input from a transaction"
125 },
126 { "exec": "./bitcoin-tx",
127 "args": ["-json", "-", "delin=1"],
128 "input": "tx394b54bb.hex",
129 "output_cmp": "tt-delin1-out.json",
130 "description": "Deletes a single input from a transaction (output in json)"
131 },
132 { "exec": "./bitcoin-tx",
133 "args": ["-", "delin=31"],
134 "input": "tx394b54bb.hex",
135 "return_code": 1,
136 "error_txt": "error: Invalid TX input index '31'",
137 "description": "Attempts to delete an input with a bad index from a transaction. Expected to fail."
138 },
139 { "exec": "./bitcoin-tx",
140 "args": ["-", "delin=1foo"],
141 "input": "tx394b54bb.hex",
142 "return_code": 1,
143 "error_txt": "error: Invalid TX input index",
144 "description": "Tests the check for an invalid input index with delin"
145 },
146 { "exec": "./bitcoin-tx",
147 "args": ["-", "delout=1"],
148 "input": "tx394b54bb.hex",
149 "output_cmp": "tt-delout1-out.hex",
150 "description": "Deletes a single output from a transaction"
151 },
152 { "exec": "./bitcoin-tx",
153 "args": ["-json", "-", "delout=1"],
154 "input": "tx394b54bb.hex",
155 "output_cmp": "tt-delout1-out.json",
156 "description": "Deletes a single output from a transaction (output in json)"
157 },
158 { "exec": "./bitcoin-tx",
159 "args": ["-", "delout=2"],
160 "input": "tx394b54bb.hex",
161 "return_code": 1,
162 "error_txt": "error: Invalid TX output index '2'",
163 "description": "Attempts to delete an output with a bad index from a transaction. Expected to fail."
164 },
165 { "exec": "./bitcoin-tx",
166 "args": ["-", "delout=1foo"],
167 "input": "tx394b54bb.hex",
168 "return_code": 1,
169 "error_txt": "error: Invalid TX output index",
170 "description": "Tests the check for an invalid output index with delout"
171 },
172 { "exec": "./bitcoin-tx",
173 "args": ["-", "locktime=317000"],
174 "input": "tx394b54bb.hex",
175 "output_cmp": "tt-locktime317000-out.hex",
176 "description": "Adds an nlocktime to a transaction"
177 },
178 { "exec": "./bitcoin-tx",
179 "args": ["-json", "-", "locktime=317000"],
180 "input": "tx394b54bb.hex",
181 "output_cmp": "tt-locktime317000-out.json",
182 "description": "Adds an nlocktime to a transaction (output in json)"
183 },
184 { "exec": "./bitcoin-tx",
185 "args": ["-create", "locktime=+317"],
186 "return_code": 1,
187 "error_txt": "error: Invalid TX locktime requested",
188 "description": "Tests the check for invalid locktime value"
189 },
190 { "exec": "./bitcoin-tx",
191 "args": ["-create", "locktime=317000foo"],
192 "return_code": 1,
193 "error_txt": "error: Invalid TX locktime requested",
194 "description": "Tests the check for invalid locktime value"
195 },
196 { "exec": "./bitcoin-tx",
197 "args":
198 ["-create",
199 "in=Z897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0"],
200 "return_code": 1,
201 "error_txt": "error: invalid TX input txid",
202 "description": "Tests the check for an invalid txid invalid hex"
203 },
204 { "exec": "./bitcoin-tx",
205 "args":
206 ["-create",
207 "in=5897de6bd6:0"],
208 "return_code": 1,
209 "error_txt": "error: invalid TX input txid",
210 "description": "Tests the check for an invalid txid valid hex but too short"
211 },
212 { "exec": "./bitcoin-tx",
213 "args":
214 ["-create",
215 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f12:0"],
216 "return_code": 1,
217 "error_txt": "error: invalid TX input txid",
218 "description": "Tests the check for an invalid txid valid hex but too long"
219 },
220 { "exec": "./bitcoin-tx",
221 "args":
222 ["-create",
223 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
224 "replaceable=0foo"],
225 "return_code": 1,
226 "error_txt": "error: Invalid TX input index",
227 "description": "Tests the check for an invalid string input index with replaceable"
228 },
229 { "exec": "./bitcoin-tx",
230 "args":
231 ["-create",
232 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
233 "replaceable=+0"],
234 "return_code": 1,
235 "error_txt": "error: Invalid TX input index",
236 "description": "Tests the check for an invalid string input index with replaceable"
237 },
238 {
239 "exec": "./bitcoin-tx",
240 "args":
241 ["-create",
242 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
243 "replaceable=-1"],
244 "return_code": 1,
245 "error_txt": "error: Invalid TX input index",
246 "description": "Tests the check for an invalid negative input index with replaceable"
247 },
248 {
249 "exec": "./bitcoin-tx",
250 "args":
251 ["-create",
252 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
253 "replaceable=1"],
254 "return_code": 1,
255 "error_txt": "error: Invalid TX input index",
256 "description": "Tests the check for an invalid positive out-of-bounds input index with replaceable"
257 },
258 {
259 "exec": "./bitcoin-tx",
260 "args":
261 ["-create",
262 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
263 "replaceable=0"],
264 "output_cmp": "txreplacesingleinput.hex",
265 "description": "Tests that the 'SEQUENCE' value for a single input is set to fdffffff for single input"
266 },
267 {
268 "exec": "./bitcoin-tx",
269 "args":
270 ["-create",
271 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
272 "replaceable="],
273 "output_cmp": "txreplacesingleinput.hex",
274 "description": "Tests that the 'SEQUENCE' value for a single input is set to fdffffff when N omitted"
275 },
276 {
277 "exec": "./bitcoin-tx",
278 "args":
279 ["-create",
280 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
281 "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
282 "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1",
283 "replaceable=1"],
284 "output_cmp": "txreplace1.hex",
285 "description": "Tests that only the 'SEQUENCE' value of input[1] is set to fdffffff"
286 },
287 {
288 "exec": "./bitcoin-tx",
289 "args":
290 ["-create",
291 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
292 "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
293 "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1",
294 "replaceable="],
295 "output_cmp": "txreplaceomittedn.hex",
296 "description": "Tests that the 'SEQUENCE' value for each input is set to fdffffff when N omitted"
297 },
298 {
299 "exec": "./bitcoin-tx",
300 "args":
301 ["-create",
302 "replaceable="],
303 "output_cmp": "txreplacenoinputs.hex",
304 "description": "Tests behavior when no inputs are provided in the transaction"
305 },
306 {
307 "exec": "./bitcoin-tx",
308 "args":
309 ["-create",
310 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:abcdef00",
311 "replaceable="],
312 "return_code": 1,
313 "error_txt": "error: invalid TX sequence id 'abcdef00'",
314 "description": "Try to make invalid input replaceable"
315 },
316 { "exec": "./bitcoin-tx",
317 "args":
318 ["-create",
319 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:+0"],
320 "return_code": 1,
321 "error_txt": "error: invalid TX input vout",
322 "description": "Tests the check for an invalid vout value when adding an input"
323 },
324 { "exec": "./bitcoin-tx",
325 "args":
326 ["-create",
327 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0x"],
328 "return_code": 1,
329 "error_txt": "error: invalid TX input vout",
330 "description": "Tests the check for an invalid vout value when adding an input"
331 },
332 { "exec": "./bitcoin-tx",
333 "args":
334 ["-create",
335 "outaddr=1"],
336 "return_code": 1,
337 "error_txt": "error: TX output missing or too many separators",
338 "description": "Malformed outaddr argument (no address specified). Expected to fail."
339 },
340 { "exec": "./bitcoin-tx",
341 "args":
342 ["-create",
343 "outaddr=1:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o:garbage"],
344 "return_code": 1,
345 "error_txt": "error: TX output missing or too many separators",
346 "description": "Malformed outaddr argument (too many separators). Expected to fail."
347 },
348 { "exec": "./bitcoin-tx",
349 "args":
350 ["-create",
351 "outpubkey=0"],
352 "return_code": 1,
353 "error_txt": "error: TX output missing or too many separators",
354 "description": "Malformed outpubkey argument (no pubkey specified). Expected to fail."
355 },
356 { "exec": "./bitcoin-tx",
357 "args":
358 ["-create",
359 "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W:non53nse"],
360 "return_code": 1,
361 "error_txt": "error: TX output missing or too many separators",
362 "description": "Malformed outpubkey argument (too many separators). Expected to fail."
363 },
364 { "exec": "./bitcoin-tx",
365 "args":
366 ["-create",
367 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
368 "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
369 "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1",
370 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
371 "outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"],
372 "output_cmp": "txcreate1.hex",
373 "description": "Creates a new transaction with three inputs and two outputs"
374 },
375 { "exec": "./bitcoin-tx",
376 "args":
377 ["-json",
378 "-create",
379 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
380 "in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18",
381 "in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1",
382 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
383 "outaddr=4:1P8yWvZW8jVihP1bzHeqfE4aoXNX8AVa46"],
384 "output_cmp": "txcreate1.json",
385 "description": "Creates a new transaction with three inputs and two outputs (output in json)"
386 },
387 { "exec": "./bitcoin-tx",
388 "args": ["-create", "outscript=0:"],
389 "output_cmp": "txcreate2.hex",
390 "description": "Creates a new transaction with a single empty output script"
391 },
392 { "exec": "./bitcoin-tx",
393 "args": ["-json", "-create", "outscript=0:"],
394 "output_cmp": "txcreate2.json",
395 "description": "Creates a new transaction with a single empty output script (output in json)"
396 },
397 { "exec": "./bitcoin-tx",
398 "args": ["02000000000100000000000000000000000000"],
399 "output_cmp": "txcreate2.hex",
400 "description": "Parses a transaction with no inputs and a single output script"
401 },
402 { "exec": "./bitcoin-tx",
403 "args": ["-json", "02000000000100000000000000000000000000"],
404 "output_cmp": "txcreate2.json",
405 "description": "Parses a transaction with no inputs and a single output script (output in json)"
406 },
407 { "exec": "./bitcoin-tx",
408 "args": ["-create", "outscript=0:123badscript"],
409 "return_code": 1,
410 "error_txt": "error: script parse error: unknown opcode",
411 "description": "Create a new transaction with an invalid output script"
412 },
413 { "exec": "./bitcoin-tx",
414 "args": ["-create", "outscript=0:OP_DROP", "nversion=1"],
415 "output_cmp": "txcreatescript1.hex",
416 "description": "Create a new transaction with a single output script (OP_DROP)"
417 },
418 { "exec": "./bitcoin-tx",
419 "args": ["-json", "-create", "outscript=0:OP_DROP", "nversion=1"],
420 "output_cmp": "txcreatescript1.json",
421 "description": "Create a new transaction with a single output script (OP_DROP) (output as json)"
422 },
423 { "exec": "./bitcoin-tx",
424 "args": ["-create", "outscript=0:OP_DROP:S", "nversion=1"],
425 "output_cmp": "txcreatescript2.hex",
426 "description": "Create a new transaction with a single output script (OP_DROP) in a P2SH"
427 },
428 { "exec": "./bitcoin-tx",
429 "args": ["-json", "-create", "outscript=0:OP_DROP:S", "nversion=1"],
430 "output_cmp": "txcreatescript2.json",
431 "description": "Create a new transaction with a single output script (OP_DROP) in a P2SH (output as json)"
432 },
433 { "exec": "./bitcoin-tx",
434 "args": ["-create", "outscript=0:OP_DROP:W", "nversion=1"],
435 "output_cmp": "txcreatescript3.hex",
436 "description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH"
437 },
438 { "exec": "./bitcoin-tx",
439 "args": ["-json", "-create", "outscript=0:OP_DROP:W", "nversion=1"],
440 "output_cmp": "txcreatescript3.json",
441 "description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH (output as json)"
442 },
443 { "exec": "./bitcoin-tx",
444 "args": ["-create", "outscript=0:OP_DROP:WS", "nversion=1"],
445 "output_cmp": "txcreatescript4.hex",
446 "description": "Create a new transaction with a single output script (OP_DROP) in a P2WSH, wrapped in a P2SH"
447 },
448 { "exec": "./bitcoin-tx",
449 "args": ["-json", "-create", "outscript=0:OP_DROP:WS", "nversion=1"],
450 "output_cmp": "txcreatescript4.json",
451 "description": "Create a new transaction with a single output script (OP_DROP) in a P2SH, wrapped in a P2SH (output as json)"
452 },
453 { "exec": "./bitcoin-tx",
454 "args": ["-create", "outscript=0:999999999999999999999999999999"],
455 "return_code": 1,
456 "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF",
457 "description": "Try to parse an output script with a decimal number above the allowed range"
458 },
459 { "exec": "./bitcoin-tx",
460 "args": ["-create", "outscript=0:9999999999"],
461 "return_code": 1,
462 "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF",
463 "description": "Try to parse an output script with a decimal number above the allowed range"
464 },
465 { "exec": "./bitcoin-tx",
466 "args": ["-create", "outscript=0:4294967296"],
467 "return_code": 1,
468 "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF",
469 "description": "Try to parse an output script with a decimal number just above the allowed range"
470 },
471 { "exec": "./bitcoin-tx",
472 "args": ["-create", "outscript=0:4294967295"],
473 "output_cmp": "txcreatescript5.hex",
474 "description": "Try to parse an output script with a decimal number at the upper limit of the allowed range"
475 },
476 { "exec": "./bitcoin-tx",
477 "args": ["-create", "outscript=0:-9999999999"],
478 "return_code": 1,
479 "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF",
480 "description": "Try to parse an output script with a decimal number below the allowed range"
481 },
482 { "exec": "./bitcoin-tx",
483 "args": ["-create", "outscript=0:-4294967296"],
484 "return_code": 1,
485 "error_txt": "error: script parse error: decimal numeric value only allowed in the range -0xFFFFFFFF...0xFFFFFFFF",
486 "description": "Try to parse an output script with a decimal number just below the allowed range"
487 },
488 { "exec": "./bitcoin-tx",
489 "args": ["-create", "outscript=0:-4294967295"],
490 "output_cmp": "txcreatescript6.hex",
491 "description": "Try to parse an output script with a decimal number at the lower limit of the allowed range"
492 },
493 { "exec": "./bitcoin-tx",
494 "args":
495 ["-create", "nversion=1",
496 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
497 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
498 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
499 "sign=ALL",
500 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
501 "output_cmp": "txcreatesignv1.hex",
502 "description": "Creates a new v1 transaction with a single input and a single output, and then signs the transaction"
503 },
504 { "exec": "./bitcoin-tx",
505 "args":
506 ["-json",
507 "-create", "nversion=1",
508 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
509 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
510 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
511 "sign=ALL",
512 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
513 "output_cmp": "txcreatesignv1.json",
514 "description": "Creates a new v1 transaction with a single input and a single output, and then signs the transaction (output in json)"
515 },
516 { "exec": "./bitcoin-tx",
517 "args":
518 ["-create",
519 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
520 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
521 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
522 "sign=ALL",
523 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
524 "output_cmp": "txcreatesignv2.hex",
525 "description": "Creates a new transaction with a single input and a single output, and then signs the transaction"
526 },
527 { "exec": "./bitcoin-tx",
528 "args":
529 ["-create",
530 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
531 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
532 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\"vout\":\"0foo\",\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
533 "sign=ALL",
534 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
535 "return_code": 1,
536 "error_txt": "error: prevtxs internal object typecheck fail",
537 "description": "Tests the check for invalid vout index in prevtxs for sign"
538 },
539 { "exec": "./bitcoin-tx",
540 "args":
541 ["-create",
542 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
543 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
544 "set=prevtxs:[{\"txid\":\"Zd49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59412\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
545 "sign=ALL",
546 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
547 "return_code": 1,
548 "error_txt": "error: txid must be hexadecimal string (not 'Zd49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59412')",
549 "description": "Tests the check for invalid txid due to invalid hex"
550 },
551 { "exec": "./bitcoin-tx",
552 "args":
553 ["-create",
554 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
555 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
556 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc594\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
557 "sign=ALL",
558 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
559 "return_code": 1,
560 "error_txt": "error: txid must be hexadecimal string (not '4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc594')",
561 "description": "Tests the check for invalid txid valid hex, but too short"
562 },
563 { "exec": "./bitcoin-tx",
564 "args":
565 ["-create",
566 "in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0",
567 "set=privatekeys:[\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\"]",
568 "set=prevtxs:[{\"txid\":\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc5948512\",\"vout\":0,\"scriptPubKey\":\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\"}]",
569 "sign=ALL",
570 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
571 "return_code": 1,
572 "error_txt": "error: txid must be hexadecimal string (not '4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc5948512')",
573 "description": "Tests the check for invalid txid valid hex, but too long"
574 },
575 { "exec": "./bitcoin-tx",
576 "args":
577 ["-create",
578 "in=00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff:0",
579 "set=privatekeys:[\"KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn\"]",
580 "set=prevtxs:[{\"txid\":\"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff\",\"vout\":0,\"amount\":\"0\", \"scriptPubKey\":\"0014751e76e8199196d454941c45d1b3a323f1433bd6\"}]",
581 "sign=ALL",
582 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
583 "output_cmp": "txcreatesignsegwit1.hex",
584 "description": "Creates a new transaction with a single witness input and a single output, and then signs the transaction"
585 },
586 { "exec": "./bitcoin-tx",
587 "args":
588 ["-create",
589 "in=00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff:0",
590 "set=privatekeys:[\"KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU73sVHnoWn\"]",
591 "set=prevtxs:[{\"txid\":\"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff\",\"vout\":0,\"scriptPubKey\":\"0014751e76e8199196d454941c45d1b3a323f1433bd6\"}]",
592 "sign=ALL",
593 "outaddr=0.001:193P6LtvS4nCnkDvM9uXn1gsSRqh4aDAz7"],
594 "return_code": 1,
595 "error_txt": "Missing amount for CTxOut with scriptPubKey=0014751e76e8199196d454941c45d1b3a323f1433bd6",
596 "description": "Tests the check for missing input amount for witness transactions"
597 },
598 { "exec": "./bitcoin-tx",
599 "args":
600 ["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
601 "output_cmp": "txcreateoutpubkey1.hex",
602 "description": "Creates a new transaction with a single pay-to-pubkey output"
603 },
604 { "exec": "./bitcoin-tx",
605 "args":
606 ["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397", "nversion=1"],
607 "output_cmp": "txcreateoutpubkey1.json",
608 "description": "Creates a new transaction with a single pay-to-pubkey output (output as json)"
609 },
610 { "exec": "./bitcoin-tx",
611 "args":
612 ["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
613 "output_cmp": "txcreateoutpubkey2.hex",
614 "description": "Creates a new transaction with a single pay-to-witness-pubkey output"
615 },
616 { "exec": "./bitcoin-tx",
617 "args":
618 ["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W", "nversion=1"],
619 "output_cmp": "txcreateoutpubkey2.json",
620 "description": "Creates a new transaction with a single pay-to-witness-pubkey output (output as json)"
621 },
622 { "exec": "./bitcoin-tx",
623 "args":
624 ["-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
625 "output_cmp": "txcreateoutpubkey3.hex",
626 "description": "Creates a new transaction with a single pay-to-witness-pubkey, wrapped in P2SH output"
627 },
628 { "exec": "./bitcoin-tx",
629 "args":
630 ["-json", "-create", "outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS", "nversion=1"],
631 "output_cmp": "txcreateoutpubkey3.json",
632 "description": "Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)"
633 },
634 { "exec": "./bitcoin-tx",
635 "args":
636 ["-json", "-create", "outpubkey=0:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS", "nversion=1"],
637 "return_code": 1,
638 "error_txt": "error: Uncompressed pubkeys are not useable for SegWit outputs",
639 "description": "Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)"
640 },
641 { "exec": "./bitcoin-tx",
642 "args":
643 ["-create",
644 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
645 "outdata=4:badhexdata"],
646 "return_code": 1,
647 "error_txt": "error: invalid TX output data",
648 "description": "Attempts to create a new transaction with one input and an output with malformed hex data. Expected to fail"
649 },
650 { "exec": "./bitcoin-tx",
651 "args":
652 ["-create",
653 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
654 "outdata=badhexdata"],
655 "return_code": 1,
656 "error_txt": "error: invalid TX output data",
657 "description": "Attempts to create a new transaction with one input and an output with no value and malformed hex data. Expected to fail"
658 },
659 { "exec": "./bitcoin-tx",
660 "args":
661 ["-create",
662 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
663 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
664 "outdata=4:54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
665 "output_cmp": "txcreatedata1.hex",
666 "description": "Creates a new transaction with one input, one address output and one data output"
667 },
668 { "exec": "./bitcoin-tx",
669 "args":
670 ["-json",
671 "-create", "nversion=1",
672 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
673 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
674 "outdata=4:54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
675 "output_cmp": "txcreatedata1.json",
676 "description": "Creates a new v1 transaction with one input, one address output and one data output (output in json)"
677 },
678 { "exec": "./bitcoin-tx",
679 "args":
680 ["-create",
681 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
682 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
683 "outdata=54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
684 "output_cmp": "txcreatedata2.hex",
685 "description": "Creates a new transaction with one input, one address output and one data (zero value) output"
686 },
687 { "exec": "./bitcoin-tx",
688 "args":
689 ["-json",
690 "-create",
691 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0",
692 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o",
693 "outdata=54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e"],
694 "output_cmp": "txcreatedata2.json",
695 "description": "Creates a new transaction with one input, one address output and one data (zero value) output (output in json)"
696 },
697 { "exec": "./bitcoin-tx",
698 "args":
699 ["-create",
700 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:11aa"],
701 "return_code": 1,
702 "error_txt": "error: invalid TX sequence id '11aa'",
703 "description": "Try to parse a sequence number outside the allowed range"
704 },
705 { "exec": "./bitcoin-tx",
706 "args":
707 ["-create",
708 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:-1"],
709 "return_code": 1,
710 "error_txt": "error: invalid TX sequence id '-1'",
711 "description": "Try to parse a sequence number outside the allowed range"
712 },
713 { "exec": "./bitcoin-tx",
714 "args":
715 ["-create",
716 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967296"],
717 "return_code": 1,
718 "error_txt": "error: invalid TX sequence id '4294967296'",
719 "description": "Try to parse a sequence number outside the allowed range"
720 },
721 { "exec": "./bitcoin-tx",
722 "args":
723 ["-create",
724 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293",
725 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o"],
726 "output_cmp": "txcreatedata_seq0.hex",
727 "description": "Creates a new transaction with one input with sequence number and one address output"
728 },
729 { "exec": "./bitcoin-tx",
730 "args":
731 ["-create",
732 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0: 4294967293 ",
733 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o"],
734 "output_cmp": "txcreatedata_seq0.hex",
735 "description": "Creates a new transaction with one input with sequence number (+whitespace) and one address output"
736 },
737 { "exec": "./bitcoin-tx",
738 "args":
739 ["-json",
740 "-create",
741 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293",
742 "outaddr=0.18:13tuJJDR2RgArmgfv6JScSdreahzgc4T6o"],
743 "output_cmp": "txcreatedata_seq0.json",
744 "description": "Creates a new transaction with one input with sequence number and one address output (output in json)"
745 },
746 { "exec": "./bitcoin-tx",
747 "args":
748 ["01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000",
749 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1"],
750 "output_cmp": "txcreatedata_seq1.hex",
751 "description": "Adds a new input with sequence number to a transaction"
752 },
753 { "exec": "./bitcoin-tx",
754 "args":
755 ["-json",
756 "01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000",
757 "in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1"],
758 "output_cmp": "txcreatedata_seq1.json",
759 "description": "Adds a new input with sequence number to a transaction (output in json)"
760 },
761 { "exec": "./bitcoin-tx",
762 "args": ["-create", "outmultisig=1:-2:3:02a5:021:02df", "nversion=1"],
763 "return_code": 1,
764 "error_txt": "error: invalid multisig required number '-2'",
765 "description": "Try to parse a multisig number outside the allowed range"
766 },
767 { "exec": "./bitcoin-tx",
768 "args": ["-create", "outmultisig=1:2:3a:02a5:021:02df", "nversion=1"],
769 "return_code": 1,
770 "error_txt": "error: invalid multisig total number '3a'",
771 "description": "Try to parse a multisig number outside the allowed range"
772 },
773 { "exec": "./bitcoin-tx",
774 "args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
775 "output_cmp": "txcreatemultisig1.hex",
776 "description": "Creates a new transaction with a single 2-of-3 multisig output"
777 },
778 { "exec": "./bitcoin-tx",
779 "args": ["-json", "-create", "outmultisig=1: 2 : 3 :02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485", "nversion=1"],
780 "output_cmp": "txcreatemultisig1.json",
781 "description": "Creates a new transaction with a single 2-of-3 multisig output (with whitespace, output in json)"
782 },
783 { "exec": "./bitcoin-tx",
784 "args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
785 "output_cmp": "txcreatemultisig2.hex",
786 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2SH output"
787 },
788 { "exec": "./bitcoin-tx",
789 "args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S", "nversion=1"],
790 "output_cmp": "txcreatemultisig2.json",
791 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2SH output (output in json)"
792 },
793 { "exec": "./bitcoin-tx",
794 "args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
795 "output_cmp": "txcreatemultisig3.hex",
796 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output"
797 },
798 { "exec": "./bitcoin-tx",
799 "args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W", "nversion=1"],
800 "output_cmp": "txcreatemultisig3.json",
801 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output (output in json)"
802 },
803 { "exec": "./bitcoin-tx",
804 "args": ["-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
805 "output_cmp": "txcreatemultisig4.hex",
806 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH"
807 },
808 { "exec": "./bitcoin-tx",
809 "args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS", "nversion=1"],
810 "output_cmp": "txcreatemultisig4.json",
811 "description": "Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH (output in json)"
812 },
813 { "exec": "./bitcoin-tx",
814 "args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:S"],
815 "output_cmp": "txcreatemultisig5.json",
816 "description": "Uncompressed pubkeys should work just fine for non-witness outputs"
817 },
818 { "exec": "./bitcoin-tx",
819 "args": ["-json", "-create", "outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS"],
820 "return_code": 1,
821 "error_txt": "error: Uncompressed pubkeys are not useable for SegWit outputs",
822 "description": "Ensure adding witness outputs with uncompressed pubkeys fails"
823 }
824 ]
825