mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 03:51:20 +00:00
c477281362
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
33 lines
773 B
Go
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)
|
|
}
|