mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
* move eth2 types into Prysm * bazel * lint * use existing math helpers * rem eth2-types dep Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
22 lines
369 B
Go
22 lines
369 B
Go
package types
|
|
|
|
import (
|
|
fssz "github.com/ferranbt/fastssz"
|
|
)
|
|
|
|
// SSZBytes --
|
|
type SSZBytes []byte
|
|
|
|
// HashTreeRoot --
|
|
func (b *SSZBytes) HashTreeRoot() ([32]byte, error) {
|
|
return fssz.HashWithDefaultHasher(b)
|
|
}
|
|
|
|
// HashTreeRootWith --
|
|
func (b *SSZBytes) HashTreeRootWith(hh *fssz.Hasher) error {
|
|
indx := hh.Index()
|
|
hh.PutBytes(*b)
|
|
hh.Merkleize(indx)
|
|
return nil
|
|
}
|