Skip to content

Commit

Permalink
Insertion tests (ignored)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kus committed Oct 18, 2024
1 parent 9ef3e8c commit 845a7a4
Show file tree
Hide file tree
Showing 6 changed files with 358 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/utreexo/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ cairo_test.workspace = true
[scripts]
# TODO: cairo lint
lint = "scarb fmt"
test = "scarb build && ../../scripts/data/integration_tests.sh"
test = "scarb cairo-test && ../../scripts/data/integration_tests.sh"
4 changes: 4 additions & 0 deletions packages/utreexo/tests/data/ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ deletion_test_case_4.json
deletion_test_case_5.json
deletion_test_case_6.json
deletion_test_case_10.json
insertion_test_case_0.json
insertion_test_case_1.json
insertion_test_case_2.json
insertion_test_case_3.json
30 changes: 30 additions & 0 deletions packages/utreexo/tests/data/insertion_test_case_0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"state": {
"roots": [],
"leaves": 0
},
"proof": {
"nodes": [],
"targets": []
},
"leaves_to_del": [],
"leaves_to_add": [
0,
1,
2,
3,
4,
5,
6,
7
],
"expected_state": {
"roots": [
{
"variant_id": 0,
"value": 1010147253610699894986241683624609428739638206544914327400350896031110287324
}
],
"leaves": 8
}
}
37 changes: 37 additions & 0 deletions packages/utreexo/tests/data/insertion_test_case_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"state": {
"roots": [],
"leaves": 0
},
"proof": {
"nodes": [],
"targets": []
},
"leaves_to_del": [],
"leaves_to_add": [
0,
1,
2,
3,
4,
5,
6
],
"expected_state": {
"roots": [
{
"variant_id": 0,
"value": 1229371501456391789924831928153470943555736434402105893904574254763197682709
},
{
"variant_id": 0,
"value": 3613143053999770272842665473502706307602279676970981102529837756866990003067
},
{
"variant_id": 0,
"value": 6
}
],
"leaves": 7
}
}
49 changes: 49 additions & 0 deletions packages/utreexo/tests/data/insertion_test_case_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"state": {
"roots": [],
"leaves": 0
},
"proof": {
"nodes": [],
"targets": []
},
"leaves_to_del": [],
"leaves_to_add": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14
],
"expected_state": {
"roots": [
{
"variant_id": 0,
"value": 1010147253610699894986241683624609428739638206544914327400350896031110287324
},
{
"variant_id": 0,
"value": 2224391216833402212724735773212940252356536072547264452695587483243907176367
},
{
"variant_id": 0,
"value": 3009277733733429566191908933097273596911357184294896938062356457901603258437
},
{
"variant_id": 0,
"value": 14
}
],
"leaves": 15
}
}
237 changes: 237 additions & 0 deletions packages/utreexo/tests/data/insertion_test_case_3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
{
"state": {
"roots": [],
"leaves": 0
},
"proof": {
"nodes": [],
"targets": []
},
"leaves_to_del": [],
"leaves_to_add": [
70,
13,
55,
152,
74,
33,
39,
122,
252,
53,
224,
211,
11,
25,
122,
14,
191,
152,
115,
205,
160,
163,
90,
191,
199,
242,
216,
32,
141,
6,
200,
109,
211,
53,
72,
250,
108,
163,
224,
90,
17,
25,
92,
254,
172,
211,
26,
231,
254,
159,
183,
180,
135,
131,
194,
83,
207,
158,
226,
49,
138,
136,
73,
143,
105,
164,
50,
58,
94,
168,
90,
128,
132,
238,
168,
47,
153,
20,
90,
106,
113,
168,
27,
136,
206,
3,
117,
87,
213,
48,
104,
7,
59,
167,
164,
161,
151,
11,
63,
145,
61,
24,
40,
231,
49,
78,
86,
52,
208,
35,
97,
15,
215,
238,
255,
227,
180,
226,
18,
223,
126,
157,
123,
81,
149,
46,
133,
132,
173,
190,
87,
227,
139,
199,
209,
17,
210,
112,
204,
177,
71,
195,
56,
23,
67,
15,
226,
97,
62,
7,
235,
63,
200,
140,
104,
4,
130,
47,
168,
33,
122,
118,
169,
129,
20,
186,
121,
114,
107,
79,
215,
226,
45,
0,
108,
43,
53,
218,
252,
71,
176,
54,
93,
0,
168,
238,
209,
41,
198,
111,
235,
215,
216,
60,
135,
230,
205,
177,
102
],
"expected_state": {
"roots": [
{
"variant_id": 0,
"value": 2672466713874524096706188653290465293041789171537063033475721019051021709650
},
{
"variant_id": 0,
"value": 800167443309767050337371835372566580588382650816996663888846566248424467770
},
{
"variant_id": 0,
"value": 2341279804388063006376825986227464425832324574402694026157731031180941806793
},
{
"variant_id": 0,
"value": 3599240998874953227291885504793759279722011806456495621536520426822519234449
},
{
"variant_id": 0,
"value": 102
}
],
"leaves": 199
}
}

0 comments on commit 845a7a4

Please sign in to comment.