prysm-pulse/beacon-chain/p2p/pubsub_fuzz_test.go
Preston Van Loon 58733a9f40
go 1.18 fuzz tests: initial testing (#10063)
* Add basic fuzz test

* Add a few tests for HTR utils

* gofmt

* Add requirement for fuzz gotag

* Run gaz and fix tags

* Update pubsub_fuzz_test.go

I'll fix this later

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-01-29 08:01:58 +00:00

25 lines
537 B
Go

//go:build fuzz && go1.18 && disabled
// +build fuzz,go1.18,disabled
package p2p_test
import (
"fmt"
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p/encoder"
)
func FuzzMsgID(f *testing.F) {
validTopic := fmt.Sprintf(p2p.BlockSubnetTopicFormat, []byte{0xb5, 0x30, 0x3f, 0x2a}) + "/" + encoder.ProtocolSuffixSSZSnappy
f.Add(validTopic)
f.Fuzz(func(t *testing.T, topic string) {
_, err := p2p.ExtractGossipDigest(topic)
if err != nil {
t.Fatal(err)
}
})
}