Debian Codegraph @

spec/tests/schemas/complex2.json

raw symbols SCIP
1 [
2 {
3 "description": "complex schema from jsck benchmark without IDs in definitions",
4 "schema": {
5 "type": "array",
6 "items": {"$ref": "#/definitions/transaction"},
7 "minItems": 1,
8 "definitions": {
9 "base58": {
10 "type": "string",
11 "pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$"
12 },
13 "hex": {
14 "type": "string",
15 "pattern": "^[0123456789A-Fa-f]+$"
16 },
17 "tx_id": {
18 "allOf": [
19 {"$ref": "#/definitions/hex"},
20 {
21 "minLength": 64,
22 "maxLength": 64
23 }
24 ]
25 },
26 "address": {
27 "allOf": [
28 {"$ref": "#/definitions/base58"},
29 {
30 "minLength": 34,
31 "maxLength": 34
32 }
33 ]
34 },
35 "signature": {
36 "allOf": [
37 {"$ref": "#/definitions/hex"},
38 {
39 "minLength": 128,
40 "maxLength": 128
41 }
42 ]
43 },
44 "transaction": {
45 "additionalProperties": false,
46 "required": ["metadata", "hash", "inputs", "outputs"],
47 "properties": {
48 "metadata": {
49 "type": "object",
50 "required": ["amount", "fee"],
51 "properties": {
52 "amount": {
53 "type": "integer"
54 },
55 "fee": {
56 "type": "integer",
57 "multipleOf": 10000
58 },
59 "status": {
60 "type": "string",
61 "enum": ["unsigned", "unconfirmed", "confirmed", "invalid"]
62 },
63 "confirmations": {
64 "type": "integer",
65 "minimum": 0
66 },
67 "block_time": {
68 "type": "integer"
69 }
70 }
71 },
72 "version": {
73 "type": "integer"
74 },
75 "lock_time": {
76 "type": "integer"
77 },
78 "hash": {"$ref": "#/definitions/tx_id"},
79 "inputs": {
80 "type": "array",
81 "items": {"$ref": "#/definitions/input"},
82 "minItems": 1
83 },
84 "outputs": {
85 "type": "array",
86 "items": {"$ref": "#/definitions/output"},
87 "minItems": 1
88 }
89 }
90 },
91 "input": {
92 "type": "object",
93 "additionalProperties": false,
94 "required": ["index", "output", "script_sig"],
95 "properties": {
96 "index": {
97 "type": "integer",
98 "minimum": 0
99 },
100 "output": {"$ref": "#/definitions/output"},
101 "sig_hash": {"$ref": "#/definitions/hex"},
102 "script_sig": {"$ref": "#/definitions/hex"},
103 "signatures": {
104 "type": "object",
105 "description": "A dictionary of signatures. Keys represent keypair names",
106 "minProperties": 1,
107 "maxProperties": 3,
108 "additionalProperties": {"$ref": "#/definitions/signature"}
109 }
110 }
111 },
112 "output": {
113 "type": "object",
114 "additionalProperties": false,
115 "required": ["hash", "index", "value", "script"],
116 "properties": {
117 "hash": {"$ref": "#/definitions/tx_id"},
118 "index": {
119 "type": "integer",
120 "minimum": 0
121 },
122 "value": {
123 "type": "integer"
124 },
125 "script": {
126 "type": "object",
127 "properties": {
128 "type": {
129 "type": "string",
130 "enum": ["standard", "p2sh"]
131 },
132 "asm": {
133 "type": "string"
134 }
135 }
136 },
137 "address": {"$ref": "#/definitions/address"},
138 "metadata": {
139 "type": "object",
140 "dependencies": {
141 "wallet_path": ["public_seeds"]
142 },
143 "properties": {
144 "wallet_path": {
145 "type": "string"
146 },
147 "public_seeds": {
148 "type": "object",
149 "minProperties": 1,
150 "maxProperties": 3,
151 "additionalProperties": {
152 "anyOf": [{"$ref": "#/definitions/base58"}, {"$ref": "#/definitions/hex"}]
153 }
154 }
155 }
156 }
157 }
158 }
159 }
160 },
161 "tests": [
162 {
163 "description": "valid array from jsck benchmark",
164 "data": [
165 {
166 "metadata": {
167 "amount": 38043749285,
168 "fee": 20000,
169 "status": "confirmed",
170 "confirmations": 73,
171 "block_time": 1415993584376
172 },
173 "version": 1,
174 "lock_time": 0,
175 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
176 "inputs": [
177 {
178 "index": 0,
179 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
180 "signatures": {
181 "primary": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a7",
182 "cosigner": "a2ad5ebf16dadf9d357ef2867cb9b1de682b336db000b6e0012200ebda7c8802f7c5ea2afd97439840a191c756be6528521b214487d5fc79796eb00122064037"
183 },
184 "output": {
185 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
186 "index": 1,
187 "value": 38043749285,
188 "script": {
189 "type": "standard",
190 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
191 }
192 }
193 }
194 ],
195 "outputs": [
196 {
197 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
198 "index": 0,
199 "value": 38042249285,
200 "script": {
201 "type": "standard",
202 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
203 },
204 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
205 "metadata": {
206 "type": "change",
207 "wallet_path": "m/44/0/1/356",
208 "public_seeds": {
209 "primary": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8",
210 "cosigner": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"
211 }
212 }
213 },
214 {
215 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
216 "index": 1,
217 "value": 1500000,
218 "script": {
219 "type": "standard",
220 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
221 },
222 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
223 }
224 ]
225 },
226 {
227 "metadata": {
228 "amount": 38043749285,
229 "fee": 20000,
230 "status": "unconfirmed",
231 "confirmations": 73,
232 "block_time": 1415993584376
233 },
234 "version": 1,
235 "lock_time": 0,
236 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
237 "inputs": [
238 {
239 "index": 0,
240 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
241 "output": {
242 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
243 "index": 1,
244 "value": 38043749285,
245 "script": {
246 "type": "standard",
247 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
248 }
249 }
250 }
251 ],
252 "outputs": [
253 {
254 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
255 "index": 0,
256 "value": 38042249285,
257 "script": {
258 "type": "standard",
259 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
260 },
261 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
262 "metadata": {
263 "type": "change"
264 }
265 },
266 {
267 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
268 "index": 1,
269 "value": 1500000,
270 "script": {
271 "type": "standard",
272 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
273 },
274 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
275 }
276 ]
277 },
278 {
279 "metadata": {
280 "amount": 38043749285,
281 "fee": 20000,
282 "status": "unconfirmed",
283 "confirmations": 73,
284 "block_time": 1415993584376
285 },
286 "version": 1,
287 "lock_time": 0,
288 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
289 "inputs": [
290 {
291 "index": 0,
292 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
293 "output": {
294 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
295 "index": 1,
296 "value": 38043749285,
297 "script": {
298 "type": "standard",
299 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
300 }
301 }
302 }
303 ],
304 "outputs": [
305 {
306 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
307 "index": 0,
308 "value": 38042249285,
309 "script": {
310 "type": "standard",
311 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
312 },
313 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
314 "metadata": {
315 "type": "change"
316 }
317 },
318 {
319 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
320 "index": 1,
321 "value": 1500000,
322 "script": {
323 "type": "standard",
324 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
325 },
326 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
327 }
328 ]
329 }
330 ],
331 "valid": true
332 },
333 {
334 "description": "not array",
335 "data": 1,
336 "valid": false
337 },
338 {
339 "description": "one valid item",
340 "data": [
341 {
342 "metadata": {
343 "amount": 38043749285,
344 "fee": 20000,
345 "status": "unconfirmed",
346 "confirmations": 73,
347 "block_time": 1415993584376
348 },
349 "version": 1,
350 "lock_time": 0,
351 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
352 "inputs": [
353 {
354 "index": 0,
355 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
356 "output": {
357 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
358 "index": 1,
359 "value": 38043749285,
360 "script": {
361 "type": "standard",
362 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
363 }
364 }
365 }
366 ],
367 "outputs": [
368 {
369 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
370 "index": 0,
371 "value": 38042249285,
372 "script": {
373 "type": "standard",
374 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
375 },
376 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
377 "metadata": {
378 "type": "change"
379 }
380 },
381 {
382 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
383 "index": 1,
384 "value": 1500000,
385 "script": {
386 "type": "standard",
387 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
388 },
389 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
390 }
391 ]
392 }
393 ],
394 "valid": true
395 },
396 {
397 "description": "one invalid item",
398 "data": [
399 {
400 "metadata": {
401 "amount": 38043749285,
402 "fee": 20000,
403 "status": "unconfirmed",
404 "confirmations": 73,
405 "block_time": 1415993584376
406 },
407 "version": 1,
408 "lock_time": 0,
409 "hash": "$_is_invalid",
410 "inputs": [
411 {
412 "index": 0,
413 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
414 "output": {
415 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
416 "index": 1,
417 "value": 38043749285,
418 "script": {
419 "type": "standard",
420 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
421 }
422 }
423 }
424 ],
425 "outputs": [
426 {
427 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
428 "index": 0,
429 "value": 38042249285,
430 "script": {
431 "type": "standard",
432 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
433 },
434 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
435 "metadata": {
436 "type": "change"
437 }
438 },
439 {
440 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
441 "index": 1,
442 "value": 1500000,
443 "script": {
444 "type": "standard",
445 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
446 },
447 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
448 }
449 ]
450 }
451 ],
452 "valid": false
453 }
454 ]
455 }
456 ]