Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Jul 31, 2024
1 parent 18f56ec commit 83912b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mod/consensus-types/pkg/types/payload_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func TestExecutionPayloadHeader_Serialization(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, data)

var unmarshalled = new(types.ExecutionPayloadHeader).Empty(version.Deneb)
var unmarshalled = new(types.ExecutionPayloadHeader).Empty()
err = unmarshalled.UnmarshalSSZ(data)
require.NoError(t, err)
require.Equal(t, original, unmarshalled)
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestExecutionPayloadHeader_GetTree(t *testing.T) {

func TestExecutionPayloadHeader_Empty(t *testing.T) {
header := new(types.ExecutionPayloadHeader)
emptyHeader := header.Empty(version.Deneb)
emptyHeader := header.Empty()

require.NotNil(t, emptyHeader)
require.Equal(t, version.Deneb, emptyHeader.Version())
Expand Down
12 changes: 9 additions & 3 deletions mod/consensus-types/pkg/types/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ func (st *BeaconState[
/* -------------------------------------------------------------------------- */

// SizeSSZ returns the ssz encoded size in bytes for the BeaconState object.
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) SizeSSZ(fixed bool) uint32 {
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) SizeSSZ(
fixed bool,
) uint32 {
var size uint32 = 300

if fixed {
Expand All @@ -182,7 +184,9 @@ func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) SizeSSZ(fixed bool) uint32
// DefineSSZ defines the SSZ encoding for the BeaconState object.
//
//nolint:mnd // todo fix.
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) DefineSSZ(codec *ssz.Codec) {
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) DefineSSZ(
codec *ssz.Codec,
) {
// Versioning
ssz.DefineStaticBytes(codec, &st.GenesisValidatorsRoot)
ssz.DefineUint64(codec, &st.Slot)
Expand Down Expand Up @@ -230,7 +234,9 @@ func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) MarshalSSZ() ([]byte, error
}

// UnmarshalSSZ unmarshals the BeaconState from SSZ format.
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) UnmarshalSSZ(buf []byte) error {
func (st *BeaconState[_, _, _, _, _, _, _, _, _, _]) UnmarshalSSZ(
buf []byte,
) error {
return ssz.DecodeFromBytes(buf, st)
}

Expand Down

0 comments on commit 83912b1

Please sign in to comment.