Debian Codegraph @

spec/tests/schemas/complex.json

raw symbols SCIP
1 [
2 {
3 "description": "complex schema from jsck benchmark (https://github.com/pandastrike/jsck)",
4 "schema": {
5 "type": "array",
6 "items": {"$ref": "#transaction"},
7 "minItems": 1,
8 "definitions": {
9 "base58": {
10 "$id": "#base58",
11 "type": "string",
12 "pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$"
13 },
14 "hex": {
15 "$id": "#hex",
16 "type": "string",
17 "pattern": "^[0123456789A-Fa-f]+$"
18 },
19 "tx_id": {
20 "$id": "#tx_id",
21 "allOf": [
22 {"$ref": "#hex"},
23 {
24 "minLength": 64,
25 "maxLength": 64
26 }
27 ]
28 },
29 "address": {
30 "$id": "#address",
31 "allOf": [
32 {"$ref": "#base58"},
33 {
34 "minLength": 34,
35 "maxLength": 34
36 }
37 ]
38 },
39 "signature": {
40 "$id": "#signature",
41 "allOf": [
42 {"$ref": "#hex"},
43 {
44 "minLength": 128,
45 "maxLength": 128
46 }
47 ]
48 },
49 "transaction": {
50 "$id": "#transaction",
51 "additionalProperties": false,
52 "required": ["metadata", "hash", "inputs", "outputs"],
53 "properties": {
54 "metadata": {
55 "type": "object",
56 "required": ["amount", "fee"],
57 "properties": {
58 "amount": {
59 "type": "integer"
60 },
61 "fee": {
62 "type": "integer",
63 "multipleOf": 10000
64 },
65 "status": {
66 "type": "string",
67 "enum": ["unsigned", "unconfirmed", "confirmed", "invalid"]
68 },
69 "confirmations": {
70 "type": "integer",
71 "minimum": 0
72 },
73 "block_time": {
74 "type": "integer"
75 }
76 }
77 },
78 "version": {
79 "type": "integer"
80 },
81 "lock_time": {
82 "type": "integer"
83 },
84 "hash": {"$ref": "#tx_id"},
85 "inputs": {
86 "type": "array",
87 "items": {"$ref": "#input"},
88 "minItems": 1
89 },
90 "outputs": {
91 "type": "array",
92 "items": {"$ref": "#output"},
93 "minItems": 1
94 }
95 }
96 },
97 "input": {
98 "$id": "#input",
99 "type": "object",
100 "additionalProperties": false,
101 "required": ["index", "output", "script_sig"],
102 "properties": {
103 "index": {
104 "type": "integer",
105 "minimum": 0
106 },
107 "output": {"$ref": "#output"},
108 "sig_hash": {"$ref": "#hex"},
109 "script_sig": {"$ref": "#hex"},
110 "signatures": {
111 "type": "object",
112 "description": "A dictionary of signatures. Keys represent keypair names",
113 "minProperties": 1,
114 "maxProperties": 3,
115 "additionalProperties": {"$ref": "#signature"}
116 }
117 }
118 },
119 "output": {
120 "$id": "#output",
121 "type": "object",
122 "additionalProperties": false,
123 "required": ["hash", "index", "value", "script"],
124 "properties": {
125 "hash": {"$ref": "#tx_id"},
126 "index": {
127 "type": "integer",
128 "minimum": 0
129 },
130 "value": {
131 "type": "integer"
132 },
133 "script": {
134 "type": "object",
135 "properties": {
136 "type": {
137 "type": "string",
138 "enum": ["standard", "p2sh"]
139 },
140 "asm": {
141 "type": "string"
142 }
143 }
144 },
145 "address": {"$ref": "#address"},
146 "metadata": {
147 "type": "object",
148 "dependencies": {
149 "wallet_path": ["public_seeds"]
150 },
151 "properties": {
152 "wallet_path": {
153 "type": "string"
154 },
155 "public_seeds": {
156 "type": "object",
157 "minProperties": 1,
158 "maxProperties": 3,
159 "additionalProperties": {
160 "anyOf": [{"$ref": "#base58"}, {"$ref": "#hex"}]
161 }
162 }
163 }
164 }
165 }
166 }
167 }
168 },
169 "tests": [
170 {
171 "description": "valid array from jsck benchmark",
172 "data": [
173 {
174 "metadata": {
175 "amount": 38043749285,
176 "fee": 20000,
177 "status": "confirmed",
178 "confirmations": 73,
179 "block_time": 1415993584376
180 },
181 "version": 1,
182 "lock_time": 0,
183 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
184 "inputs": [
185 {
186 "index": 0,
187 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
188 "signatures": {
189 "primary": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a7",
190 "cosigner": "a2ad5ebf16dadf9d357ef2867cb9b1de682b336db000b6e0012200ebda7c8802f7c5ea2afd97439840a191c756be6528521b214487d5fc79796eb00122064037"
191 },
192 "output": {
193 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
194 "index": 1,
195 "value": 38043749285,
196 "script": {
197 "type": "standard",
198 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
199 }
200 }
201 }
202 ],
203 "outputs": [
204 {
205 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
206 "index": 0,
207 "value": 38042249285,
208 "script": {
209 "type": "standard",
210 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
211 },
212 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
213 "metadata": {
214 "type": "change",
215 "wallet_path": "m/44/0/1/356",
216 "public_seeds": {
217 "primary": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8",
218 "cosigner": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"
219 }
220 }
221 },
222 {
223 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
224 "index": 1,
225 "value": 1500000,
226 "script": {
227 "type": "standard",
228 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
229 },
230 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
231 }
232 ]
233 },
234 {
235 "metadata": {
236 "amount": 38043749285,
237 "fee": 20000,
238 "status": "unconfirmed",
239 "confirmations": 73,
240 "block_time": 1415993584376
241 },
242 "version": 1,
243 "lock_time": 0,
244 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
245 "inputs": [
246 {
247 "index": 0,
248 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
249 "output": {
250 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
251 "index": 1,
252 "value": 38043749285,
253 "script": {
254 "type": "standard",
255 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
256 }
257 }
258 }
259 ],
260 "outputs": [
261 {
262 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
263 "index": 0,
264 "value": 38042249285,
265 "script": {
266 "type": "standard",
267 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
268 },
269 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
270 "metadata": {
271 "type": "change"
272 }
273 },
274 {
275 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
276 "index": 1,
277 "value": 1500000,
278 "script": {
279 "type": "standard",
280 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
281 },
282 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
283 }
284 ]
285 },
286 {
287 "metadata": {
288 "amount": 38043749285,
289 "fee": 20000,
290 "status": "unconfirmed",
291 "confirmations": 73,
292 "block_time": 1415993584376
293 },
294 "version": 1,
295 "lock_time": 0,
296 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
297 "inputs": [
298 {
299 "index": 0,
300 "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01",
301 "output": {
302 "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d",
303 "index": 1,
304 "value": 38043749285,
305 "script": {
306 "type": "standard",
307 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
308 }
309 }
310 }
311 ],
312 "outputs": [
313 {
314 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
315 "index": 0,
316 "value": 38042249285,
317 "script": {
318 "type": "standard",
319 "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG"
320 },
321 "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1",
322 "metadata": {
323 "type": "change"
324 }
325 },
326 {
327 "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471",
328 "index": 1,
329 "value": 1500000,
330 "script": {
331 "type": "standard",
332 "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG"
333 },
334 "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT"
335 }
336 ]
337 }
338 ],
339 "valid": true
340 },
341 {
342 "description": "not array",
343 "data": 1,
344 "valid": false
345 }
346 ]
347 }
348 ]