Files
prysm/encoding/ssz/query/vector.go
Jun Song e1117a7de2 SSZ-QL: Handle Vector type & Add SSZ tag parser for multi-dimensional parsing (#15668)
* Add vectorInfo

* Add 2D bytes field for test

* Add tag_parser for parsing SSZ tags

* Integrate tag parser with analyzer

* Add ByteList test case

* Changelog

* Better printing feature with Stringer implementation

* Return error for non-determined case without printing other values

* Update tag_parser.go: handle Vector and List mutually exclusive (inspired by OffchainLabs/fastssz)

* Make linter happy

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2025-09-09 20:35:06 +00:00

28 lines
484 B
Go

package query
import "errors"
// vectorInfo holds information about a SSZ Vector type.
type vectorInfo struct {
// element is the SSZ info of the vector's element type.
element *sszInfo
// length is the fixed length of the vector.
length uint64
}
func (v *vectorInfo) Length() uint64 {
if v == nil {
return 0
}
return v.length
}
func (v *vectorInfo) Element() (*sszInfo, error) {
if v == nil {
return nil, errors.New("vectorInfo is nil")
}
return v.element, nil
}