Files
prysm/consensus-types/primitives/sszbytes.go
Radosław Kapka b82e2e7d40 Use prysmaticlabs/fastssz as a direct dependency (#10941)
* Update dependency

* Regenerate SSZ files

* fix BUILD files

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2022-06-28 13:03:24 +00:00

22 lines
374 B
Go

package types
import (
fssz "github.com/prysmaticlabs/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
}