Documentation
¶
Index ¶
- func PopulateVariableLengthInfo(sszInfo *SszInfo, value reflect.Value) error
- type PathElement
- type SSZDimension
- type SSZObject
- type SSZType
- type SszInfo
- func (info *SszInfo) BitlistInfo() (*bitlistInfo, error)
- func (info *SszInfo) BitvectorInfo() (*bitvectorInfo, error)
- func (info *SszInfo) ContainerInfo() (*containerInfo, error)
- func (info *SszInfo) HashTreeRoot() ([32]byte, error)
- func (info *SszInfo) ListInfo() (*listInfo, error)
- func (info *SszInfo) Print() string
- func (info *SszInfo) Size() uint64
- func (info *SszInfo) String() string
- func (info *SszInfo) VectorInfo() (*vectorInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PopulateVariableLengthInfo ¶
PopulateVariableLengthInfo populates runtime information for SSZ fields of variable-sized types. This function updates the SszInfo structure with actual lengths and offsets that can only be determined at runtime for variable-sized items like Lists and variable-sized Container fields.
Types ¶
type PathElement ¶
PathElement represents a single element in a path.
func ParsePath ¶
func ParsePath(rawPath string) ([]PathElement, error)
type SSZDimension ¶
type SSZDimension struct {
// contains filtered or unexported fields
}
SSZDimension holds parsed SSZ tag information for current dimension. Mutually exclusive fields indicate whether the dimension is a vector or a list.
func ParseSSZTag ¶
ParseSSZTag parses SSZ-specific tags (like `ssz-max` and `ssz-size`) and returns the first dimension and the remaining SSZ tags. This function validates the tags and returns an error if they are malformed.
func (*SSZDimension) GetListLimit ¶
func (d *SSZDimension) GetListLimit() (uint64, error)
GetListLimit returns the limit for a list in current dimension
func (*SSZDimension) GetVectorLength ¶
func (d *SSZDimension) GetVectorLength() (uint64, error)
GetVectorLength returns the length for a vector in current dimension
func (*SSZDimension) IsList ¶
func (d *SSZDimension) IsList() bool
IsList returns true if this dimension represents a list.
func (*SSZDimension) IsVector ¶
func (d *SSZDimension) IsVector() bool
IsVector returns true if this dimension represents a vector.
type SSZType ¶
type SSZType int
SSZType represents the type supported by SSZ. https://github.com/ethereum/consensus-specs/blob/master/ssz/simple-serialize.md#typing
type SszInfo ¶ added in v6.1.4
type SszInfo struct {
// contains filtered or unexported fields
}
SszInfo holds the all necessary data for analyzing SSZ data types.
func AnalyzeObject ¶
AnalyzeObject analyzes given object and returns its SSZ information.
func CalculateOffsetAndLength ¶
func CalculateOffsetAndLength(sszInfo *SszInfo, path []PathElement) (*SszInfo, uint64, uint64, error)
CalculateOffsetAndLength calculates the offset and length of a given path within the SSZ object. By walking the given path, it accumulates the offsets based on SszInfo.
func (*SszInfo) BitlistInfo ¶ added in v6.1.4
func (*SszInfo) BitvectorInfo ¶ added in v6.1.4
func (*SszInfo) ContainerInfo ¶ added in v6.1.4
func (*SszInfo) HashTreeRoot ¶ added in v6.1.4
HashTreeRoot calls the HashTreeRoot method on the stored interface if it implements SSZObject. Returns the 32-byte hash tree root or an error if the interface doesn't support hashing.
func (*SszInfo) Print ¶ added in v6.1.4
Print returns a string representation of the SszInfo, which is useful for debugging.
func (*SszInfo) String ¶ added in v6.1.4
String implements the Stringer interface for SszInfo. This follows the notation used in the consensus specs.