Type "PTCStatus" has both value and pointer receivers
66}
67
68// SizeSSZ --
69func (s *PTCStatus) SizeSSZ() int {70 return 1
71}
Type "PTCStatus" has both value and pointer receivers
57}
58
59// MarshalSSZ --
60func (s *PTCStatus) MarshalSSZ() ([]byte, error) {61 if *s > math.MaxUint8 {
62 return nil, fmt.Errorf("expected uint8 value, received %d", uint64(*s))
63 }
Type "PTCStatus" has both value and pointer receivers
48}
49
50// MarshalSSZTo --
51func (s *PTCStatus) MarshalSSZTo(dst []byte) ([]byte, error) {52 marshalled, err := s.MarshalSSZ()
53 if err != nil {
54 return nil, err
Type "PTCStatus" has both value and pointer receivers
39}
40
41// UnmarshalSSZ --
42func (s *PTCStatus) UnmarshalSSZ(buf []byte) error {43 if len(buf) != s.SizeSSZ() {
44 return fmt.Errorf("expected buffer of length %d received %d", s.SizeSSZ(), len(buf))
45 }
Type "PTCStatus" has both value and pointer receivers
30}
31
32// HashTreeRootWith --
33func (s PTCStatus) HashTreeRootWith(hh *fssz.Hasher) error {34 if s > math.MaxUint8 {
35 return fmt.Errorf("expected uint8 value, received %d", uint64(s))
36 }
Type "PTCStatus" has both value and pointer receivers
25)
26
27// HashTreeRoot --
28func (s PTCStatus) HashTreeRoot() ([32]byte, error) {29 return fssz.HashWithDefaultHasher(s)
30}
31
Type "BeaconBlockBody" has both value and pointer receivers
326 panic("implement me")
327}
328
329func (b *BeaconBlockBody) SignedExecutionPayloadHeader() (*enginev1.SignedExecutionPayloadHeader, error) {330 panic("implement me")
331}
332
Type "BeaconBlockBody" has both value and pointer receivers
322 panic("implement me")
323}
324
325func (b *BeaconBlockBody) PayloadAttestations() ([]*eth.PayloadAttestation, error) {326 panic("implement me")
327}
328
Type "BeaconBlockBody" has both value and pointer receivers
318 panic("implement me")
319}
320
321func (b *BeaconBlockBody) Version() int {322 panic("implement me")
323}
324
Type "BeaconBlockBody" has both value and pointer receivers
314 panic("implement me")
315}
316
317func (b *BeaconBlockBody) Attestations() []*eth.Attestation {318 panic("implement me")
319}
320
Type "BeaconBlockBody" has both value and pointer receivers
310}
311
312// BlobKzgCommitments returns the blob kzg commitments in the block.
313func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) {314 panic("implement me")
315}
316
Type "BeaconBlockBody" has both value and pointer receivers
305 panic("implement me")
306}
307
308func (b *BeaconBlockBody) SetBLSToExecutionChanges([]*eth.SignedBLSToExecutionChange) error {309 panic("implement me")
310}
311
Type "BeaconBlockBody" has both value and pointer receivers
301 panic("implement me")
302}
303
304func (b *BeaconBlockBody) SetExecution(interfaces.ExecutionData) error {305 panic("implement me")
306}
307
Type "BeaconBlockBody" has both value and pointer receivers
297 panic("implement me")
298}
299
300func (b *BeaconBlockBody) SetSyncAggregate(*eth.SyncAggregate) error {301 panic("implement me")
302}
303
Type "BeaconBlockBody" has both value and pointer receivers
293 panic("implement me")
294}
295
296func (b *BeaconBlockBody) SetVoluntaryExits([]*eth.SignedVoluntaryExit) {297 panic("implement me")
298}
299
Type "BeaconBlockBody" has both value and pointer receivers
289 panic("implement me")
290}
291
292func (b *BeaconBlockBody) SetDeposits([]*eth.Deposit) {293 panic("implement me")
294}
295
Type "BeaconBlockBody" has both value and pointer receivers
285 panic("implement me")
286}
287
288func (b *BeaconBlockBody) SetAttestations([]*eth.Attestation) {289 panic("implement me")
290}
291
Type "BeaconBlockBody" has both value and pointer receivers
281 panic("implement me")
282}
283
284func (b *BeaconBlockBody) SetAttesterSlashings([]*eth.AttesterSlashing) {285 panic("implement me")
286}
287
Type "BeaconBlockBody" has both value and pointer receivers
277 panic("implement me")
278}
279
280func (b *BeaconBlockBody) SetProposerSlashings([]*eth.ProposerSlashing) {281 panic("implement me")
282}
283
Type "BeaconBlockBody" has both value and pointer receivers
273 panic("implement me")
274}
275
276func (b *BeaconBlockBody) SetGraffiti([]byte) {277 panic("implement me")
278}
279
Type "BeaconBlockBody" has both value and pointer receivers
269 panic("implement me")
270}
271
272func (b *BeaconBlockBody) SetEth1Data(*eth.Eth1Data) {273 panic("implement me")
274}
275
Type "BeaconBlockBody" has both value and pointer receivers
265 panic("implement me")
266}
267
268func (b *BeaconBlockBody) SetRandaoReveal([]byte) {269 panic("implement me")
270}
271
Type "BeaconBlock" has both value and pointer receivers
261 panic("implement me")
262}
263
264func (b *BeaconBlock) SetStateRoot(root []byte) {265 panic("implement me")
266}
267
Type "BeaconBlockBody" has both value and pointer receivers
257 panic("implement me")
258}
259
260func (BeaconBlockBody) BLSToExecutionChanges() ([]*eth.SignedBLSToExecutionChange, error) {261 panic("implement me")
262}
263
Type "BeaconBlockBody" has both value and pointer receivers
253 panic("implement me")
254}
255
256func (BeaconBlockBody) Execution() (interfaces.ExecutionData, error) {257 panic("implement me")
258}
259
Description
(Go's FAQ)[https://go.dev/doc/faq#methodsonvaluesorpointers] recommends that method receivers should be consistent. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. This is because value and pointer receivers have different method sets.
Bad practice
package main
type foo struct {
a int
}
func (f foo) a() {}
func (f *foo) b() {
f.a = 10
}
Recommended
package main
type foo struct {
a int
}
func (f *foo) a() {}
func (f *foo) b() {
f.a = 10
}