Files
prysm/consensus-types/primitives/sszbytes.go
Raul Jordan 001f719cc3 Move ETH2 Types Into Prysm (#10534)
* 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>
2022-04-28 13:57:40 +00:00

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
}