erigon-pulse/cl/persistence/state/minimal_state_test.go
Giulio rebuffo c477281362
Caplin: Parallel historical states reconstruction (#8817)
What does this PR do:
* Optional Backfilling and Caplin Archive Node
* Create antiquary for historical states
* Fixed gaps of chain gap related to the Head of the chain and anchor of
the chain.
* Added basic reader object to Read the Historical state
2023-12-06 10:48:36 +01:00

33 lines
773 B
Go

package state_accessors
import (
"bytes"
"testing"
"github.com/ledgerwatch/erigon/cl/clparams"
"github.com/ledgerwatch/erigon/cl/cltypes"
"github.com/stretchr/testify/require"
)
func TestMinimalState(t *testing.T) {
m := &MinimalBeaconState{
Version: clparams.CapellaVersion,
Eth1Data: &cltypes.Eth1Data{},
Fork: &cltypes.Fork{},
Eth1DepositIndex: 0,
JustificationBits: &cltypes.JustificationBits{},
NextWithdrawalIndex: 0,
NextWithdrawalValidatorIndex: 0,
}
var b bytes.Buffer
if err := m.WriteTo(&b); err != nil {
t.Fatal(err)
}
m2 := &MinimalBeaconState{}
if err := m2.ReadFrom(&b); err != nil {
t.Fatal(err)
}
require.Equal(t, m, m2)
}