mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
cc643ac4cc
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
19 lines
356 B
Go
19 lines
356 B
Go
package state_native
|
|
|
|
import (
|
|
ssz "github.com/ferranbt/fastssz"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
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()
|
|
}
|