diff --git a/tests/testtypes/consensus-spec-tests/gen_bits_struct_ssz.go b/tests/testtypes/consensus-spec-tests/gen_bits_struct_ssz.go index 1115077..884417d 100644 --- a/tests/testtypes/consensus-spec-tests/gen_bits_struct_ssz.go +++ b/tests/testtypes/consensus-spec-tests/gen_bits_struct_ssz.go @@ -6,13 +6,13 @@ import "github.com/karalabe/ssz" // SizeSSZ returns either the static size of the object if fixed == true, or // the total size otherwise. -func (obj *BitsStruct) SizeSSZ(fixed bool) uint32 { - var size = uint32(4 + 1 + 1 + 4 + 1) +func (obj *BitsStruct) SizeSSZ(sizer *ssz.Sizer, fixed bool) (size uint32) { + size = 4 + 1 + 1 + 4 + 1 if fixed { return size } - size += ssz.SizeSliceOfBits(obj.A) - size += ssz.SizeSliceOfBits(obj.D) + size += ssz.SizeSliceOfBits(sizer, obj.A) + size += ssz.SizeSliceOfBits(sizer, obj.D) return size } diff --git a/tests/testtypes/consensus-spec-tests/gen_fixed_test_struct_ssz.go b/tests/testtypes/consensus-spec-tests/gen_fixed_test_struct_ssz.go index cfebc25..c9c5f25 100644 --- a/tests/testtypes/consensus-spec-tests/gen_fixed_test_struct_ssz.go +++ b/tests/testtypes/consensus-spec-tests/gen_fixed_test_struct_ssz.go @@ -5,7 +5,7 @@ package consensus_spec_tests import "github.com/karalabe/ssz" // SizeSSZ returns the total size of the static ssz object. -func (obj *FixedTestStruct) SizeSSZ() uint32 { +func (obj *FixedTestStruct) SizeSSZ(sizer *ssz.Sizer) uint32 { return 1 + 8 + 4 } diff --git a/tests/testtypes/consensus-spec-tests/gen_single_field_test_struct_ssz.go b/tests/testtypes/consensus-spec-tests/gen_single_field_test_struct_ssz.go index 4790439..a101db8 100644 --- a/tests/testtypes/consensus-spec-tests/gen_single_field_test_struct_ssz.go +++ b/tests/testtypes/consensus-spec-tests/gen_single_field_test_struct_ssz.go @@ -5,7 +5,7 @@ package consensus_spec_tests import "github.com/karalabe/ssz" // SizeSSZ returns the total size of the static ssz object. -func (obj *SingleFieldTestStruct) SizeSSZ() uint32 { +func (obj *SingleFieldTestStruct) SizeSSZ(sizer *ssz.Sizer) uint32 { return 1 } diff --git a/tests/testtypes/consensus-spec-tests/gen_small_test_struct_ssz.go b/tests/testtypes/consensus-spec-tests/gen_small_test_struct_ssz.go index 020e433..8191ad5 100644 --- a/tests/testtypes/consensus-spec-tests/gen_small_test_struct_ssz.go +++ b/tests/testtypes/consensus-spec-tests/gen_small_test_struct_ssz.go @@ -5,7 +5,7 @@ package consensus_spec_tests import "github.com/karalabe/ssz" // SizeSSZ returns the total size of the static ssz object. -func (obj *SmallTestStruct) SizeSSZ() uint32 { +func (obj *SmallTestStruct) SizeSSZ(sizer *ssz.Sizer) uint32 { return 2 + 2 } diff --git a/tests/testtypes/consensus-spec-tests/types_monoliths.go b/tests/testtypes/consensus-spec-tests/types_monoliths.go index c9ab5f0..153526f 100644 --- a/tests/testtypes/consensus-spec-tests/types_monoliths.go +++ b/tests/testtypes/consensus-spec-tests/types_monoliths.go @@ -6,10 +6,10 @@ package consensus_spec_tests import "github.com/holiman/uint256" -//go:generate go run ../../../cmd/sszgen -type ExecutionPayloadMonolith -out gen_execution_payload_monolith_ssz.go -//go:generate go run ../../../cmd/sszgen -type ExecutionPayloadHeaderMonolith -out gen_execution_payload_header_monolith_ssz.go -//go:generate go run ../../../cmd/sszgen -type BeaconBlockBodyMonolith -out gen_beacon_block_body_monolith_ssz.go -//go:generate go run ../../../cmd/sszgen -type BeaconStateMonolith -out gen_beacon_state_monolith_ssz.go +//go:generate go run -cover ../../../cmd/sszgen -type ExecutionPayloadMonolith -out gen_execution_payload_monolith_ssz.go +//go:generate go run -cover ../../../cmd/sszgen -type ExecutionPayloadHeaderMonolith -out gen_execution_payload_header_monolith_ssz.go +//go:generate go run -cover ../../../cmd/sszgen -type BeaconBlockBodyMonolith -out gen_beacon_block_body_monolith_ssz.go +//go:generate go run -cover ../../../cmd/sszgen -type BeaconStateMonolith -out gen_beacon_state_monolith_ssz.go type BeaconBlockBodyMonolith struct { RandaoReveal [96]byte