erigon-pulse/cl/persistence/state/slot_data_test.go
Giulio rebuffo 46ecf030f5
Added GET /eth/v1/beacon/rewards/blocks/{block_id} and POST /eth/v1/beacon/rewards/sync_committee/{block_id} (#9102)
* Changed slightly archive format (again)
* Added all of the remaining rewards endpoints
2023-12-30 20:51:28 +01:00

31 lines
638 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 TestSlotData(t *testing.T) {
m := &SlotData{
Version: clparams.CapellaVersion,
Eth1Data: &cltypes.Eth1Data{},
Eth1DepositIndex: 0,
NextWithdrawalIndex: 0,
NextWithdrawalValidatorIndex: 0,
}
var b bytes.Buffer
if err := m.WriteTo(&b); err != nil {
t.Fatal(err)
}
m2 := &SlotData{}
if err := m2.ReadFrom(&b); err != nil {
t.Fatal(err)
}
require.Equal(t, m, m2)
}