erigon-pulse/cmd/erigon-cl/core/state/ssz.go
Giulio rebuffo 43b09a7f55
Refactor of ssz interface (#7439)
Also added a better way to copy and the hasher
2023-05-05 11:19:24 +02:00

26 lines
567 B
Go

package state
import (
"github.com/ledgerwatch/erigon/cl/cltypes/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())
}