mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 12:27:18 +00:00
b82e2e7d40
* 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>
19 lines
361 B
Go
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()
|
|
}
|