2022-04-29 18:20:18 +00:00
|
|
|
//go:build go1.18
|
2022-01-29 08:01:58 +00:00
|
|
|
|
|
|
|
package p2p_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p"
|
|
|
|
"github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/encoder"
|
2022-01-29 08:01:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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 {
|
2022-04-29 18:20:18 +00:00
|
|
|
return
|
2022-01-29 08:01:58 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|