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