mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
Ignore XXX Fields in XXX SSZ Encoding (#1195)
* ignore XXX fields in struct * fix encode
This commit is contained in:
parent
5a50f6c5b6
commit
a4e1e8cc08
@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@ -89,6 +90,9 @@ type field struct {
|
||||
func sortedStructFields(typ reflect.Type) (fields []field, err error) {
|
||||
for i := 0; i < typ.NumField(); i++ {
|
||||
f := typ.Field(i)
|
||||
if strings.Contains(f.Name, "XXX") {
|
||||
continue
|
||||
}
|
||||
encDec, err := cachedEncoderDecoderNoAcquireLock(f.Type)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get encoder/decoder: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user