prysm-pulse/beacon-chain/state/state-native/ssz.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

19 lines
361 B
Go

package state_native
import (
"github.com/pkg/errors"
ssz "github.com/prysmaticlabs/fastssz"
)
var errAssertionFailed = errors.New("failed to convert interface to proto state")
func (b *BeaconState) MarshalSSZ() ([]byte, error) {
proto := b.ToProto()
s, ok := proto.(ssz.Marshaler)
if !ok {
return nil, errAssertionFailed
}
return s.MarshalSSZ()
}