Repository navigation
Expand file tree
/
Copy pathdag-entity.json
More file actions
99 lines (96 loc) · 4.22 KB
/
Copy pathdag-entity.json
File metadata and controls
99 lines (96 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
"_comment": "Test vectors for the DAG entity format. IDs are computed by the reference implementation (Go encoding/json + crypto/sha256). Git object hashes are the ones of a SHA-1 repository.",
"id_derivation": [
{
"description": "SHA-256 of an empty byte sequence (sanity check)",
"input_hex": "",
"expected_id": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"description": "Operation pack with a single CreateOperation: its ID is the SHA-256 of the exact bytes of the ops blob.",
"input": {
"author": {"id": "b29b7b2e0acb0a91dcf3c6c9d8e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7"},
"ops": [
{
"type": 1,
"timestamp": 1609459200,
"nonce": "AAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"title": "test bug",
"message": "",
"files": null
}
]
},
"raw": "{\"author\":{\"id\":\"b29b7b2e0acb0a91dcf3c6c9d8e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7\"},\"ops\":[{\"type\":1,\"timestamp\":1609459200,\"nonce\":\"AAAAAAAAAAAAAAAAAAAAAAAAAAAA\",\"title\":\"test bug\",\"message\":\"\",\"files\":null}]}",
"note": "raw is input as written in git: compact JSON, with the keys in this order. expected_id is the SHA-256 of raw.",
"expected_id": "e38873b1914f55f93b5c1bf7c90539ea309c8edfbd5cde159e5f07559da576f0"
}
],
"tree_entries": [
{
"description": "Git tree for the first commit of a bug with edit-clock=1 and create-clock=1, format version 4",
"entries": [
{"name": "create-clock-1", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},
{"name": "edit-clock-1", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},
{"name": "ops", "type": "blob", "hash": "70bc360cd82ec97787eff211c4b228872eaea9ae"},
{"name": "version-4", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"}
],
"notes": [
"'ops' holds the first operation pack example below, whose bytes are the raw of id_derivation.",
"The empty blob hash e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 is used for all metadata entries.",
"Entry names are sorted lexicographically by git.",
"No 'extra/' subtree because this operation has no file attachments."
]
},
{
"description": "Git tree for a later (non-root) commit with edit-clock=2, format version 4",
"entries": [
{"name": "edit-clock-2", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},
{"name": "ops", "type": "blob", "hash": "<git hash of the ops blob>"},
{"name": "version-4", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"}
],
"notes": [
"No 'create-clock-*' entry on non-root commits.",
"No 'extra/' subtree because this operation has no file attachments."
]
},
{
"description": "Git tree for a merge commit (empty ops, two parents)",
"entries": [
{"name": "edit-clock-3", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"},
{"name": "ops", "type": "blob", "hash": "615d687cbe8d87ce9739ac16c1c75597f66d96db"},
{"name": "version-4", "type": "blob", "hash": "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"}
],
"notes": [
"'ops' holds the empty operation pack example below, as compact JSON.",
"Merge commits have two parents in git but their ops array is empty.",
"The edit clock is advanced past both parents."
]
}
],
"operation_pack_examples": [
{
"description": "Minimal valid operation pack for a new bug",
"json": {
"author": {"id": "b29b7b2e0acb0a91dcf3c6c9d8e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7"},
"ops": [
{
"type": 1,
"timestamp": 1609459200,
"nonce": "AAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"title": "test bug",
"message": "",
"files": null
}
]
}
},
{
"description": "Empty operation pack (merge commit)",
"json": {
"author": {"id": "b29b7b2e0acb0a91dcf3c6c9d8e5f4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7"},
"ops": []
}
}
]
}