diff --git a/tests/go.mod b/tests/go.mod index 2df63ec..f6b4536 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,8 +3,8 @@ module github.com/iden3/go-rapidsnark/tests go 1.18 require ( - github.com/iden3/go-rapidsnark/prover v0.0.6 - github.com/iden3/go-rapidsnark/verifier v0.0.3 + github.com/iden3/go-rapidsnark/prover v0.0.10 + github.com/iden3/go-rapidsnark/verifier v0.0.5 github.com/stretchr/testify v1.8.2 ) diff --git a/witness/circom2witnesscalc_test.go b/witness/circom2witnesscalc_test.go index 9ec356c..bec7498 100644 --- a/witness/circom2witnesscalc_test.go +++ b/witness/circom2witnesscalc_test.go @@ -1,7 +1,7 @@ package witness import ( - "io/ioutil" + "os" "testing" "github.com/stretchr/testify/require" @@ -10,10 +10,10 @@ import ( const defaultFileMode = 0644 func TestCircom2CalculateWitness(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2/input.json") + inputBytes, err := os.ReadFile("testdata/circom2/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -29,10 +29,10 @@ func TestCircom2CalculateWitness(t *testing.T) { } func TestCircom2CalculateBinWitness(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2/input.json") + inputBytes, err := os.ReadFile("testdata/circom2/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -48,10 +48,10 @@ func TestCircom2CalculateBinWitness(t *testing.T) { } func TestCircom2CalculateWTNSBin(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2/input.json") + inputBytes, err := os.ReadFile("testdata/circom2/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -65,15 +65,15 @@ func TestCircom2CalculateWTNSBin(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, wtnsBytes) - //_ = ioutil.WriteFile("test_files/circom2/witness.wtns", wtnsBytes, fs.FileMode(defaultFileMode)) + //_ = os.WriteFile("testdata/circom2/witness.wtns", wtnsBytes, fs.FileMode(defaultFileMode)) } // TestCircom2CalculateWitness210 tests the calculation of the witness for the circom 2.1.0 func TestCircom2CalculateWitness210(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2_1_0/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2_1_0/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2_1_0/input.json") + inputBytes, err := os.ReadFile("testdata/circom2_1_0/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -90,10 +90,10 @@ func TestCircom2CalculateWitness210(t *testing.T) { // TestCircom2CalculateBinWitness210 tests the calculation of the witness for the circom 2.1.0 func TestCircom2CalculateBinWitness210(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2_1_0/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2_1_0/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2_1_0/input.json") + inputBytes, err := os.ReadFile("testdata/circom2_1_0/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -110,10 +110,10 @@ func TestCircom2CalculateBinWitness210(t *testing.T) { // TestCircom2CalculateWTNSBin210 tests the calculation of the witness for the circom 2.1.0 func TestCircom2CalculateWTNSBin210(t *testing.T) { - wasmBytes, err := ioutil.ReadFile("test_files/circom2_1_0/circuit.wasm") + wasmBytes, err := os.ReadFile("testdata/circom2_1_0/circuit.wasm") require.NoError(t, err) - inputBytes, err := ioutil.ReadFile("test_files/circom2_1_0/input.json") + inputBytes, err := os.ReadFile("testdata/circom2_1_0/input.json") require.NoError(t, err) calc, err := NewCircom2WitnessCalculator(wasmBytes, true) @@ -127,5 +127,5 @@ func TestCircom2CalculateWTNSBin210(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, wtnsBytes) - //_ = ioutil.WriteFile("test_files/circom2_1_0/witness.wtns", wtnsBytes, fs.FileMode(defaultFileMode)) + //_ = os.WriteFile("testdata/circom2_1_0/witness.wtns", wtnsBytes, fs.FileMode(defaultFileMode)) } diff --git a/witness/test_files/circom2/circuit.wasm b/witness/testdata/circom2/circuit.wasm similarity index 100% rename from witness/test_files/circom2/circuit.wasm rename to witness/testdata/circom2/circuit.wasm diff --git a/witness/test_files/circom2/input.json b/witness/testdata/circom2/input.json similarity index 100% rename from witness/test_files/circom2/input.json rename to witness/testdata/circom2/input.json diff --git a/witness/test_files/circom2_1_0/circuit.wasm b/witness/testdata/circom2_1_0/circuit.wasm similarity index 100% rename from witness/test_files/circom2_1_0/circuit.wasm rename to witness/testdata/circom2_1_0/circuit.wasm diff --git a/witness/test_files/circom2_1_0/input.json b/witness/testdata/circom2_1_0/input.json similarity index 100% rename from witness/test_files/circom2_1_0/input.json rename to witness/testdata/circom2_1_0/input.json