prysm-pulse/beacon-chain/operations/attestations/kv/benchmark_test.go
Victor Farazdagi 748d513c62
proper error checking and type assertions (#5424)
* proper error checking and type assertions
2020-04-14 16:41:09 +00:00

24 lines
468 B
Go

package kv_test
import (
"testing"
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations/kv"
)
func BenchmarkAttCaches(b *testing.B) {
ac := kv.NewAttCaches()
att := &ethpb.Attestation{}
for i := 0; i < b.N; i++ {
if err := ac.SaveUnaggregatedAttestation(att); err != nil {
b.Error(err)
}
if err := ac.DeleteAggregatedAttestation(att); err != nil {
b.Error(err)
}
}
}