Skip to content

Commit

Permalink
Refactor batch_update_circuit_test.go to remove unused variables and …
Browse files Browse the repository at this point in the history
…update circuit keys
  • Loading branch information
sergeytimoshin committed Oct 14, 2024
1 parent fa95a6f commit 9d3d1ba
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions light-prover/prover/batch_update_circuit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,6 @@ func TestBatchUpdateCircuit(t *testing.T) {
assert.Error(err)
})

t.Run("Invalid HashChainStartIndex", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)

circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)

// Modify HashChainStartIndex to make it invalid
witness.HashChainStartIndex = frontend.Variable(params.HashChainStartIndex + 1)

err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})

t.Run("Invalid leaf", func(t *testing.T) {
treeDepth := 10
batchSize := 5
Expand Down Expand Up @@ -183,7 +168,6 @@ func createBatchUpdateCircuit(treeDepth, batchSize int) BatchUpdateCircuit {
Leaves: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
PathIndices: make([]frontend.Variable, batchSize),
HashChainStartIndex: frontend.Variable(0),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
Expand All @@ -203,7 +187,6 @@ func createBatchUpdateWitness(params *BatchUpdateParameters, startIndex, count i
Leaves: make([]frontend.Variable, count),
MerkleProofs: make([][]frontend.Variable, count),
PathIndices: make([]frontend.Variable, count),
HashChainStartIndex: frontend.Variable(params.HashChainStartIndex + uint32(startIndex)),
Height: params.Height,
BatchSize: uint32(count),
}
Expand Down

0 comments on commit 9d3d1ba

Please sign in to comment.