Skip to content

Commit bcba819

Browse files
authored
Make golden proof test data available to other languages (#171)
1 parent 9ca563d commit bcba819

File tree

198 files changed

+2940
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+2940
-342
lines changed

cmd/proofgen/main.go

Lines changed: 480 additions & 0 deletions
Large diffs are not rendered by default.

proof/verify_test.go

Lines changed: 91 additions & 341 deletions
Large diffs are not rendered by default.

scripts/presubmit.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ check_cmd() {
2626
}
2727

2828
usage() {
29-
echo "$0 [--coverage] [--fix] [--no-mod-tidy] [--no-build] [--no-linters]"
29+
echo "$0 [--coverage] [--fix] [--no-mod-tidy] [--no-build] [--no-linters] [--no-generate] [--empty-diff]"
3030
}
3131

3232
main() {
@@ -35,6 +35,8 @@ main() {
3535
local run_mod_tidy=1
3636
local run_build=1
3737
local run_lint=1
38+
local run_generate=1
39+
local empty_diff=0
3840
while [[ $# -gt 0 ]]; do
3941
case "$1" in
4042
--coverage)
@@ -56,6 +58,12 @@ main() {
5658
--no-linters)
5759
run_lint=0
5860
;;
61+
--no-generate)
62+
run_generate=0
63+
;;
64+
--empty-diff)
65+
empty_diff=1
66+
;;
5967
*)
6068
usage
6169
exit 1
@@ -110,6 +118,16 @@ main() {
110118
echo 'checking license headers'
111119
./scripts/check_license.sh ${go_srcs}
112120
fi
121+
122+
if [[ "${run_generate}" -eq 1 ]]; then
123+
echo 'running go generate'
124+
go run ./cmd/proofgen
125+
fi
126+
127+
if [[ "${empty_diff}" -eq 1 ]]; then
128+
echo 'checking git diff is empty'
129+
git diff --exit-code
130+
fi
113131
}
114132

115133
main "$@"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"size1": 1,
3+
"size2": 1,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
6+
"proof": null,
7+
"desc": "happy path",
8+
"wantErr": false
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [],
7+
"desc": "empty proof",
8+
"wantErr": true
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [
7+
"lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
8+
"Xwg/ChozygdqlSeYMlgNs+DvRYS9/x9UyKNg9Q3jAx4=",
9+
"a0eq8p7jwq+a+Im8H7klTavTEXfxYjLdaqsDXKOb9uQ="
10+
],
11+
"desc": "happy path",
12+
"wantErr": false
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [
7+
"hqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
8+
"Xwg/ChozygdqlSeYMlgNs+DvRYS9/x9UyKNg9Q3jAx4=",
9+
"a0eq8p7jwq+a+Im8H7klTavTEXfxYjLdaqsDXKOb9uQ="
10+
],
11+
"desc": "modified proof@0 bit @4",
12+
"wantErr": true
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [
7+
"lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
8+
"Twg/ChozygdqlSeYMlgNs+DvRYS9/x9UyKNg9Q3jAx4=",
9+
"a0eq8p7jwq+a+Im8H7klTavTEXfxYjLdaqsDXKOb9uQ="
10+
],
11+
"desc": "modified proof@1 bit @4",
12+
"wantErr": true
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [
7+
"lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
8+
"Xwg/ChozygdqlSeYMlgNs+DvRYS9/x9UyKNg9Q3jAx4=",
9+
"e0eq8p7jwq+a+Im8H7klTavTEXfxYjLdaqsDXKOb9uQ="
10+
],
11+
"desc": "modified proof@2 bit @4",
12+
"wantErr": true
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"size1": 1,
3+
"size2": 8,
4+
"root1": "bjQLnP+zepicpUTmu3gKLHiQHT+zNzh2hRGjBhevoB0=",
5+
"root2": "XcnaeacGWamtVZy3Ad7ZoqudgjqtL0lgz+Nw7/RgQyg=",
6+
"proof": [
7+
"",
8+
"lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
9+
"Xwg/ChozygdqlSeYMlgNs+DvRYS9/x9UyKNg9Q3jAx4=",
10+
"a0eq8p7jwq+a+Im8H7klTavTEXfxYjLdaqsDXKOb9uQ="
11+
],
12+
"desc": "preceding garbage",
13+
"wantErr": true
14+
}

0 commit comments

Comments
 (0)