Skip to content

Commit

Permalink
making some test helpers public
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Nov 20, 2024
1 parent 5bccb51 commit a906a5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions arbo/utils.go → arbo/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()
Expand Down
2 changes: 1 addition & 1 deletion arbo/verifier_bls12377_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion arbo/verifier_bn254_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a906a5d

Please sign in to comment.