2023-01-21 21:33:50 +00:00
|
|
|
package state
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ledgerwatch/erigon/cl/cltypes/clonable"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (b *BeaconState) EncodeSSZ(buf []byte) ([]byte, error) {
|
2023-05-04 13:18:42 +00:00
|
|
|
return b.BeaconState.EncodeSSZ(buf)
|
2023-01-21 21:33:50 +00:00
|
|
|
}
|
|
|
|
|
2023-05-05 09:19:24 +00:00
|
|
|
func (b *BeaconState) DecodeSSZ(buf []byte, version int) error {
|
|
|
|
if err := b.BeaconState.DecodeSSZ(buf, version); err != nil {
|
2023-01-21 21:33:50 +00:00
|
|
|
return err
|
|
|
|
}
|
2023-03-11 19:27:21 +00:00
|
|
|
return b.initBeaconState()
|
2023-01-21 21:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SSZ size of the Beacon State
|
|
|
|
func (b *BeaconState) EncodingSizeSSZ() (size int) {
|
2023-05-04 13:18:42 +00:00
|
|
|
return b.BeaconState.EncodingSizeSSZ()
|
2023-01-21 21:33:50 +00:00
|
|
|
}
|
|
|
|
|
2023-03-19 22:47:27 +00:00
|
|
|
func (b *BeaconState) Clone() clonable.Clonable {
|
2023-05-04 13:18:42 +00:00
|
|
|
return New(b.BeaconConfig())
|
2023-01-21 21:33:50 +00:00
|
|
|
}
|