2020-09-14 18:42:08 +00:00
|
|
|
package fuzz
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/p2p/encoder"
|
2021-06-02 23:49:52 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
2020-09-14 18:42:08 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/shared/params"
|
|
|
|
)
|
|
|
|
|
|
|
|
var buf = new(bytes.Buffer)
|
|
|
|
|
|
|
|
// SszEncoderAttestationFuzz runs network encode/decode for attestations.
|
|
|
|
func SszEncoderAttestationFuzz(b []byte) {
|
|
|
|
params.UseMainnetConfig()
|
|
|
|
buf.Reset()
|
|
|
|
input := ðpb.Attestation{}
|
|
|
|
e := encoder.SszNetworkEncoder{}
|
|
|
|
if err := e.DecodeGossip(b, input); err != nil {
|
|
|
|
_ = err
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if _, err := e.EncodeGossip(buf, input); err != nil {
|
|
|
|
_ = err
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|