erigon-pulse/cmd/erigon-cl/core/state/ssz.go
Roberto Bayardo 8356f3a320
use ssz from updated erigon-lib (#7490)
ssz/clonable interfaces have been moved to erigon-lib so they can be
shared with the txpool code there
2023-05-11 12:54:20 +01:00

26 lines
566 B
Go

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())
}