Skip to content

Commit

Permalink
leave the zkey download to tester
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust committed Dec 18, 2023
1 parent cf23b58 commit 03f139a
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions integration_tests/kzg_poseidon_prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
package integration

import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -66,38 +61,3 @@ func TestKZGPoseidonProver_GenerateZKProofs(t *testing.T) {
})
}
}

func init() {
proverPath, _ := filepath.Abs(prPath)
zkeyFile := filepath.Join(proverPath, "snarkjs", zkeyFile)
fileID := "1ZLfhYeCXMnbk6wUiBADRAn1mZ8MI_zg-"
if _, err := os.Stat(zkeyFile); os.IsNotExist(err) {
fmt.Printf("%s not found, start downloading...\n", zkeyFile)
cookieCmd := exec.Command("curl", "-c", "./cookie", "-s", "-L", fmt.Sprintf("https://drive.google.com/uc?export=download&id=%s", fileID))
cookieOutput, err := cookieCmd.Output()
if err != nil {
fmt.Println("Error downloading file:", err)
panic(err)
}
confirmCode := strings.TrimPrefix(strings.TrimSpace(string(cookieOutput)), "confirm=")
downloadCmd := exec.Command("curl", "-Lb", "./cookie", fmt.Sprintf("https://drive.google.com/uc?export=download&confirm=%s&id=%s", confirmCode, fileID))
downloadOutput, err := downloadCmd.StdoutPipe()
if err != nil {
fmt.Println("Error downloading file:", err)
panic(err)
}
zkeyFileWriter, _ := os.Create(zkeyFile)
defer zkeyFileWriter.Close()

if err := downloadCmd.Start(); err != nil {
fmt.Println("Error downloading file:", err)
panic(err)
}

_, _ = io.Copy(zkeyFileWriter, downloadOutput)

if err := downloadCmd.Wait(); err != nil {
fmt.Println("Error downloading file:", err)
}
}
}

0 comments on commit 03f139a

Please sign in to comment.