diff --git a/arbo/utils.go b/arbo/utils_test.go similarity index 95% rename from arbo/utils.go rename to arbo/utils_test.go index de19a55..91d1868 100644 --- a/arbo/utils.go +++ b/arbo/utils_test.go @@ -21,13 +21,13 @@ type censusConfig struct { baseFiled *big.Int } -// generateCensusProofForTest generates a census proof for testing purposes, it +// GenerateCensusProofForTest generates a census proof for testing purposes, it // receives a configuration and a key-value pair to generate the proof for. // It returns the root, key, value, and siblings of the proof. The configuration // includes the temp directory to store the database, the number of valid // siblings, the total number of siblings, the key length, the hash function to // use in the merkle tree, and the base field to use in the finite field. -func generateCensusProofForTest(conf censusConfig, k, v []byte) (*big.Int, *big.Int, *big.Int, []*big.Int, error) { +func GenerateCensusProofForTest(conf censusConfig, k, v []byte) (*big.Int, *big.Int, *big.Int, []*big.Int, error) { defer func() { _ = os.RemoveAll(conf.dir) }() diff --git a/arbo/verifier_bls12377_test.go b/arbo/verifier_bls12377_test.go index ed694d1..983c372 100644 --- a/arbo/verifier_bls12377_test.go +++ b/arbo/verifier_bls12377_test.go @@ -54,7 +54,7 @@ func TestVerifierBLS12377(t *testing.T) { p.Stop() fmt.Println("constrains", p.NbConstraints()) // generate census proof - root, key, value, siblings, err := generateCensusProofForTest(censusConfig{ + root, key, value, siblings, err := GenerateCensusProofForTest(censusConfig{ dir: t.TempDir() + "/bls12377", validSiblings: v_siblings, totalSiblings: n_siblings, diff --git a/arbo/verifier_bn254_test.go b/arbo/verifier_bn254_test.go index fea971e..f6177c9 100644 --- a/arbo/verifier_bn254_test.go +++ b/arbo/verifier_bn254_test.go @@ -40,7 +40,7 @@ func TestVerifierBN254(t *testing.T) { p.Stop() fmt.Println("constrains", p.NbConstraints()) // generate census proof - root, key, value, siblings, err := generateCensusProofForTest(censusConfig{ + root, key, value, siblings, err := GenerateCensusProofForTest(censusConfig{ dir: t.TempDir() + "/bn254", validSiblings: v_siblings, totalSiblings: n_siblings,