mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
* Add SizeSSZ as a member of SSZObject * Temporarily rename dereferencePointer function * Fix analyzeType: use reflect.Value for analyzing * Fix PopulateVariableLengthInfo: change function signature & reset pointer * Remove Container arm for Size function as it'll be handled in the previous branch * Remove OffsetBytes function in listInfo * Refactor and document codes * Remove misleading "fixedSize" concept & Add Uint8...64 SSZTypes * Add size testing * Move TestSSZObject_Batch and rename it as TestHashTreeRoot * Changelog :) * Rename endOffset to fixedOffset --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
25 lines
385 B
Go
25 lines
385 B
Go
package query
|
|
|
|
// bitvectorInfo holds information about a SSZ Bitvector type.
|
|
type bitvectorInfo struct {
|
|
// length is the fixed length of bits of the Bitvector.
|
|
length uint64
|
|
}
|
|
|
|
func (v *bitvectorInfo) Length() uint64 {
|
|
if v == nil {
|
|
return 0
|
|
}
|
|
|
|
return v.length
|
|
}
|
|
|
|
func (v *bitvectorInfo) Size() uint64 {
|
|
if v == nil {
|
|
return 0
|
|
}
|
|
|
|
// Size in bytes.
|
|
return v.length / 8
|
|
}
|