erigon-pulse/cmd/erigon-cl/core/state/ssz.go

26 lines
566 B
Go
Raw Normal View History

package state
import (
"github.com/ledgerwatch/erigon-lib/types/clonable"
)
func (b *BeaconState) EncodeSSZ(buf []byte) ([]byte, error) {
return b.BeaconState.EncodeSSZ(buf)
}
func (b *BeaconState) DecodeSSZ(buf []byte, version int) error {
if err := b.BeaconState.DecodeSSZ(buf, version); err != nil {
return err
}
return b.initBeaconState()
}
// SSZ size of the Beacon State
func (b *BeaconState) EncodingSizeSSZ() (size int) {
return b.BeaconState.EncodingSizeSSZ()
}
func (b *BeaconState) Clone() clonable.Clonable {
return New(b.BeaconConfig())
}