Skip to content

Commit 787a31e

Browse files
committed
fix tests
1 parent 43aace9 commit 787a31e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

crypto/kzg4844/kzg4844_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ func benchmarkBlobToCommitment(b *testing.B, ckzg bool) {
105105

106106
blob := randBlob()
107107

108-
for b.Loop() {
108+
b.ResetTimer()
109+
for i := 0; i < b.N; i++ {
109110
BlobToCommitment(blob)
110111
}
111112
}
@@ -124,7 +125,8 @@ func benchmarkComputeProof(b *testing.B, ckzg bool) {
124125
point = randFieldElement()
125126
)
126127

127-
for b.Loop() {
128+
b.ResetTimer()
129+
for i := 0; i < b.N; i++ {
128130
ComputeProof(blob, point)
129131
}
130132
}
@@ -145,7 +147,8 @@ func benchmarkVerifyProof(b *testing.B, ckzg bool) {
145147
proof, claim, _ = ComputeProof(blob, point)
146148
)
147149

148-
for b.Loop() {
150+
b.ResetTimer()
151+
for i := 0; i < b.N; i++ {
149152
VerifyProof(commitment, point, claim, proof)
150153
}
151154
}
@@ -164,7 +167,8 @@ func benchmarkComputeBlobProof(b *testing.B, ckzg bool) {
164167
commitment, _ = BlobToCommitment(blob)
165168
)
166169

167-
for b.Loop() {
170+
b.ResetTimer()
171+
for i := 0; i < b.N; i++ {
168172
ComputeBlobProof(blob, commitment)
169173
}
170174
}
@@ -184,7 +188,8 @@ func benchmarkVerifyBlobProof(b *testing.B, ckzg bool) {
184188
proof, _ = ComputeBlobProof(blob, commitment)
185189
)
186190

187-
for b.Loop() {
191+
b.ResetTimer()
192+
for i := 0; i < b.N; i++ {
188193
VerifyBlobProof(blob, commitment, proof)
189194
}
190195
}
@@ -246,7 +251,8 @@ func benchmarkComputeCellProofs(b *testing.B, ckzg bool) {
246251
_, _ = ComputeCellProofs(blob) // for kzg initialization
247252
b.ResetTimer()
248253

249-
for b.Loop() {
254+
b.ResetTimer()
255+
for i := 0; i < b.N; i++ {
250256
_, err := ComputeCellProofs(blob)
251257
if err != nil {
252258
b.Fatalf("failed to create KZG proof at point: %v", err)

0 commit comments

Comments
 (0)