From eea8ead8b4dd8569d8a15011aa70f2c3fbcb27f0 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 14:38:31 +0200 Subject: [PATCH 01/51] nits --- .../pkg/cometbft/service/middleware/abci.go | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index d18027ca3a..ba6bdf9a4d 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -196,21 +196,17 @@ func (h *ABCIMiddleware[ req *cmtabci.ProcessProposalRequest, ) (*cmtabci.ProcessProposalResponse, error) { var ( - err error startTime = time.Now() - blk BeaconBlockT - numMsgs int - sidecars BlobSidecarsT awaitCtx, cancel = context.WithTimeout(ctx, AwaitTimeout) ) defer cancel() // flush the channels to ensure that we are not handling old data. - if numMsgs = async.ClearChan(h.subBBVerified); numMsgs > 0 { + if numMsgs := async.ClearChan(h.subBBVerified); numMsgs > 0 { h.logger.Error( "WARNING: messages remaining in beacon block verification channel", "num_msgs", numMsgs) } - if numMsgs = async.ClearChan(h.subSCVerified); numMsgs > 0 { + if numMsgs := async.ClearChan(h.subSCVerified); numMsgs > 0 { h.logger.Error( "WARNING: messages remaining in sidecar verification channel", "num_msgs", numMsgs) @@ -219,32 +215,35 @@ func (h *ABCIMiddleware[ defer h.metrics.measureProcessProposalDuration(startTime) // Request the beacon block. - if blk, err = encoding. + blk, err := encoding. UnmarshalBeaconBlockFromABCIRequest[BeaconBlockT]( - req, 0, h.chainSpec.ActiveForkVersionForSlot(math.U64(req.Height)), - ); err != nil { + req, + BeaconBlockTxIndex, + h.chainSpec.ActiveForkVersionForSlot(math.U64(req.Height)), + ) + if err != nil { return h.createProcessProposalResponse(errors.WrapNonFatal(err)) } // notify that the beacon block has been received. - if err = h.dispatcher.Publish( - async.NewEvent(ctx, async.BeaconBlockReceived, blk), - ); err != nil { + blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, blk) + if err = h.dispatcher.Publish(blkEvent); err != nil { return h.createProcessProposalResponse(errors.WrapNonFatal(err)) } // Request the blob sidecars. - if sidecars, err = encoding. + sidecars, err := encoding. UnmarshalBlobSidecarsFromABCIRequest[BlobSidecarsT]( - req, 1, - ); err != nil { + req, + BlobSidecarsTxIndex, + ) + if err != nil { return h.createProcessProposalResponse(errors.WrapNonFatal(err)) } // notify that the sidecars have been received. - if err = h.dispatcher.Publish( - async.NewEvent(ctx, async.SidecarsReceived, sidecars), - ); err != nil { + blobEvent := async.NewEvent(ctx, async.SidecarsReceived, sidecars) + if err = h.dispatcher.Publish(blobEvent); err != nil { return h.createProcessProposalResponse(errors.WrapNonFatal(err)) } From 49538dcc476c469042299bce6d31fe7918ef8d1f Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 14:50:07 +0200 Subject: [PATCH 02/51] wip: extended sdk.Context use to middleware --- mod/consensus/pkg/cometbft/service/abci.go | 2 +- .../pkg/cometbft/service/middleware/abci.go | 10 ++++++---- mod/consensus/pkg/cometbft/service/types.go | 20 ++++++++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index 19acd798bc..fe5c4f3331 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -18,7 +18,7 @@ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND // TITLE. // -//nolint:contextcheck // its fine. + package cometbft import ( diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index ba6bdf9a4d..3fe78be6d5 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -31,6 +31,7 @@ import ( "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" cmtabci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) /* -------------------------------------------------------------------------- */ @@ -41,7 +42,7 @@ import ( func (h *ABCIMiddleware[ _, _, GenesisT, _, ]) InitGenesis( - ctx context.Context, + ctx sdk.Context, bz []byte, ) (transition.ValidatorUpdates, error) { var ( @@ -87,7 +88,7 @@ func (h *ABCIMiddleware[ func (h *ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, _, SlotDataT, ]) PrepareProposal( - ctx context.Context, + ctx sdk.Context, slotData SlotDataT, ) ([]byte, []byte, error) { var ( @@ -192,7 +193,7 @@ func (h *ABCIMiddleware[ func (h *ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, _, _, ]) ProcessProposal( - ctx context.Context, + ctx sdk.Context, req *cmtabci.ProcessProposalRequest, ) (*cmtabci.ProcessProposalResponse, error) { var ( @@ -311,7 +312,8 @@ func (*ABCIMiddleware[ func (h *ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, _, _, ]) FinalizeBlock( - ctx context.Context, req *cmtabci.FinalizeBlockRequest, + ctx sdk.Context, + req *cmtabci.FinalizeBlockRequest, ) (transition.ValidatorUpdates, error) { var ( err error diff --git a/mod/consensus/pkg/cometbft/service/types.go b/mod/consensus/pkg/cometbft/service/types.go index c2e9f0af82..4fd8da5255 100644 --- a/mod/consensus/pkg/cometbft/service/types.go +++ b/mod/consensus/pkg/cometbft/service/types.go @@ -29,6 +29,7 @@ import ( "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" cmtabci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) // AttestationData is an interface for accessing the attestation data. @@ -51,17 +52,22 @@ type BeaconState interface { type MiddlewareI interface { InitGenesis( - ctx context.Context, bz []byte, + sdk.Context, + []byte, ) (transition.ValidatorUpdates, error) - PrepareProposal(context.Context, *types.SlotData[ - *ctypes.AttestationData, - *ctypes.SlashingInfo]) ([]byte, []byte, error) + PrepareProposal( + sdk.Context, + *types.SlotData[ + *ctypes.AttestationData, + *ctypes.SlashingInfo], + ) ([]byte, []byte, error) ProcessProposal( - ctx context.Context, req *cmtabci.ProcessProposalRequest, + sdk.Context, + *cmtabci.ProcessProposalRequest, ) (*cmtabci.ProcessProposalResponse, error) FinalizeBlock( - ctx context.Context, - req *cmtabci.FinalizeBlockRequest, + sdk.Context, + *cmtabci.FinalizeBlockRequest, ) (transition.ValidatorUpdates, error) } From b303196f315c004f8ee5b1f15d045dde2527e07f Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:06:42 +0200 Subject: [PATCH 03/51] dropped unnecessary types and file --- mod/consensus/pkg/cometbft/service/helpers.go | 135 ------------------ mod/consensus/pkg/cometbft/service/types.go | 19 --- 2 files changed, 154 deletions(-) delete mode 100644 mod/consensus/pkg/cometbft/service/helpers.go diff --git a/mod/consensus/pkg/cometbft/service/helpers.go b/mod/consensus/pkg/cometbft/service/helpers.go deleted file mode 100644 index bd25e38875..0000000000 --- a/mod/consensus/pkg/cometbft/service/helpers.go +++ /dev/null @@ -1,135 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2024, Berachain Foundation. All rights reserved. -// Use of this software is governed by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. -package cometbft - -// package cometbft - -// import ( -// "sort" - -// "github.com/berachain/beacon-kit/mod/primitives/pkg/math" -// cmtabci "github.com/cometbft/cometbft/abci/types" -// v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1" -// sdk "github.com/cosmos/cosmos-sdk/types" -// ) - -// // convertPrepareProposalToSlotData converts a prepare proposal request to -// // a slot data. -// func (c *ConsensusEngine[ -// _, _, _, SlotDataT, _, _, -// ]) convertPrepareProposalToSlotData( -// ctx sdk.Context, -// req *cmtabci.PrepareProposalRequest, -// ) (SlotDataT, error) { -// var t SlotDataT - -// // Get the attestation data from the votes. -// attestationData, err := c.attestationsFromVotes( -// ctx, -// req.LocalLastCommit.Votes, -// //#nosec:G701 // safe. -// math.Slot(req.Height), -// ) -// if err != nil { -// return t, err -// } - -// // Get the slashing info from the misbehaviors. -// slashingInfo, err := c.slashingInfoFromMisbehaviors( -// ctx, -// req.Misbehavior, -// ) -// if err != nil { -// return t, err -// } - -// // Create the slot data. -// t = t.New( -// math.U64(req.Height), -// attestationData, -// slashingInfo, -// ) -// return t, nil -// } - -// // attestationsFromVotes returns a list of attestation data from the votes. -// func (c *ConsensusEngine[ -// AttestationDataT, _, _, _, _, _, -// ]) attestationsFromVotes( -// ctx sdk.Context, -// votes []v1.ExtendedVoteInfo, -// slot math.Slot, -// ) ([]AttestationDataT, error) { -// var err error -// var index math.U64 -// attestations := make([]AttestationDataT, len(votes)) -// st := c.sb.StateFromContext(ctx) -// root := st.HashTreeRoot() -// for i, vote := range votes { -// index, err = st.ValidatorIndexByCometBFTAddress(vote.Validator.Address) -// if err != nil { -// return nil, err -// } - -// var t AttestationDataT -// t = t.New( -// slot, -// index, -// root, -// ) -// attestations[i] = t -// } - -// // Attestations are sorted by index. -// sort.Slice(attestations, func(i, j int) bool { -// return attestations[i].GetIndex() < attestations[j].GetIndex() -// }) -// return attestations, nil -// } - -// // slashingInfoFromMisbehaviors returns a list of slashing info from the -// // comet misbehaviors. -// func (c *ConsensusEngine[ -// _, _, SlashingInfoT, _, _, _, -// ]) slashingInfoFromMisbehaviors( -// ctx sdk.Context, -// misbehaviors []v1.Misbehavior, -// ) ([]SlashingInfoT, error) { -// var err error -// var index math.U64 -// st := c.sb.StateFromContext(ctx) -// slashingInfo := make([]SlashingInfoT, len(misbehaviors)) -// for i, misbehavior := range misbehaviors { -// index, err = st.ValidatorIndexByCometBFTAddress( -// misbehavior.Validator.Address, -// ) -// if err != nil { -// return nil, err -// } -// var t SlashingInfoT -// t = t.New( -// //#nosec:G701 // safe. -// math.Slot(misbehavior.GetHeight()), -// index, -// ) -// slashingInfo[i] = t -// } -// return slashingInfo, nil -// } diff --git a/mod/consensus/pkg/cometbft/service/types.go b/mod/consensus/pkg/cometbft/service/types.go index 4fd8da5255..f01908f783 100644 --- a/mod/consensus/pkg/cometbft/service/types.go +++ b/mod/consensus/pkg/cometbft/service/types.go @@ -21,8 +21,6 @@ package cometbft import ( - "context" - ctypes "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "github.com/berachain/beacon-kit/mod/consensus/pkg/types" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" @@ -40,16 +38,6 @@ type AttestationData[AttestationDataT any] interface { New(math.U64, math.U64, common.Root) AttestationDataT } -// BeaconState is an interface for accessing the beacon state. -type BeaconState interface { - // GetValidatorIndexByCometBFTAddress returns the validator index by the - ValidatorIndexByCometBFTAddress( - cometBFTAddress []byte, - ) (math.ValidatorIndex, error) - // HashTreeRoot returns the hash tree root of the beacon state. - HashTreeRoot() common.Root -} - type MiddlewareI interface { InitGenesis( sdk.Context, @@ -82,10 +70,3 @@ type SlotData[AttestationDataT, SlashingInfoT, SlotDataT any] interface { // New creates a new slot data instance. New(math.Slot, []AttestationDataT, []SlashingInfoT) SlotDataT } - -// StorageBackend defines an interface for accessing various storage components -// required by the beacon node. -type StorageBackend[BeaconStateT BeaconState] interface { - // StateFromContext retrieves the beacon state from the given context. - StateFromContext(context.Context) BeaconStateT -} From 847cd522359c80761f7631e9995ece64c0aa3e09 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:27:00 +0200 Subject: [PATCH 04/51] some more types cleanup --- beacond/cmd/types.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/beacond/cmd/types.go b/beacond/cmd/types.go index 32f851a73e..3f2fb3e611 100644 --- a/beacond/cmd/types.go +++ b/beacond/cmd/types.go @@ -26,7 +26,6 @@ import ( "github.com/berachain/beacon-kit/mod/beacon/validator" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" cometbft "github.com/berachain/beacon-kit/mod/consensus/pkg/cometbft/service" - "github.com/berachain/beacon-kit/mod/consensus/pkg/cometbft/service/middleware" consruntimetypes "github.com/berachain/beacon-kit/mod/consensus/pkg/types" dablob "github.com/berachain/beacon-kit/mod/da/pkg/blob" "github.com/berachain/beacon-kit/mod/da/pkg/da" @@ -63,14 +62,6 @@ import ( /* -------------------------------------------------------------------------- */ type ( - // ABCIMiddleware is a type alias for the ABCIMiddleware. - ABCIMiddleware = middleware.ABCIMiddleware[ - *BeaconBlock, - *BlobSidecars, - *Genesis, - *SlotData, - ] - // AttributesFactory is a type alias for the attributes factory. AttributesFactory = attributes.Factory[ *BeaconState, @@ -114,9 +105,6 @@ type ( // CometBFTService is a type alias for the CometBFT service. CometBFTService = cometbft.Service[*Logger] - // ConsensusMiddleware is a type alias for the consensus middleware. - ConsensusMiddleware = cometbft.MiddlewareI - // DAService is a type alias for the DA service. DAService = da.Service[*AvailabilityStore, *BlobSidecars] From 020cb11460b8399186080fe7d4ab3b30b85f104f Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:36:55 +0200 Subject: [PATCH 05/51] some more types cleanup --- mod/consensus/pkg/cometbft/service/types.go | 22 --------------------- 1 file changed, 22 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/types.go b/mod/consensus/pkg/cometbft/service/types.go index f01908f783..a0404e5886 100644 --- a/mod/consensus/pkg/cometbft/service/types.go +++ b/mod/consensus/pkg/cometbft/service/types.go @@ -23,21 +23,11 @@ package cometbft import ( ctypes "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "github.com/berachain/beacon-kit/mod/consensus/pkg/types" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" cmtabci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" ) -// AttestationData is an interface for accessing the attestation data. -type AttestationData[AttestationDataT any] interface { - // GetIndex returns the index of the attestation data. - GetIndex() math.U64 - // New creates a new attestation data instance. - New(math.U64, math.U64, common.Root) AttestationDataT -} - type MiddlewareI interface { InitGenesis( sdk.Context, @@ -58,15 +48,3 @@ type MiddlewareI interface { *cmtabci.FinalizeBlockRequest, ) (transition.ValidatorUpdates, error) } - -// SlashingInfo is an interface for accessing the slashing info. -type SlashingInfo[SlashingInfoT any] interface { - // New creates a new slashing info instance. - New(math.U64, math.U64) SlashingInfoT -} - -// SlotData is an interface for accessing the slot data. -type SlotData[AttestationDataT, SlashingInfoT, SlotDataT any] interface { - // New creates a new slot data instance. - New(math.Slot, []AttestationDataT, []SlashingInfoT) SlotDataT -} From 92bbfae5ad076a5903a61419e3fecb088ed48dee Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:40:12 +0200 Subject: [PATCH 06/51] added type for BeaconBlock with relevant consensus data --- .../pkg/types/consensus_enriched_block.go | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 mod/consensus/pkg/types/consensus_enriched_block.go diff --git a/mod/consensus/pkg/types/consensus_enriched_block.go b/mod/consensus/pkg/types/consensus_enriched_block.go new file mode 100644 index 0000000000..1688b9f3bc --- /dev/null +++ b/mod/consensus/pkg/types/consensus_enriched_block.go @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package types + +import ( + "time" +) + +type ConsensusEnrichedBlock[BeaconBlockT any] struct { + blk BeaconBlockT + + // blkTime assigned by CometBFT to the beacon block + blkTime time.Time + + // block proposer address assigned by CometBFT to the beacon block + blkProposerAddress []byte +} + +// New creates a new SlotData instance. +func (b *ConsensusEnrichedBlock[BeaconBlockT]) New( + beaconBlock BeaconBlockT, + blkTime time.Time, + blkProposerAddress []byte, +) *ConsensusEnrichedBlock[BeaconBlockT] { + b = &ConsensusEnrichedBlock[BeaconBlockT]{ + blk: beaconBlock, + blkTime: blkTime, + blkProposerAddress: blkProposerAddress, + } + return b +} + +func NewBlockFromConsensus[BeaconBlockT any]( + beaconBlock BeaconBlockT, + blkTime time.Time, + blkProposerAddress []byte, +) *ConsensusEnrichedBlock[BeaconBlockT] { + return &ConsensusEnrichedBlock[BeaconBlockT]{ + blk: beaconBlock, + blkTime: blkTime, + blkProposerAddress: blkProposerAddress, + } +} + +func (b *ConsensusEnrichedBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { + return b.blk +} + +func (b *ConsensusEnrichedBlock[_]) GetConsensusBlockTime() time.Time { + return b.blkTime +} + +// TODO: harden the return type +func (b *ConsensusEnrichedBlock[_]) GetConsensusProposerAddress() []byte { + return b.blkProposerAddress +} From 69efa860abddef47bc96ac543bb41beead519b05 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:44:31 +0200 Subject: [PATCH 07/51] nits --- .../pkg/cometbft/service/middleware/abci.go | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index 3fe78be6d5..28b97ab6c5 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -45,19 +45,16 @@ func (h *ABCIMiddleware[ ctx sdk.Context, bz []byte, ) (transition.ValidatorUpdates, error) { - var ( - err error - waitCtx, cancel = context.WithTimeout(ctx, AwaitTimeout) - ) + waitCtx, cancel := context.WithTimeout(ctx, AwaitTimeout) defer cancel() data := new(GenesisT) - if err = json.Unmarshal(bz, data); err != nil { + if err := json.Unmarshal(bz, data); err != nil { h.logger.Error("Failed to unmarshal genesis data", "error", err) return nil, err } - if err = h.dispatcher.Publish( + if err := h.dispatcher.Publish( async.NewEvent(ctx, async.GenesisDataReceived, *data), ); err != nil { return nil, err @@ -92,10 +89,6 @@ func (h *ABCIMiddleware[ slotData SlotDataT, ) ([]byte, []byte, error) { var ( - err error - builtBeaconBlock BeaconBlockT - builtSidecars BlobSidecarsT - numMsgs int startTime = time.Now() awaitCtx, cancel = context.WithTimeout(ctx, AwaitTimeout) ) @@ -103,18 +96,18 @@ func (h *ABCIMiddleware[ defer cancel() defer h.metrics.measurePrepareProposalDuration(startTime) // flush the channels to ensure that we are not handling old data. - if numMsgs = async.ClearChan(h.subBuiltBeaconBlock); numMsgs > 0 { + if numMsgs := async.ClearChan(h.subBuiltBeaconBlock); numMsgs > 0 { h.logger.Error( "WARNING: messages remaining in built beacon block channel", "num_msgs", numMsgs) } - if numMsgs = async.ClearChan(h.subBuiltSidecars); numMsgs > 0 { + if numMsgs := async.ClearChan(h.subBuiltSidecars); numMsgs > 0 { h.logger.Error( "WARNING: messages remaining in built sidecars channel", "num_msgs", numMsgs) } - if err = h.dispatcher.Publish( + if err := h.dispatcher.Publish( async.NewEvent( ctx, async.NewSlot, slotData, ), @@ -123,13 +116,13 @@ func (h *ABCIMiddleware[ } // wait for built beacon block - builtBeaconBlock, err = h.waitForBuiltBeaconBlock(awaitCtx) + builtBeaconBlock, err := h.waitForBuiltBeaconBlock(awaitCtx) if err != nil { return nil, nil, err } // wait for built sidecars - builtSidecars, err = h.waitForBuiltSidecars(awaitCtx) + builtSidecars, err := h.waitForBuiltSidecars(awaitCtx) if err != nil { return nil, nil, err } From 8b87b65c326a7d8803ff86117e0aaa7935156560 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 15:57:16 +0200 Subject: [PATCH 08/51] wip: adding consensus data to blocks to be verified --- .../pkg/cometbft/service/middleware/abci.go | 9 +++++- ...s_enriched_block.go => consensus_block.go} | 32 +++++++------------ 2 files changed, 19 insertions(+), 22 deletions(-) rename mod/consensus/pkg/types/{consensus_enriched_block.go => consensus_block.go} (65%) diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index 28b97ab6c5..072c67d771 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -25,6 +25,7 @@ import ( "time" "github.com/berachain/beacon-kit/mod/consensus/pkg/cometbft/service/encoding" + "github.com/berachain/beacon-kit/mod/consensus/pkg/types" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/async" "github.com/berachain/beacon-kit/mod/primitives/pkg/encoding/json" @@ -220,7 +221,13 @@ func (h *ABCIMiddleware[ } // notify that the beacon block has been received. - blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, blk) + var enrichedBlk *types.ConsensusBlock[BeaconBlockT] + enrichedBlk = enrichedBlk.New( + blk, + ctx.BlockTime(), + ctx.BlockHeader().ProposerAddress, + ) + blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { return h.createProcessProposalResponse(errors.WrapNonFatal(err)) } diff --git a/mod/consensus/pkg/types/consensus_enriched_block.go b/mod/consensus/pkg/types/consensus_block.go similarity index 65% rename from mod/consensus/pkg/types/consensus_enriched_block.go rename to mod/consensus/pkg/types/consensus_block.go index 1688b9f3bc..632e7e1a52 100644 --- a/mod/consensus/pkg/types/consensus_enriched_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -22,53 +22,43 @@ package types import ( "time" + + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) -type ConsensusEnrichedBlock[BeaconBlockT any] struct { +type ConsensusBlock[BeaconBlockT any] struct { blk BeaconBlockT // blkTime assigned by CometBFT to the beacon block - blkTime time.Time + blkTime math.U64 // block proposer address assigned by CometBFT to the beacon block blkProposerAddress []byte } // New creates a new SlotData instance. -func (b *ConsensusEnrichedBlock[BeaconBlockT]) New( +func (b *ConsensusBlock[BeaconBlockT]) New( beaconBlock BeaconBlockT, blkTime time.Time, blkProposerAddress []byte, -) *ConsensusEnrichedBlock[BeaconBlockT] { - b = &ConsensusEnrichedBlock[BeaconBlockT]{ +) *ConsensusBlock[BeaconBlockT] { + b = &ConsensusBlock[BeaconBlockT]{ blk: beaconBlock, - blkTime: blkTime, + blkTime: math.U64(blkTime.Unix()), blkProposerAddress: blkProposerAddress, } return b } -func NewBlockFromConsensus[BeaconBlockT any]( - beaconBlock BeaconBlockT, - blkTime time.Time, - blkProposerAddress []byte, -) *ConsensusEnrichedBlock[BeaconBlockT] { - return &ConsensusEnrichedBlock[BeaconBlockT]{ - blk: beaconBlock, - blkTime: blkTime, - blkProposerAddress: blkProposerAddress, - } -} - -func (b *ConsensusEnrichedBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { +func (b *ConsensusBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { return b.blk } -func (b *ConsensusEnrichedBlock[_]) GetConsensusBlockTime() time.Time { +func (b *ConsensusBlock[_]) GetConsensusBlockTime() math.U64 { return b.blkTime } // TODO: harden the return type -func (b *ConsensusEnrichedBlock[_]) GetConsensusProposerAddress() []byte { +func (b *ConsensusBlock[_]) GetConsensusProposerAddress() []byte { return b.blkProposerAddress } From be54ae77324bc216b14ba85e6ce7ca4c3f87c257 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 18:05:00 +0200 Subject: [PATCH 09/51] wip: added consensus block to blockchain service --- beacond/cmd/defaults.go | 6 ++++-- beacond/cmd/types.go | 2 ++ mod/beacon/blockchain/execution_engine.go | 6 +++--- mod/beacon/blockchain/payload.go | 10 +++++----- mod/beacon/blockchain/process.go | 6 +++--- mod/beacon/blockchain/receive.go | 6 +++--- mod/beacon/blockchain/service.go | 20 +++++++++++-------- mod/beacon/blockchain/types.go | 9 +++++++++ mod/node-core/pkg/components/chain_service.go | 5 ++++- mod/node-core/pkg/components/interfaces.go | 9 +++++++++ .../pkg/components/service_registry.go | 8 ++++++-- 11 files changed, 60 insertions(+), 27 deletions(-) diff --git a/beacond/cmd/defaults.go b/beacond/cmd/defaults.go index e4ede16b88..1c39fee714 100644 --- a/beacond/cmd/defaults.go +++ b/beacond/cmd/defaults.go @@ -61,7 +61,8 @@ func DefaultComponents() []any { *BeaconBlockHeader, *BlobSidecar, *BlobSidecars, ], components.ProvideChainService[ - *AvailabilityStore, *BeaconBlock, *BeaconBlockBody, + *AvailabilityStore, + *ConsensusBlock, *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, *BeaconState, *BeaconStateMarshallable, *BlobSidecars, *BlockStore, *Deposit, *DepositStore, *ExecutionPayload, *ExecutionPayloadHeader, *Genesis, @@ -107,7 +108,8 @@ func DefaultComponents() []any { components.ProvideReportingService[*Logger], components.ProvideCometBFTService[*Logger], components.ProvideServiceRegistry[ - *AvailabilityStore, *BeaconBlock, *BeaconBlockBody, + *AvailabilityStore, + *ConsensusBlock, *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, *BlockStore, *BeaconState, *BeaconStateMarshallable, *BlobSidecar, *BlobSidecars, *Deposit, *DepositStore, *ExecutionPayload, *ExecutionPayloadHeader, diff --git a/beacond/cmd/types.go b/beacond/cmd/types.go index 3f2fb3e611..b8ef47f2f9 100644 --- a/beacond/cmd/types.go +++ b/beacond/cmd/types.go @@ -91,6 +91,7 @@ type ( // ChainService is a type alias for the chain service. ChainService = blockchain.Service[ *AvailabilityStore, + *ConsensusBlock, *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, @@ -233,6 +234,7 @@ type ( AvailabilityStore = dastore.Store[*BeaconBlockBody] // BeaconBlock type aliases. + ConsensusBlock = consruntimetypes.ConsensusBlock[*BeaconBlock] BeaconBlock = types.BeaconBlock BeaconBlockBody = types.BeaconBlockBody BeaconBlockHeader = types.BeaconBlockHeader diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 3b09d24f83..a79d630551 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -29,7 +29,7 @@ import ( // sendPostBlockFCU sends a forkchoice update to the execution client. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, ]) sendPostBlockFCU( ctx context.Context, st BeaconStateT, @@ -54,7 +54,7 @@ func (s *Service[ // sendNextFCUWithAttributes sends a forkchoice update to the execution // client with attributes. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, ExecutionPayloadHeaderT, _, _, ]) sendNextFCUWithAttributes( ctx context.Context, @@ -96,7 +96,7 @@ func (s *Service[ // sendNextFCUWithoutAttributes sends a forkchoice update to the // execution client without attributes. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, _, _, _, ExecutionPayloadHeaderT, _, PayloadAttributesT, ]) sendNextFCUWithoutAttributes( ctx context.Context, diff --git a/mod/beacon/blockchain/payload.go b/mod/beacon/blockchain/payload.go index ba2f3d7c05..9714ee3a01 100644 --- a/mod/beacon/blockchain/payload.go +++ b/mod/beacon/blockchain/payload.go @@ -28,7 +28,7 @@ import ( // forceStartupHead sends a force head FCU to the execution client. func (s *Service[ - _, _, _, _, BeaconStateT, _, _, _, _, _, + _, _, _, _, _, BeaconStateT, _, _, _, _, _, ]) forceStartupHead( ctx context.Context, st BeaconStateT, @@ -56,7 +56,7 @@ func (s *Service[ // handleRebuildPayloadForRejectedBlock handles the case where the incoming // block was rejected and we need to rebuild the payload for the current slot. func (s *Service[ - _, _, _, _, BeaconStateT, _, _, _, _, _, + _, _, _, _, _, BeaconStateT, _, _, _, _, _, ]) handleRebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, @@ -77,7 +77,7 @@ func (s *Service[ // rejected the incoming block and it would be unsafe to use any // information from it. func (s *Service[ - _, _, _, _, BeaconStateT, _, _, ExecutionPayloadHeaderT, _, _, + _, _, _, _, _, BeaconStateT, _, _, ExecutionPayloadHeaderT, _, _, ]) rebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, @@ -134,7 +134,7 @@ func (s *Service[ // handleOptimisticPayloadBuild handles optimistically // building for the next slot. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, ]) handleOptimisticPayloadBuild( ctx context.Context, st BeaconStateT, @@ -151,7 +151,7 @@ func (s *Service[ // optimisticPayloadBuild builds a payload for the next slot. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, ]) optimisticPayloadBuild( ctx context.Context, st BeaconStateT, diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 0d7c5e9610..46746580e2 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -31,7 +31,7 @@ import ( // ProcessGenesisData processes the genesis state and initializes the beacon // state. func (s *Service[ - _, _, _, _, _, _, _, _, GenesisT, _, + _, _, _, _, _, _, _, _, _, GenesisT, _, ]) ProcessGenesisData( ctx context.Context, genesisData GenesisT, @@ -47,7 +47,7 @@ func (s *Service[ // ProcessBeaconBlock receives an incoming beacon block, it first validates // and then processes the block. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, _, BeaconBlockT, _, _, _, _, _, _, _, _, ]) ProcessBeaconBlock( ctx context.Context, blk BeaconBlockT, @@ -92,7 +92,7 @@ func (s *Service[ // executeStateTransition runs the stf. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, ]) executeStateTransition( ctx context.Context, st BeaconStateT, diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 0292afd2d6..5ded6a940f 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -32,7 +32,7 @@ import ( // VerifyIncomingBlock verifies the state root of an incoming block // and logs the process. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, _, BeaconBlockT, _, _, _, _, _, _, _, _, ]) VerifyIncomingBlock( ctx context.Context, blk BeaconBlockT, @@ -97,7 +97,7 @@ func (s *Service[ // verifyStateRoot verifies the state root of an incoming block. func (s *Service[ - _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, ]) verifyStateRoot( ctx context.Context, st BeaconStateT, @@ -133,7 +133,7 @@ func (s *Service[ // shouldBuildOptimisticPayloads returns true if optimistic // payload builds are enabled. func (s *Service[ - _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, ]) shouldBuildOptimisticPayloads() bool { return s.optimisticPayloadBuilds && s.localBuilder.Enabled() } diff --git a/mod/beacon/blockchain/service.go b/mod/beacon/blockchain/service.go index 6c8417a5d8..f8cfde163b 100644 --- a/mod/beacon/blockchain/service.go +++ b/mod/beacon/blockchain/service.go @@ -34,6 +34,7 @@ import ( // Service is the blockchain service. type Service[ AvailabilityStoreT AvailabilityStore[BeaconBlockBodyT], + ConsensusBlockT ConsensusBlock[BeaconBlockT], BeaconBlockT BeaconBlock[BeaconBlockBodyT], BeaconBlockBodyT BeaconBlockBody[ExecutionPayloadT], BeaconBlockHeaderT BeaconBlockHeader, @@ -91,6 +92,7 @@ type Service[ // NewService creates a new validator service. func NewService[ AvailabilityStoreT AvailabilityStore[BeaconBlockBodyT], + ConsensusBlockT ConsensusBlock[BeaconBlockT], BeaconBlockT BeaconBlock[BeaconBlockBodyT], BeaconBlockBodyT BeaconBlockBody[ExecutionPayloadT], BeaconBlockHeaderT BeaconBlockHeader, @@ -123,12 +125,14 @@ func NewService[ telemetrySink TelemetrySink, optimisticPayloadBuilds bool, ) *Service[ - AvailabilityStoreT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, + AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconStateT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, GenesisT, PayloadAttributesT, ] { return &Service[ - AvailabilityStoreT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, + AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconStateT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, GenesisT, PayloadAttributesT, ]{ @@ -150,7 +154,7 @@ func NewService[ // Name returns the name of the service. func (s *Service[ - _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, ]) Name() string { return "blockchain" } @@ -159,7 +163,7 @@ func (s *Service[ // BeaconBlockReceived, and FinalBeaconBlockReceived events, and begins // the main event loop to handle them accordingly. func (s *Service[ - _, _, _, _, _, _, _, _, _, _, + _, _, _, _, _, _, _, _, _, _, _, ]) Start(ctx context.Context) error { if err := s.dispatcher.Subscribe( async.GenesisDataReceived, s.subGenDataReceived, @@ -186,7 +190,7 @@ func (s *Service[ // eventLoop listens for events and handles them accordingly. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, _, GenesisT, _, + _, _, BeaconBlockT, _, _, _, _, _, _, GenesisT, _, ]) eventLoop(ctx context.Context) { for { select { @@ -209,7 +213,7 @@ func (s *Service[ // handleGenDataReceived processes the genesis data received and emits a // GenesisDataProcessed event containing the resulting validator updates. func (s *Service[ - _, _, _, _, _, _, _, _, GenesisT, _, + _, _, _, _, _, _, _, _, _, GenesisT, _, ]) handleGenDataReceived(msg async.Event[GenesisT]) { var ( valUpdates transition.ValidatorUpdates @@ -245,7 +249,7 @@ func (s *Service[ // handleBeaconBlockReceived emits a BeaconBlockVerified event with the error // result from VerifyIncomingBlock. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, _, BeaconBlockT, _, _, _, _, _, _, _, _, ]) handleBeaconBlockReceived( msg async.Event[BeaconBlockT], ) { @@ -276,7 +280,7 @@ func (s *Service[ // a FinalValidatorUpdatesProcessed event containing the resulting validator // updates. func (s *Service[ - _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, _, BeaconBlockT, _, _, _, _, _, _, _, _, ]) handleBeaconBlockFinalization( msg async.Event[BeaconBlockT], ) { diff --git a/mod/beacon/blockchain/types.go b/mod/beacon/blockchain/types.go index 3a50033017..599425e3b9 100644 --- a/mod/beacon/blockchain/types.go +++ b/mod/beacon/blockchain/types.go @@ -42,6 +42,15 @@ type AvailabilityStore[BeaconBlockBodyT any] interface { ) bool } +type ConsensusBlock[BeaconBlockT any] interface { + GetBeaconBlock() BeaconBlockT + + GetConsensusBlockTime() math.U64 + + // TODO: harden the return type + GetConsensusProposerAddress() []byte +} + // BeaconBlock represents a beacon block interface. type BeaconBlock[BeaconBlockBodyT any] interface { constraints.SSZMarshallableRootable diff --git a/mod/node-core/pkg/components/chain_service.go b/mod/node-core/pkg/components/chain_service.go index 50ba9c5257..ca7e488876 100644 --- a/mod/node-core/pkg/components/chain_service.go +++ b/mod/node-core/pkg/components/chain_service.go @@ -76,6 +76,7 @@ type ChainServiceInput[ // ProvideChainService is a depinject provider for the blockchain service. func ProvideChainService[ AvailabilityStoreT AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT], + ConsensusBlockT ConsensusBlock[BeaconBlockT], BeaconBlockT BeaconBlock[BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT], BeaconBlockBodyT BeaconBlockBody[ BeaconBlockBodyT, *AttestationData, DepositT, @@ -111,13 +112,15 @@ func ProvideChainService[ WithdrawalT, WithdrawalsT, ], ) *blockchain.Service[ - AvailabilityStoreT, BeaconBlockT, BeaconBlockBodyT, + AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconStateT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, GenesisT, *engineprimitives.PayloadAttributes[WithdrawalT], ] { return blockchain.NewService[ AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index 370ae20f27..d39d85b6ed 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -80,6 +80,15 @@ type ( Persist(math.Slot, BlobSidecarsT) error } + ConsensusBlock[BeaconBlockT any] interface { + GetBeaconBlock() BeaconBlockT + + GetConsensusBlockTime() math.U64 + + // TODO: harden the return type + GetConsensusProposerAddress() []byte + } + // BeaconBlock represents a generic interface for a beacon block. BeaconBlock[ T any, diff --git a/mod/node-core/pkg/components/service_registry.go b/mod/node-core/pkg/components/service_registry.go index db930d4193..41b8838b8e 100644 --- a/mod/node-core/pkg/components/service_registry.go +++ b/mod/node-core/pkg/components/service_registry.go @@ -41,6 +41,7 @@ import ( // ServiceRegistryInput is the input for the service registry provider. type ServiceRegistryInput[ AvailabilityStoreT AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT], + ConsensusBlockT ConsensusBlock[BeaconBlockT], BeaconBlockT BeaconBlock[BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT], BeaconBlockBodyT BeaconBlockBody[ BeaconBlockBodyT, *AttestationData, DepositT, @@ -77,7 +78,8 @@ type ServiceRegistryInput[ BeaconBlockT, BeaconBlockStoreT, ] ChainService *blockchain.Service[ - AvailabilityStoreT, BeaconBlockT, BeaconBlockBodyT, + AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconStateT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, GenesisT, *engineprimitives.PayloadAttributes[WithdrawalT], @@ -110,6 +112,7 @@ type ServiceRegistryInput[ // ProvideServiceRegistry is the depinject provider for the service registry. func ProvideServiceRegistry[ AvailabilityStoreT AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT], + ConsensusBlockT ConsensusBlock[BeaconBlockT], BeaconBlockT BeaconBlock[BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT], BeaconBlockBodyT BeaconBlockBody[ BeaconBlockBodyT, *AttestationData, DepositT, @@ -138,7 +141,8 @@ func ProvideServiceRegistry[ WithdrawalsT Withdrawals[WithdrawalT], ]( in ServiceRegistryInput[ - AvailabilityStoreT, BeaconBlockT, BeaconBlockBodyT, + AvailabilityStoreT, + ConsensusBlockT, BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconBlockStoreT, BeaconStateT, BeaconStateMarshallableT, BlobSidecarT, BlobSidecarsT, DepositT, DepositStoreT, ExecutionPayloadT, ExecutionPayloadHeaderT, From 196f1ec6c382fc80ad7da6513a30a6bed64ebfa6 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 18:21:49 +0200 Subject: [PATCH 10/51] wip: used consensus block type in blockchain service --- mod/beacon/blockchain/receive.go | 9 +++++++-- mod/beacon/blockchain/service.go | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 5ded6a940f..91a6aa7c3a 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -32,11 +32,16 @@ import ( // VerifyIncomingBlock verifies the state root of an incoming block // and logs the process. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, ConsensusBlockT, BeaconBlockT, _, _, _, _, _, _, _, _, ]) VerifyIncomingBlock( ctx context.Context, - blk BeaconBlockT, + consensusBlk ConsensusBlockT, ) error { + var ( + blk = consensusBlk.GetBeaconBlock() + _ = consensusBlk.GetConsensusBlockTime() + ) + // Grab a copy of the state to verify the incoming block. preState := s.storageBackend.StateFromContext(ctx) diff --git a/mod/beacon/blockchain/service.go b/mod/beacon/blockchain/service.go index f8cfde163b..15b24d17c9 100644 --- a/mod/beacon/blockchain/service.go +++ b/mod/beacon/blockchain/service.go @@ -84,7 +84,7 @@ type Service[ // subFinalBlkReceived is a channel holding FinalBeaconBlockReceived events. subFinalBlkReceived chan async.Event[BeaconBlockT] // subBlockReceived is a channel holding BeaconBlockReceived events. - subBlockReceived chan async.Event[BeaconBlockT] + subBlockReceived chan async.Event[ConsensusBlockT] // subGenDataReceived is a channel holding GenesisDataReceived events. subGenDataReceived chan async.Event[GenesisT] } @@ -147,7 +147,7 @@ func NewService[ optimisticPayloadBuilds: optimisticPayloadBuilds, forceStartupSyncOnce: new(sync.Once), subFinalBlkReceived: make(chan async.Event[BeaconBlockT]), - subBlockReceived: make(chan async.Event[BeaconBlockT]), + subBlockReceived: make(chan async.Event[ConsensusBlockT]), subGenDataReceived: make(chan async.Event[GenesisT]), } } @@ -190,7 +190,7 @@ func (s *Service[ // eventLoop listens for events and handles them accordingly. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, _, GenesisT, _, + _, _, _, _, _, _, _, _, _, _, _, ]) eventLoop(ctx context.Context) { for { select { @@ -249,9 +249,9 @@ func (s *Service[ // handleBeaconBlockReceived emits a BeaconBlockVerified event with the error // result from VerifyIncomingBlock. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, _, _, _, _, _, _, ]) handleBeaconBlockReceived( - msg async.Event[BeaconBlockT], + msg async.Event[ConsensusBlockT], ) { // If the block is nil, exit early. if msg.Error() != nil { From 55126cb06ede1aa164f4ab5dcceed36e09a88f54 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 18:56:19 +0200 Subject: [PATCH 11/51] wip: fixed dispatching of consensus blocks --- beacond/cmd/defaults.go | 2 +- mod/beacon/blockchain/service.go | 2 +- mod/node-core/pkg/components/dispatcher.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/beacond/cmd/defaults.go b/beacond/cmd/defaults.go index 1c39fee714..158ecf19c0 100644 --- a/beacond/cmd/defaults.go +++ b/beacond/cmd/defaults.go @@ -92,7 +92,7 @@ func DefaultComponents() []any { ], components.ProvideDepositStore[*Deposit], components.ProvideDispatcher[ - *BeaconBlock, *BlobSidecars, *Genesis, *Logger, + *ConsensusBlock, *BeaconBlock, *BlobSidecars, *Genesis, *Logger, ], components.ProvideEngineClient[ *ExecutionPayload, *ExecutionPayloadHeader, *Logger, diff --git a/mod/beacon/blockchain/service.go b/mod/beacon/blockchain/service.go index 15b24d17c9..395a373743 100644 --- a/mod/beacon/blockchain/service.go +++ b/mod/beacon/blockchain/service.go @@ -265,7 +265,7 @@ func (s *Service[ async.NewEvent( msg.Context(), async.BeaconBlockVerified, - msg.Data(), + msg.Data().GetBeaconBlock(), s.VerifyIncomingBlock(msg.Context(), msg.Data()), ), ); err != nil { diff --git a/mod/node-core/pkg/components/dispatcher.go b/mod/node-core/pkg/components/dispatcher.go index 4612f29290..fa22331712 100644 --- a/mod/node-core/pkg/components/dispatcher.go +++ b/mod/node-core/pkg/components/dispatcher.go @@ -37,6 +37,7 @@ type DispatcherInput[ // ProvideDispatcher provides a new Dispatcher. func ProvideDispatcher[ + ConsensusBlockT any, BeaconBlockT any, BlobSidecarsT any, GenesisT any, @@ -51,7 +52,7 @@ func ProvideDispatcher[ dp.WithEvent[SlotEvent](async.NewSlot), dp.WithEvent[async.Event[BeaconBlockT]](async.BuiltBeaconBlock), dp.WithEvent[async.Event[BlobSidecarsT]](async.BuiltSidecars), - dp.WithEvent[async.Event[BeaconBlockT]](async.BeaconBlockReceived), + dp.WithEvent[async.Event[ConsensusBlockT]](async.BeaconBlockReceived), dp.WithEvent[async.Event[BlobSidecarsT]](async.SidecarsReceived), dp.WithEvent[async.Event[BeaconBlockT]](async.BeaconBlockVerified), dp.WithEvent[async.Event[BlobSidecarsT]](async.SidecarsVerified), From ce0d4202360ed3daaf74ddc7993999a1d40ac282 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 21:47:38 +0200 Subject: [PATCH 12/51] wip: rebased next payload timestamp on top of consensus block time --- mod/beacon/blockchain/execution_engine.go | 8 +++++++- mod/beacon/blockchain/payload.go | 22 ++++++++++++++++++---- mod/beacon/blockchain/receive.go | 17 +++++++++++++---- mod/beacon/payload-time/time.go | 17 +++++++++-------- mod/beacon/validator/block_builder.go | 6 +++++- 5 files changed, 52 insertions(+), 18 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index a79d630551..2bca809aaf 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -22,9 +22,11 @@ package blockchain import ( "context" + "time" payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) // sendPostBlockFCU sends a forkchoice update to the execution client. @@ -80,7 +82,11 @@ func (s *Service[ ctx, stCopy, blk.GetSlot()+1, - payloadtime.Next(s.chainSpec, payloadTime), + payloadtime.Next( + s.chainSpec, + payloadTime, + math.U64(time.Now().Unix()), + ), prevBlockRoot, lph.GetBlockHash(), lph.GetParentHash(), diff --git a/mod/beacon/blockchain/payload.go b/mod/beacon/blockchain/payload.go index 9714ee3a01..ff03f5ea93 100644 --- a/mod/beacon/blockchain/payload.go +++ b/mod/beacon/blockchain/payload.go @@ -24,6 +24,7 @@ import ( "context" payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) // forceStartupHead sends a force head FCU to the execution client. @@ -60,8 +61,13 @@ func (s *Service[ ]) handleRebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, + consensusTime math.U64, ) { - if err := s.rebuildPayloadForRejectedBlock(ctx, st); err != nil { + if err := s.rebuildPayloadForRejectedBlock( + ctx, + st, + consensusTime, + ); err != nil { s.logger.Error( "failed to rebuild payload for nil block", "error", err, @@ -81,6 +87,7 @@ func (s *Service[ ]) rebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, + consensusTime math.U64, ) error { s.logger.Info("Rebuilding payload for rejected block ⏳ ") @@ -114,7 +121,7 @@ func (s *Service[ st, // We are rebuilding for the current slot. stateSlot, - payloadtime.Next(s.chainSpec, lph.GetTimestamp()), + payloadtime.Next(s.chainSpec, lph.GetTimestamp(), consensusTime), // We set the parent root to the previous block root. latestHeader.HashTreeRoot(), // We set the head of our chain to the previous finalized block. @@ -139,8 +146,14 @@ func (s *Service[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, + consensusTime math.U64, ) { - if err := s.optimisticPayloadBuild(ctx, st, blk); err != nil { + if err := s.optimisticPayloadBuild( + ctx, + st, + blk, + consensusTime, + ); err != nil { s.logger.Error( "Failed to build optimistic payload", "for_slot", (blk.GetSlot() + 1).Base10(), @@ -156,6 +169,7 @@ func (s *Service[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, + consensusTime math.U64, ) error { // We are building for the next slot, so we increment the slot relative // to the block we just processed. @@ -176,7 +190,7 @@ func (s *Service[ if _, err := s.localBuilder.RequestPayloadAsync( ctx, st, slot, - payloadtime.Next(s.chainSpec, payload.GetTimestamp()), + payloadtime.Next(s.chainSpec, payload.GetTimestamp(), consensusTime), // The previous block root is simply the root of the block we just // processed. blk.HashTreeRoot(), diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 91a6aa7c3a..17dc617444 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -38,8 +38,8 @@ func (s *Service[ consensusBlk ConsensusBlockT, ) error { var ( - blk = consensusBlk.GetBeaconBlock() - _ = consensusBlk.GetConsensusBlockTime() + blk = consensusBlk.GetBeaconBlock() + consensusTime = consensusBlk.GetConsensusBlockTime() ) // Grab a copy of the state to verify the incoming block. @@ -81,7 +81,11 @@ func (s *Service[ ) if s.shouldBuildOptimisticPayloads() { - go s.handleRebuildPayloadForRejectedBlock(ctx, preState) + go s.handleRebuildPayloadForRejectedBlock( + ctx, + preState, + consensusTime, + ) } return err @@ -94,7 +98,12 @@ func (s *Service[ ) if s.shouldBuildOptimisticPayloads() { - go s.handleOptimisticPayloadBuild(ctx, postState, blk) + go s.handleOptimisticPayloadBuild( + ctx, + postState, + blk, + consensusTime, + ) } return nil diff --git a/mod/beacon/payload-time/time.go b/mod/beacon/payload-time/time.go index 66c514e340..eb9132eb47 100644 --- a/mod/beacon/payload-time/time.go +++ b/mod/beacon/payload-time/time.go @@ -21,23 +21,24 @@ package payloadtime import ( - "time" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) -// Next calculates the -// next timestamp for an execution payload -// -// TODO: This is hood and needs to be improved. +// Next calculates the timestamp for the +// next execution payload to be built. +// The timestamp is set to be: +// Strictly increasing wrt parent payload timestamp +// Ideally spaced around the TargetSecondsPerEth1Block +// Referred to consensus tracked time, which should have +// extra stability properties. func Next( chainSpec common.ChainSpec, parentPayloadTime math.U64, + consensusBlkTime math.U64, ) uint64 { - //#nosec:G701 // not an issue in practice. return max( - uint64(time.Now().Unix())+chainSpec.TargetSecondsPerEth1Block(), + uint64(consensusBlkTime)+chainSpec.TargetSecondsPerEth1Block(), uint64(parentPayloadTime+1), ) } diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 7e82b18f8d..5bf02fa270 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -235,7 +235,11 @@ func (s *Service[ ctx, st, blk.GetSlot(), - payloadtime.Next(s.chainSpec, lph.GetTimestamp()), + payloadtime.Next( + s.chainSpec, + lph.GetTimestamp(), + math.U64(time.Now().Unix()), + ), blk.GetParentBlockRoot(), lph.GetBlockHash(), lph.GetParentHash(), From 49b31a88615e2bc3145af239e8181539376fd9b4 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 22:09:32 +0200 Subject: [PATCH 13/51] wip: rebased next payload timestamp from finalized block on top of consensus block time --- mod/beacon/blockchain/execution_engine.go | 29 ++++++++++--------- mod/beacon/blockchain/process.go | 10 ++++--- mod/beacon/blockchain/service.go | 8 ++--- .../pkg/cometbft/service/middleware/abci.go | 21 +++++++------- mod/node-core/pkg/components/dispatcher.go | 2 +- 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 2bca809aaf..7ccac7b1dc 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -22,20 +22,18 @@ package blockchain import ( "context" - "time" payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) // sendPostBlockFCU sends a forkchoice update to the execution client. func (s *Service[ - _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, BeaconStateT, _, _, _, _, _, ]) sendPostBlockFCU( ctx context.Context, st BeaconStateT, - blk BeaconBlockT, + consensusBlk ConsensusBlockT, ) { lph, err := st.GetLatestExecutionPayloadHeader() if err != nil { @@ -47,26 +45,27 @@ func (s *Service[ } if !s.shouldBuildOptimisticPayloads() && s.localBuilder.Enabled() { - s.sendNextFCUWithAttributes(ctx, st, blk, lph) + s.sendNextFCUWithAttributes(ctx, st, consensusBlk, lph) } else { - s.sendNextFCUWithoutAttributes(ctx, blk, lph) + s.sendNextFCUWithoutAttributes(ctx, consensusBlk, lph) } } // sendNextFCUWithAttributes sends a forkchoice update to the execution // client with attributes. func (s *Service[ - _, _, BeaconBlockT, _, _, BeaconStateT, + _, ConsensusBlockT, _, _, _, BeaconStateT, _, _, ExecutionPayloadHeaderT, _, _, ]) sendNextFCUWithAttributes( ctx context.Context, st BeaconStateT, - blk BeaconBlockT, + consensusBlk ConsensusBlockT, lph ExecutionPayloadHeaderT, ) { - var err error + blk := consensusBlk.GetBeaconBlock() + stCopy := st.Copy() - if _, err = s.stateProcessor.ProcessSlots( + if _, err := s.stateProcessor.ProcessSlots( stCopy, blk.GetSlot()+1, ); err != nil { s.logger.Error( @@ -78,14 +77,14 @@ func (s *Service[ prevBlockRoot := blk.HashTreeRoot() payloadTime := blk.GetBody().GetExecutionPayload().GetTimestamp() - if _, err = s.localBuilder.RequestPayloadAsync( + if _, err := s.localBuilder.RequestPayloadAsync( ctx, stCopy, blk.GetSlot()+1, payloadtime.Next( s.chainSpec, payloadTime, - math.U64(time.Now().Unix()), + consensusBlk.GetConsensusBlockTime(), ), prevBlockRoot, lph.GetBlockHash(), @@ -102,13 +101,15 @@ func (s *Service[ // sendNextFCUWithoutAttributes sends a forkchoice update to the // execution client without attributes. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, _, _, _, ExecutionPayloadHeaderT, _, PayloadAttributesT, ]) sendNextFCUWithoutAttributes( ctx context.Context, - blk BeaconBlockT, + consensusBlk ConsensusBlockT, lph ExecutionPayloadHeaderT, ) { + blk := consensusBlk.GetBeaconBlock() + if _, _, err := s.executionEngine.NotifyForkchoiceUpdate( ctx, // TODO: Switch to New(). diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 46746580e2..7cb8c12ff0 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -47,11 +47,13 @@ func (s *Service[ // ProcessBeaconBlock receives an incoming beacon block, it first validates // and then processes the block. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, _, _, _, _, _, _, ]) ProcessBeaconBlock( ctx context.Context, - blk BeaconBlockT, + consensusBlk ConsensusBlockT, ) (transition.ValidatorUpdates, error) { + blk := consensusBlk.GetBeaconBlock() + // If the block is nil, exit early. if blk.IsNil() { return nil, ErrNilBlk @@ -79,13 +81,13 @@ func (s *Service[ // via ticker later. if err = s.dispatcher.Publish( async.NewEvent( - ctx, async.BeaconBlockFinalized, blk, + ctx, async.BeaconBlockFinalized, consensusBlk, ), ); err != nil { return nil, err } - go s.sendPostBlockFCU(ctx, st, blk) + go s.sendPostBlockFCU(ctx, st, consensusBlk) return valUpdates.CanonicalSort(), nil } diff --git a/mod/beacon/blockchain/service.go b/mod/beacon/blockchain/service.go index 395a373743..c340eecdff 100644 --- a/mod/beacon/blockchain/service.go +++ b/mod/beacon/blockchain/service.go @@ -82,7 +82,7 @@ type Service[ forceStartupSyncOnce *sync.Once // subFinalBlkReceived is a channel holding FinalBeaconBlockReceived events. - subFinalBlkReceived chan async.Event[BeaconBlockT] + subFinalBlkReceived chan async.Event[ConsensusBlockT] // subBlockReceived is a channel holding BeaconBlockReceived events. subBlockReceived chan async.Event[ConsensusBlockT] // subGenDataReceived is a channel holding GenesisDataReceived events. @@ -146,7 +146,7 @@ func NewService[ metrics: newChainMetrics(telemetrySink), optimisticPayloadBuilds: optimisticPayloadBuilds, forceStartupSyncOnce: new(sync.Once), - subFinalBlkReceived: make(chan async.Event[BeaconBlockT]), + subFinalBlkReceived: make(chan async.Event[ConsensusBlockT]), subBlockReceived: make(chan async.Event[ConsensusBlockT]), subGenDataReceived: make(chan async.Event[GenesisT]), } @@ -280,9 +280,9 @@ func (s *Service[ // a FinalValidatorUpdatesProcessed event containing the resulting validator // updates. func (s *Service[ - _, _, BeaconBlockT, _, _, _, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, _, _, _, _, _, _, ]) handleBeaconBlockFinalization( - msg async.Event[BeaconBlockT], + msg async.Event[ConsensusBlockT], ) { var ( valUpdates transition.ValidatorUpdates diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index 072c67d771..d82ca73e2c 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -315,12 +315,7 @@ func (h *ABCIMiddleware[ ctx sdk.Context, req *cmtabci.FinalizeBlockRequest, ) (transition.ValidatorUpdates, error) { - var ( - err error - blk BeaconBlockT - blobs BlobSidecarsT - awaitCtx, cancel = context.WithTimeout(ctx, AwaitTimeout) - ) + awaitCtx, cancel := context.WithTimeout(ctx, AwaitTimeout) defer cancel() // flush the channel to ensure that we are not handling old data. if numMsgs := async.ClearChan(h.subFinalValidatorUpdates); numMsgs > 0 { @@ -329,7 +324,7 @@ func (h *ABCIMiddleware[ "num_msgs", numMsgs) } - blk, blobs, err = encoding. + blk, blobs, err := encoding. ExtractBlobsAndBlockFromRequest[BeaconBlockT, BlobSidecarsT]( req, BeaconBlockTxIndex, @@ -343,9 +338,15 @@ func (h *ABCIMiddleware[ } // notify that the final beacon block has been received. - if err = h.dispatcher.Publish( - async.NewEvent(ctx, async.FinalBeaconBlockReceived, blk), - ); err != nil { + // notify that the beacon block has been received. + var enrichedBlk *types.ConsensusBlock[BeaconBlockT] + enrichedBlk = enrichedBlk.New( + blk, + ctx.BlockTime(), + ctx.BlockHeader().ProposerAddress, + ) + blkEvent := async.NewEvent(ctx, async.FinalBeaconBlockReceived, enrichedBlk) + if err = h.dispatcher.Publish(blkEvent); err != nil { return nil, err } diff --git a/mod/node-core/pkg/components/dispatcher.go b/mod/node-core/pkg/components/dispatcher.go index fa22331712..fab905457b 100644 --- a/mod/node-core/pkg/components/dispatcher.go +++ b/mod/node-core/pkg/components/dispatcher.go @@ -56,7 +56,7 @@ func ProvideDispatcher[ dp.WithEvent[async.Event[BlobSidecarsT]](async.SidecarsReceived), dp.WithEvent[async.Event[BeaconBlockT]](async.BeaconBlockVerified), dp.WithEvent[async.Event[BlobSidecarsT]](async.SidecarsVerified), - dp.WithEvent[async.Event[BeaconBlockT]](async.FinalBeaconBlockReceived), + dp.WithEvent[async.Event[ConsensusBlockT]](async.FinalBeaconBlockReceived), dp.WithEvent[async.Event[BlobSidecarsT]](async.FinalSidecarsReceived), dp.WithEvent[ValidatorUpdateEvent]( async.FinalValidatorUpdatesProcessed, From 7975424cdf81d34373eb5bb58265930bef2e3cde Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 22:15:23 +0200 Subject: [PATCH 14/51] nit --- mod/beacon/blockchain/execution_engine.go | 26 +++++++++++------------ mod/beacon/blockchain/process.go | 14 ++++++------ mod/beacon/blockchain/receive.go | 18 ++++++++-------- mod/beacon/payload-time/time.go | 4 ++-- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 7ccac7b1dc..178a720854 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -33,7 +33,7 @@ func (s *Service[ ]) sendPostBlockFCU( ctx context.Context, st BeaconStateT, - consensusBlk ConsensusBlockT, + blk ConsensusBlockT, ) { lph, err := st.GetLatestExecutionPayloadHeader() if err != nil { @@ -45,9 +45,9 @@ func (s *Service[ } if !s.shouldBuildOptimisticPayloads() && s.localBuilder.Enabled() { - s.sendNextFCUWithAttributes(ctx, st, consensusBlk, lph) + s.sendNextFCUWithAttributes(ctx, st, blk, lph) } else { - s.sendNextFCUWithoutAttributes(ctx, consensusBlk, lph) + s.sendNextFCUWithoutAttributes(ctx, blk, lph) } } @@ -59,14 +59,14 @@ func (s *Service[ ]) sendNextFCUWithAttributes( ctx context.Context, st BeaconStateT, - consensusBlk ConsensusBlockT, + blk ConsensusBlockT, lph ExecutionPayloadHeaderT, ) { - blk := consensusBlk.GetBeaconBlock() + beaconBlk := blk.GetBeaconBlock() stCopy := st.Copy() if _, err := s.stateProcessor.ProcessSlots( - stCopy, blk.GetSlot()+1, + stCopy, beaconBlk.GetSlot()+1, ); err != nil { s.logger.Error( "failed to process slots in non-optimistic payload", @@ -75,16 +75,16 @@ func (s *Service[ return } - prevBlockRoot := blk.HashTreeRoot() - payloadTime := blk.GetBody().GetExecutionPayload().GetTimestamp() + prevBlockRoot := beaconBlk.HashTreeRoot() + payloadTime := beaconBlk.GetBody().GetExecutionPayload().GetTimestamp() if _, err := s.localBuilder.RequestPayloadAsync( ctx, stCopy, - blk.GetSlot()+1, + beaconBlk.GetSlot()+1, payloadtime.Next( s.chainSpec, payloadTime, - consensusBlk.GetConsensusBlockTime(), + blk.GetConsensusBlockTime(), ), prevBlockRoot, lph.GetBlockHash(), @@ -105,10 +105,10 @@ func (s *Service[ ExecutionPayloadHeaderT, _, PayloadAttributesT, ]) sendNextFCUWithoutAttributes( ctx context.Context, - consensusBlk ConsensusBlockT, + blk ConsensusBlockT, lph ExecutionPayloadHeaderT, ) { - blk := consensusBlk.GetBeaconBlock() + beaconBlk := blk.GetBeaconBlock() if _, _, err := s.executionEngine.NotifyForkchoiceUpdate( ctx, @@ -120,7 +120,7 @@ func (s *Service[ SafeBlockHash: lph.GetParentHash(), FinalizedBlockHash: lph.GetParentHash(), }, - s.chainSpec.ActiveForkVersionForSlot(blk.GetSlot()), + s.chainSpec.ActiveForkVersionForSlot(beaconBlk.GetSlot()), ), ); err != nil { s.logger.Error( diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 7cb8c12ff0..47f17fd846 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -50,17 +50,17 @@ func (s *Service[ _, ConsensusBlockT, _, _, _, _, _, _, _, _, _, ]) ProcessBeaconBlock( ctx context.Context, - consensusBlk ConsensusBlockT, + blk ConsensusBlockT, ) (transition.ValidatorUpdates, error) { - blk := consensusBlk.GetBeaconBlock() + beaconBlk := blk.GetBeaconBlock() // If the block is nil, exit early. - if blk.IsNil() { + if beaconBlk.IsNil() { return nil, ErrNilBlk } st := s.storageBackend.StateFromContext(ctx) - valUpdates, err := s.executeStateTransition(ctx, st, blk) + valUpdates, err := s.executeStateTransition(ctx, st, beaconBlk) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (s *Service[ // return an error. It is safe to use the slot off of the beacon block // since it has been verified as correct already. if !s.storageBackend.AvailabilityStore().IsDataAvailable( - ctx, blk.GetSlot(), blk.GetBody(), + ctx, beaconBlk.GetSlot(), beaconBlk.GetBody(), ) { return nil, ErrDataNotAvailable } @@ -81,13 +81,13 @@ func (s *Service[ // via ticker later. if err = s.dispatcher.Publish( async.NewEvent( - ctx, async.BeaconBlockFinalized, consensusBlk, + ctx, async.BeaconBlockFinalized, blk, ), ); err != nil { return nil, err } - go s.sendPostBlockFCU(ctx, st, consensusBlk) + go s.sendPostBlockFCU(ctx, st, blk) return valUpdates.CanonicalSort(), nil } diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 17dc617444..135d4b05cc 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -35,11 +35,11 @@ func (s *Service[ _, ConsensusBlockT, BeaconBlockT, _, _, _, _, _, _, _, _, ]) VerifyIncomingBlock( ctx context.Context, - consensusBlk ConsensusBlockT, + blk ConsensusBlockT, ) error { var ( - blk = consensusBlk.GetBeaconBlock() - consensusTime = consensusBlk.GetConsensusBlockTime() + beaconBlk = blk.GetBeaconBlock() + consensusTime = blk.GetConsensusBlockTime() ) // Grab a copy of the state to verify the incoming block. @@ -52,7 +52,7 @@ func (s *Service[ s.forceStartupSyncOnce.Do(func() { s.forceStartupHead(ctx, preState) }) // If the block is nil or a nil pointer, exit early. - if blk.IsNil() { + if beaconBlk.IsNil() { s.logger.Warn( "Aborting block verification - beacon block not found in proposal", ) @@ -61,7 +61,7 @@ func (s *Service[ s.logger.Info( "Received incoming beacon block", - "state_root", blk.GetStateRoot(), "slot", blk.GetSlot(), + "state_root", beaconBlk.GetStateRoot(), "slot", beaconBlk.GetSlot(), ) // We purposefully make a copy of the BeaconState in order @@ -71,11 +71,11 @@ func (s *Service[ postState := preState.Copy() // Verify the state root of the incoming block. - if err := s.verifyStateRoot(ctx, postState, blk); err != nil { + if err := s.verifyStateRoot(ctx, postState, beaconBlk); err != nil { s.logger.Error( "Rejecting incoming beacon block ❌ ", "state_root", - blk.GetStateRoot(), + beaconBlk.GetStateRoot(), "reason", err, ) @@ -94,14 +94,14 @@ func (s *Service[ s.logger.Info( "State root verification succeeded - accepting incoming beacon block", "state_root", - blk.GetStateRoot(), + beaconBlk.GetStateRoot(), ) if s.shouldBuildOptimisticPayloads() { go s.handleOptimisticPayloadBuild( ctx, postState, - blk, + beaconBlk, consensusTime, ) } diff --git a/mod/beacon/payload-time/time.go b/mod/beacon/payload-time/time.go index eb9132eb47..5dd56a3bfa 100644 --- a/mod/beacon/payload-time/time.go +++ b/mod/beacon/payload-time/time.go @@ -35,10 +35,10 @@ import ( func Next( chainSpec common.ChainSpec, parentPayloadTime math.U64, - consensusBlkTime math.U64, + consensusTime math.U64, ) uint64 { return max( - uint64(consensusBlkTime)+chainSpec.TargetSecondsPerEth1Block(), + uint64(consensusTime)+chainSpec.TargetSecondsPerEth1Block(), uint64(parentPayloadTime+1), ) } From 70bba144cc80ff206d9168f46c8a0f2458bb58da Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 22:38:22 +0200 Subject: [PATCH 15/51] wip: fixed dispatching of finalized beacon blocks --- mod/beacon/blockchain/process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 47f17fd846..0ef0dad3cf 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -81,7 +81,7 @@ func (s *Service[ // via ticker later. if err = s.dispatcher.Publish( async.NewEvent( - ctx, async.BeaconBlockFinalized, blk, + ctx, async.BeaconBlockFinalized, beaconBlk, ), ); err != nil { return nil, err From 0365941297cce3ff13c5f26f7fca3361d6b59e95 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 23:13:52 +0200 Subject: [PATCH 16/51] wip: rebased next payload timestamp for building blocks on top of consensus block time --- mod/beacon/validator/block_builder.go | 11 +++++++---- mod/beacon/validator/types.go | 2 ++ mod/consensus/pkg/cometbft/service/abci.go | 3 ++- mod/consensus/pkg/types/slot_data.go | 10 ++++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 5bf02fa270..1d63a47a7d 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -84,7 +84,7 @@ func (s *Service[ } // Get the payload for the block. - envelope, err := s.retrieveExecutionPayload(ctx, st, blk) + envelope, err := s.retrieveExecutionPayload(ctx, st, blk, slotData) if err != nil { return blk, sidecars, err } else if envelope == nil { @@ -195,9 +195,12 @@ func (s *Service[ // retrieveExecutionPayload retrieves the execution payload for the block. func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, - ExecutionPayloadT, ExecutionPayloadHeaderT, _, _, _, + ExecutionPayloadT, ExecutionPayloadHeaderT, _, _, SlotDataT, ]) retrieveExecutionPayload( - ctx context.Context, st BeaconStateT, blk BeaconBlockT, + ctx context.Context, + st BeaconStateT, + blk BeaconBlockT, + slotData SlotDataT, ) (engineprimitives.BuiltExecutionPayloadEnv[ExecutionPayloadT], error) { // // TODO: Add external block builders to this flow. @@ -238,7 +241,7 @@ func (s *Service[ payloadtime.Next( s.chainSpec, lph.GetTimestamp(), - math.U64(time.Now().Unix()), + slotData.GetConsensusTime(), ), blk.GetParentBlockRoot(), lph.GetBlockHash(), diff --git a/mod/beacon/validator/types.go b/mod/beacon/validator/types.go index 16711f08ec..8e29a4fcc5 100644 --- a/mod/beacon/validator/types.go +++ b/mod/beacon/validator/types.go @@ -190,6 +190,8 @@ type SlotData[AttestationDataT, SlashingInfoT any] interface { GetAttestationData() []AttestationDataT // GetSlashingInfo returns the slashing info of the incoming slot. GetSlashingInfo() []SlashingInfoT + // GetConsensusTime returns network agreed time when slot is proposed + GetConsensusTime() math.U64 } // StateProcessor defines the interface for processing the state. diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index fe5c4f3331..5b965ef321 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -206,7 +206,8 @@ func (s *Service[LoggerT]) PrepareProposal( *ctypes.AttestationData, *ctypes.SlashingInfo, ]{ - Slot: math.Slot(req.Height), + Slot: math.Slot(req.Height), + ConsensusTime: math.U64(req.GetTime().Unix()), }, ) if err != nil { diff --git a/mod/consensus/pkg/types/slot_data.go b/mod/consensus/pkg/types/slot_data.go index 6a4d3b4718..48435ea4d3 100644 --- a/mod/consensus/pkg/types/slot_data.go +++ b/mod/consensus/pkg/types/slot_data.go @@ -30,6 +30,8 @@ type SlotData[AttestationDataT, SlashingInfoT any] struct { AttestationData []AttestationDataT // SlashingInfo is the slashing info of the incoming slot. SlashingInfo []SlashingInfoT + // Time tracked by consensus engine at the time SlotData is emitted. + ConsensusTime math.U64 } // New creates a new SlotData instance. @@ -67,6 +69,14 @@ func (b *SlotData[ return b.SlashingInfo } +// GetConsensusTime retrieves the slot of the SlotData. +func (b *SlotData[ + AttestationDataT, + SlashingInfoT, +]) GetConsensusTime() math.U64 { + return b.ConsensusTime +} + // SetAttestationData sets the attestation data of the SlotData. func (b *SlotData[AttestationDataT, SlashingInfoT]) SetAttestationData( attestationData []AttestationDataT, From da314f1222cf4704a4e59a17864f3fa8148eb25d Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 23:30:29 +0200 Subject: [PATCH 17/51] nits --- mod/beacon/blockchain/execution_engine.go | 2 +- mod/beacon/blockchain/receive.go | 2 +- mod/beacon/blockchain/types.go | 5 +---- .../pkg/cometbft/service/middleware/abci.go | 2 -- mod/consensus/pkg/types/consensus_block.go | 22 +++++-------------- mod/node-core/pkg/components/interfaces.go | 5 +---- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 178a720854..328a5dacdd 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -84,7 +84,7 @@ func (s *Service[ payloadtime.Next( s.chainSpec, payloadTime, - blk.GetConsensusBlockTime(), + blk.GetConsensusTime(), ), prevBlockRoot, lph.GetBlockHash(), diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 135d4b05cc..efc0c7ddd9 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -39,7 +39,7 @@ func (s *Service[ ) error { var ( beaconBlk = blk.GetBeaconBlock() - consensusTime = blk.GetConsensusBlockTime() + consensusTime = blk.GetConsensusTime() ) // Grab a copy of the state to verify the incoming block. diff --git a/mod/beacon/blockchain/types.go b/mod/beacon/blockchain/types.go index 599425e3b9..eb8b330842 100644 --- a/mod/beacon/blockchain/types.go +++ b/mod/beacon/blockchain/types.go @@ -45,10 +45,7 @@ type AvailabilityStore[BeaconBlockBodyT any] interface { type ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetConsensusBlockTime() math.U64 - - // TODO: harden the return type - GetConsensusProposerAddress() []byte + GetConsensusTime() math.U64 } // BeaconBlock represents a beacon block interface. diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index d82ca73e2c..6ca3734554 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -225,7 +225,6 @@ func (h *ABCIMiddleware[ enrichedBlk = enrichedBlk.New( blk, ctx.BlockTime(), - ctx.BlockHeader().ProposerAddress, ) blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { @@ -343,7 +342,6 @@ func (h *ABCIMiddleware[ enrichedBlk = enrichedBlk.New( blk, ctx.BlockTime(), - ctx.BlockHeader().ProposerAddress, ) blkEvent := async.NewEvent(ctx, async.FinalBeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { diff --git a/mod/consensus/pkg/types/consensus_block.go b/mod/consensus/pkg/types/consensus_block.go index 632e7e1a52..56c2701544 100644 --- a/mod/consensus/pkg/types/consensus_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -29,23 +29,18 @@ import ( type ConsensusBlock[BeaconBlockT any] struct { blk BeaconBlockT - // blkTime assigned by CometBFT to the beacon block - blkTime math.U64 - - // block proposer address assigned by CometBFT to the beacon block - blkProposerAddress []byte + // consensusTime assigned by CometBFT to the beacon block + consensusTime math.U64 } // New creates a new SlotData instance. func (b *ConsensusBlock[BeaconBlockT]) New( beaconBlock BeaconBlockT, blkTime time.Time, - blkProposerAddress []byte, ) *ConsensusBlock[BeaconBlockT] { b = &ConsensusBlock[BeaconBlockT]{ - blk: beaconBlock, - blkTime: math.U64(blkTime.Unix()), - blkProposerAddress: blkProposerAddress, + blk: beaconBlock, + consensusTime: math.U64(blkTime.Unix()), } return b } @@ -54,11 +49,6 @@ func (b *ConsensusBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { return b.blk } -func (b *ConsensusBlock[_]) GetConsensusBlockTime() math.U64 { - return b.blkTime -} - -// TODO: harden the return type -func (b *ConsensusBlock[_]) GetConsensusProposerAddress() []byte { - return b.blkProposerAddress +func (b *ConsensusBlock[_]) GetConsensusTime() math.U64 { + return b.consensusTime } diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index d39d85b6ed..0d943ebc2a 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -83,10 +83,7 @@ type ( ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetConsensusBlockTime() math.U64 - - // TODO: harden the return type - GetConsensusProposerAddress() []byte + GetConsensusTime() math.U64 } // BeaconBlock represents a generic interface for a beacon block. From 36041e8d9a28a93818769c95b816695039f198b6 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 23 Oct 2024 23:45:09 +0200 Subject: [PATCH 18/51] fixed consensus time setting --- mod/consensus/pkg/cometbft/service/middleware/abci.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index 6ca3734554..2a8139fae7 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -224,7 +224,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, - ctx.BlockTime(), + req.GetTime(), ) blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { @@ -341,7 +341,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, - ctx.BlockTime(), + req.GetTime(), ) blkEvent := async.NewEvent(ctx, async.FinalBeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { From 13a93eadfa65cbddc0bbd93754befd1349e55809 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 24 Oct 2024 10:34:21 +0200 Subject: [PATCH 19/51] improved SlotData encapsulation --- mod/consensus/pkg/cometbft/service/abci.go | 19 +++++++----- mod/consensus/pkg/types/slot_data.go | 34 ++++++++++++---------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index 5b965ef321..359bc573c5 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -201,14 +201,19 @@ func (s *Service[LoggerT]) PrepareProposal( ), ) + var slotData *types.SlotData[ + *ctypes.AttestationData, + *ctypes.SlashingInfo, + ] + slotData = slotData.New( + math.Slot(req.Height), + nil, + nil, + math.U64(req.GetTime().Unix()), + ) blkBz, sidecarsBz, err := s.Middleware.PrepareProposal( - s.prepareProposalState.Context(), &types.SlotData[ - *ctypes.AttestationData, - *ctypes.SlashingInfo, - ]{ - Slot: math.Slot(req.Height), - ConsensusTime: math.U64(req.GetTime().Unix()), - }, + s.prepareProposalState.Context(), + slotData, ) if err != nil { s.logger.Error( diff --git a/mod/consensus/pkg/types/slot_data.go b/mod/consensus/pkg/types/slot_data.go index 48435ea4d3..94db60d611 100644 --- a/mod/consensus/pkg/types/slot_data.go +++ b/mod/consensus/pkg/types/slot_data.go @@ -24,14 +24,14 @@ import "github.com/berachain/beacon-kit/mod/primitives/pkg/math" // SlotData represents the data to be used to propose a block. type SlotData[AttestationDataT, SlashingInfoT any] struct { - // Slot is the slot number of the incoming slot. - math.Slot - // AttestationData is the attestation data of the incoming slot. - AttestationData []AttestationDataT - // SlashingInfo is the slashing info of the incoming slot. - SlashingInfo []SlashingInfoT + // slot is the slot number of the incoming slot. + slot math.Slot + // attestationData is the attestation data of the incoming slot. + attestationData []AttestationDataT + // slashingInfo is the slashing info of the incoming slot. + slashingInfo []SlashingInfoT // Time tracked by consensus engine at the time SlotData is emitted. - ConsensusTime math.U64 + consensusTime math.U64 } // New creates a new SlotData instance. @@ -39,18 +39,20 @@ func (b *SlotData[AttestationDataT, SlashingInfoT]) New( slot math.Slot, attestationData []AttestationDataT, slashingInfo []SlashingInfoT, + consensusTime math.U64, ) *SlotData[AttestationDataT, SlashingInfoT] { b = &SlotData[AttestationDataT, SlashingInfoT]{ - Slot: slot, - AttestationData: attestationData, - SlashingInfo: slashingInfo, + slot: slot, + attestationData: attestationData, + slashingInfo: slashingInfo, + consensusTime: consensusTime, } return b } // GetSlot retrieves the slot of the SlotData. func (b *SlotData[AttestationDataT, SlashingInfoT]) GetSlot() math.Slot { - return b.Slot + return b.slot } // GetAttestationData retrieves the attestation data of the SlotData. @@ -58,7 +60,7 @@ func (b *SlotData[ AttestationDataT, SlashingInfoT, ]) GetAttestationData() []AttestationDataT { - return b.AttestationData + return b.attestationData } // GetSlashingInfo retrieves the slashing info of the SlotData. @@ -66,7 +68,7 @@ func (b *SlotData[ AttestationDataT, SlashingInfoT, ]) GetSlashingInfo() []SlashingInfoT { - return b.SlashingInfo + return b.slashingInfo } // GetConsensusTime retrieves the slot of the SlotData. @@ -74,19 +76,19 @@ func (b *SlotData[ AttestationDataT, SlashingInfoT, ]) GetConsensusTime() math.U64 { - return b.ConsensusTime + return b.consensusTime } // SetAttestationData sets the attestation data of the SlotData. func (b *SlotData[AttestationDataT, SlashingInfoT]) SetAttestationData( attestationData []AttestationDataT, ) { - b.AttestationData = attestationData + b.attestationData = attestationData } // SetSlashingInfo sets the slashing info of the SlotData. func (b *SlotData[AttestationDataT, SlashingInfoT]) SetSlashingInfo( slashingInfo []SlashingInfoT, ) { - b.SlashingInfo = slashingInfo + b.slashingInfo = slashingInfo } From 0c6e82a274d35086e2a6cdf59ccf9de4edb30574 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 24 Oct 2024 10:57:09 +0200 Subject: [PATCH 20/51] nit --- mod/beacon/payload-time/time.go | 8 ++++---- mod/consensus/pkg/cometbft/service/abci.go | 2 +- mod/consensus/pkg/types/slot_data.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mod/beacon/payload-time/time.go b/mod/beacon/payload-time/time.go index 5dd56a3bfa..ba883d21cf 100644 --- a/mod/beacon/payload-time/time.go +++ b/mod/beacon/payload-time/time.go @@ -28,10 +28,10 @@ import ( // Next calculates the timestamp for the // next execution payload to be built. // The timestamp is set to be: -// Strictly increasing wrt parent payload timestamp -// Ideally spaced around the TargetSecondsPerEth1Block -// Referred to consensus tracked time, which should have -// extra stability properties. +// - Strictly increasing wrt parent payload timestamp +// - Ideally spaced around the TargetSecondsPerEth1Block +// - Referred to consensus tracked time, which should have +// extra stability properties. func Next( chainSpec common.ChainSpec, parentPayloadTime math.U64, diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index 359bc573c5..d9c3271068 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -206,7 +206,7 @@ func (s *Service[LoggerT]) PrepareProposal( *ctypes.SlashingInfo, ] slotData = slotData.New( - math.Slot(req.Height), + math.Slot(req.GetHeight()), nil, nil, math.U64(req.GetTime().Unix()), diff --git a/mod/consensus/pkg/types/slot_data.go b/mod/consensus/pkg/types/slot_data.go index 94db60d611..94db6bd32b 100644 --- a/mod/consensus/pkg/types/slot_data.go +++ b/mod/consensus/pkg/types/slot_data.go @@ -71,7 +71,7 @@ func (b *SlotData[ return b.slashingInfo } -// GetConsensusTime retrieves the slot of the SlotData. +// GetConsensusTime retrieves the consensus time. func (b *SlotData[ AttestationDataT, SlashingInfoT, From 20c881e2730b4e9c8ddd02a3f98a6e7ed1d00b99 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 24 Oct 2024 12:07:54 +0200 Subject: [PATCH 21/51] dropped minor code duplication --- mod/beacon/blockchain/execution_engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 328a5dacdd..4cf84804fc 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -44,7 +44,7 @@ func (s *Service[ return } - if !s.shouldBuildOptimisticPayloads() && s.localBuilder.Enabled() { + if !s.shouldBuildOptimisticPayloads() { s.sendNextFCUWithAttributes(ctx, st, blk, lph) } else { s.sendNextFCUWithoutAttributes(ctx, blk, lph) From 6b106b826103a46b78c27d8c63d70378df32a5fe Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Thu, 24 Oct 2024 16:37:53 +0200 Subject: [PATCH 22/51] fix(blockchain): Further timestamp simplification (#2097) --- mod/beacon/blockchain/execution_engine.go | 8 +---- mod/beacon/blockchain/payload.go | 5 ++- mod/beacon/payload-time/time.go | 44 ----------------------- mod/beacon/validator/block_builder.go | 7 +--- 4 files changed, 4 insertions(+), 60 deletions(-) delete mode 100644 mod/beacon/payload-time/time.go diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 4cf84804fc..b6b2f58dc5 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -23,7 +23,6 @@ package blockchain import ( "context" - payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" ) @@ -76,16 +75,11 @@ func (s *Service[ } prevBlockRoot := beaconBlk.HashTreeRoot() - payloadTime := beaconBlk.GetBody().GetExecutionPayload().GetTimestamp() if _, err := s.localBuilder.RequestPayloadAsync( ctx, stCopy, beaconBlk.GetSlot()+1, - payloadtime.Next( - s.chainSpec, - payloadTime, - blk.GetConsensusTime(), - ), + blk.GetConsensusTime().Unwrap(), prevBlockRoot, lph.GetBlockHash(), lph.GetParentHash(), diff --git a/mod/beacon/blockchain/payload.go b/mod/beacon/blockchain/payload.go index ff03f5ea93..0f27bd9c00 100644 --- a/mod/beacon/blockchain/payload.go +++ b/mod/beacon/blockchain/payload.go @@ -23,7 +23,6 @@ package blockchain import ( "context" - payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) @@ -121,7 +120,7 @@ func (s *Service[ st, // We are rebuilding for the current slot. stateSlot, - payloadtime.Next(s.chainSpec, lph.GetTimestamp(), consensusTime), + consensusTime.Unwrap(), // We set the parent root to the previous block root. latestHeader.HashTreeRoot(), // We set the head of our chain to the previous finalized block. @@ -190,7 +189,7 @@ func (s *Service[ if _, err := s.localBuilder.RequestPayloadAsync( ctx, st, slot, - payloadtime.Next(s.chainSpec, payload.GetTimestamp(), consensusTime), + consensusTime.Unwrap(), // The previous block root is simply the root of the block we just // processed. blk.HashTreeRoot(), diff --git a/mod/beacon/payload-time/time.go b/mod/beacon/payload-time/time.go deleted file mode 100644 index ba883d21cf..0000000000 --- a/mod/beacon/payload-time/time.go +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2024, Berachain Foundation. All rights reserved. -// Use of this software is governed by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package payloadtime - -import ( - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/primitives/pkg/math" -) - -// Next calculates the timestamp for the -// next execution payload to be built. -// The timestamp is set to be: -// - Strictly increasing wrt parent payload timestamp -// - Ideally spaced around the TargetSecondsPerEth1Block -// - Referred to consensus tracked time, which should have -// extra stability properties. -func Next( - chainSpec common.ChainSpec, - parentPayloadTime math.U64, - consensusTime math.U64, -) uint64 { - return max( - uint64(consensusTime)+chainSpec.TargetSecondsPerEth1Block(), - uint64(parentPayloadTime+1), - ) -} diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 1d63a47a7d..b0f4a63baf 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -25,7 +25,6 @@ import ( "fmt" "time" - payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" @@ -238,11 +237,7 @@ func (s *Service[ ctx, st, blk.GetSlot(), - payloadtime.Next( - s.chainSpec, - lph.GetTimestamp(), - slotData.GetConsensusTime(), - ), + uint64(slotData.GetConsensusTime()), blk.GetParentBlockRoot(), lph.GetBlockHash(), lph.GetParentHash(), From e447c202fc0389e1524f82125275729544aa77ca Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Thu, 24 Oct 2024 23:11:24 +0200 Subject: [PATCH 23/51] fix(state-transition): Validate execution payload timestamp (#2096) --- mod/beacon/blockchain/process.go | 10 ++++--- mod/beacon/blockchain/receive.go | 18 +++++------ mod/beacon/validator/block_builder.go | 15 ++++++++-- mod/primitives/pkg/transition/context.go | 15 +++++++++- mod/state-transition/pkg/core/errors.go | 4 +++ .../pkg/core/state_processor.go | 8 ++--- .../pkg/core/state_processor_payload.go | 30 ++++++++++++++----- mod/state-transition/pkg/core/types.go | 3 ++ 8 files changed, 73 insertions(+), 30 deletions(-) diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 0ef0dad3cf..d6639812f3 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -60,7 +60,7 @@ func (s *Service[ } st := s.storageBackend.StateFromContext(ctx) - valUpdates, err := s.executeStateTransition(ctx, st, beaconBlk) + valUpdates, err := s.executeStateTransition(ctx, st, blk) if err != nil { return nil, err } @@ -94,11 +94,11 @@ func (s *Service[ // executeStateTransition runs the stf. func (s *Service[ - _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, BeaconStateT, _, _, _, _, _, ]) executeStateTransition( ctx context.Context, st BeaconStateT, - blk BeaconBlockT, + blk ConsensusBlockT, ) (transition.ValidatorUpdates, error) { startTime := time.Now() defer s.metrics.measureStateTransitionDuration(startTime) @@ -127,9 +127,11 @@ func (s *Service[ // the "verification aspect" of this NewPayload call is // actually irrelevant at this point. SkipPayloadVerification: false, + + ConsensusTime: blk.GetConsensusTime(), }, st, - blk, + blk.GetBeaconBlock(), ) return valUpdates, err } diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index efc0c7ddd9..1e62990418 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -71,7 +71,7 @@ func (s *Service[ postState := preState.Copy() // Verify the state root of the incoming block. - if err := s.verifyStateRoot(ctx, postState, beaconBlk); err != nil { + if err := s.verifyStateRoot(ctx, postState, blk); err != nil { s.logger.Error( "Rejecting incoming beacon block ❌ ", "state_root", @@ -111,15 +111,15 @@ func (s *Service[ // verifyStateRoot verifies the state root of an incoming block. func (s *Service[ - _, _, BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, + _, ConsensusBlockT, _, _, _, BeaconStateT, _, _, _, _, _, ]) verifyStateRoot( ctx context.Context, st BeaconStateT, - blk BeaconBlockT, + blk ConsensusBlockT, ) error { startTime := time.Now() defer s.metrics.measureStateRootVerificationTime(startTime) - if _, err := s.stateProcessor.Transition( + _, err := s.stateProcessor.Transition( // We run with a non-optimistic engine here to ensure // that the proposer does not try to push through a bad block. &transition.Context{ @@ -128,20 +128,20 @@ func (s *Service[ SkipPayloadVerification: false, SkipValidateResult: false, SkipValidateRandao: false, + ConsensusTime: blk.GetConsensusTime(), }, - st, blk, - ); errors.Is(err, engineerrors.ErrAcceptedPayloadStatus) { + st, blk.GetBeaconBlock(), + ) + if errors.Is(err, engineerrors.ErrAcceptedPayloadStatus) { // It is safe for the validator to ignore this error since // the state transition will enforce that the block is part // of the canonical chain. // // TODO: this is only true because we are assuming SSF. return nil - } else if err != nil { - return err } - return nil + return err } // shouldBuildOptimisticPayloads returns true if optimistic diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index b0f4a63baf..7becb7cbd4 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -86,7 +86,8 @@ func (s *Service[ envelope, err := s.retrieveExecutionPayload(ctx, st, blk, slotData) if err != nil { return blk, sidecars, err - } else if envelope == nil { + } + if envelope == nil { return blk, sidecars, ErrNilPayload } @@ -113,7 +114,12 @@ func (s *Service[ // Compute the state root for the block. g.Go(func() error { - return s.computeAndSetStateRoot(ctx, st, blk) + return s.computeAndSetStateRoot( + ctx, + slotData.GetConsensusTime(), + st, + blk, + ) }) // Wait for all the goroutines to finish. @@ -332,10 +338,11 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeAndSetStateRoot( ctx context.Context, + consensusTime math.U64, st BeaconStateT, blk BeaconBlockT, ) error { - stateRoot, err := s.computeStateRoot(ctx, st, blk) + stateRoot, err := s.computeStateRoot(ctx, consensusTime, st, blk) if err != nil { s.logger.Error( "failed to compute state root while building block ❗️ ", @@ -353,6 +360,7 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeStateRoot( ctx context.Context, + consensusTime math.U64, st BeaconStateT, blk BeaconBlockT, ) (common.Root, error) { @@ -368,6 +376,7 @@ func (s *Service[ SkipPayloadVerification: true, SkipValidateResult: true, SkipValidateRandao: true, + ConsensusTime: consensusTime, }, st, blk, ); err != nil { diff --git a/mod/primitives/pkg/transition/context.go b/mod/primitives/pkg/transition/context.go index 2cbc3cb42c..da543c0fe1 100644 --- a/mod/primitives/pkg/transition/context.go +++ b/mod/primitives/pkg/transition/context.go @@ -20,7 +20,11 @@ package transition -import "context" +import ( + "context" + + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" +) // Context is the context for the state transition. type Context struct { @@ -38,6 +42,9 @@ type Context struct { // SkipValidateResult indicates whether to validate the result of // the state transition. SkipValidateResult bool + // ConsensusTime is the network agreed time for the block causing the + // state transition to be performed + ConsensusTime math.U64 } // GetOptimisticEngine returns whether to optimistically assume the execution @@ -65,6 +72,12 @@ func (c *Context) GetSkipValidateResult() bool { return c.SkipValidateResult } +// GetConsensusTime returns the consensus time for the block causing +// the state transition. +func (c *Context) GetConsensusTime() math.U64 { + return c.ConsensusTime +} + // Unwrap returns the underlying standard context. func (c *Context) Unwrap() context.Context { return c.Context diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index a29026a795..9940eb519c 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -67,6 +67,10 @@ var ( // does not match the expected value. ErrStateRootMismatch = errors.New("state root mismatch") + // ErrTooFarInTheFuture is returned when the payload timestamp + // in a block exceeds the time bound. + ErrTooFarInTheFuture = errors.New("timestamp too far in the future") + // ErrExceedMaximumWithdrawals is returned when the number of withdrawals // in a block exceeds the maximum allowed. ErrExceedMaximumWithdrawals = errors.New("exceeds maximum withdrawals") diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 439cf3895f..05c1a188df 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -284,16 +284,12 @@ func (sp *StateProcessor[ } // process the execution payload. - if err := sp.processExecutionPayload( - ctx, st, blk, - ); err != nil { + if err := sp.processExecutionPayload(ctx, st, blk); err != nil { return err } // process the withdrawals. - if err := sp.processWithdrawals( - st, blk.GetBody(), - ); err != nil { + if err := sp.processWithdrawals(st, blk.GetBody()); err != nil { return err } diff --git a/mod/state-transition/pkg/core/state_processor_payload.go b/mod/state-transition/pkg/core/state_processor_payload.go index 715d8d8af3..b0bbb88157 100644 --- a/mod/state-transition/pkg/core/state_processor_payload.go +++ b/mod/state-transition/pkg/core/state_processor_payload.go @@ -25,6 +25,7 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/errors" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "golang.org/x/sync/errgroup" ) @@ -49,7 +50,9 @@ func (sp *StateProcessor[ if !ctx.GetSkipPayloadVerification() { g.Go(func() error { return sp.validateExecutionPayload( - gCtx, st, blk, ctx.GetOptimisticEngine(), + gCtx, st, blk, + ctx.GetConsensusTime(), + ctx.GetOptimisticEngine(), ) }) } @@ -84,9 +87,10 @@ func (sp *StateProcessor[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, + consensusTime math.U64, optimisticEngine bool, ) error { - if err := sp.validateStatelessPayload(blk); err != nil { + if err := sp.validateStatelessPayload(blk, consensusTime); err != nil { return err } return sp.validateStatefulPayload(ctx, st, blk, optimisticEngine) @@ -96,14 +100,25 @@ func (sp *StateProcessor[ func (sp *StateProcessor[ BeaconBlockT, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, -]) validateStatelessPayload(blk BeaconBlockT) error { +]) validateStatelessPayload( + blk BeaconBlockT, + consensusTime math.U64, +) error { body := blk.GetBody() payload := body.GetExecutionPayload() + timeBound := consensusTime + math.U64(sp.cs.TargetSecondsPerEth1Block()) + if pt := payload.GetTimestamp(); pt > timeBound { + return errors.Wrapf( + ErrTooFarInTheFuture, + "payload timestamp, max: %d, got: %d", + timeBound, pt, + ) + } + // Verify the number of withdrawals. - if withdrawals := payload.GetWithdrawals(); uint64( - len(withdrawals), - ) > sp.cs.MaxWithdrawalsPerPayload() { + withdrawals := payload.GetWithdrawals() + if uint64(len(withdrawals)) > sp.cs.MaxWithdrawalsPerPayload() { return errors.Wrapf( ErrExceedMaximumWithdrawals, "too many withdrawals, expected: %d, got: %d", @@ -143,7 +158,8 @@ func (sp *StateProcessor[ } // Check chain canonicity - if safeHash := lph.GetBlockHash(); safeHash != payload.GetParentHash() { + safeHash := lph.GetBlockHash() + if safeHash != payload.GetParentHash() { return errors.Wrapf( ErrParentPayloadHashMismatch, "parent block with hash %x is not finalized, expected finalized hash %x", diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 5a359344d3..99cdce7799 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -118,6 +118,9 @@ type Context interface { // GetSkipValidateResult returns whether to validate the result of the state // transition. GetSkipValidateResult() bool + // GetConsensusTime returns the consensus time for the block causing + // the state transition. + GetConsensusTime() math.U64 } // Deposit is the interface for a deposit. From 699df26f88a901b5325a85c164b7e0f46eea51c1 Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Fri, 25 Oct 2024 21:58:58 +0200 Subject: [PATCH 24/51] fix(consensus, beacon): let consensus tell SuggestedNextPayloadTimestamp (#2101) --- mod/beacon/blockchain/execution_engine.go | 2 +- mod/beacon/blockchain/payload.go | 16 +++++------ mod/beacon/blockchain/process.go | 2 +- mod/beacon/blockchain/receive.go | 10 +++---- mod/beacon/blockchain/types.go | 5 +++- mod/beacon/validator/block_builder.go | 16 +++++------ mod/beacon/validator/types.go | 6 ++-- mod/consensus/pkg/cometbft/service/abci.go | 6 +++- .../pkg/cometbft/service/middleware/abci.go | 4 +-- .../cometbft/service/middleware/middleware.go | 18 ++++++++++++ mod/consensus/pkg/types/consensus_block.go | 16 ++++++----- mod/consensus/pkg/types/slot_data.go | 28 +++++++++++-------- mod/node-core/pkg/components/interfaces.go | 5 +++- mod/node-core/pkg/components/middleware.go | 3 ++ mod/primitives/pkg/transition/context.go | 16 ++++++----- .../pkg/core/state_processor_payload.go | 13 ++++----- mod/state-transition/pkg/core/types.go | 7 +++-- 17 files changed, 107 insertions(+), 66 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index b6b2f58dc5..252a62a1ff 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -79,7 +79,7 @@ func (s *Service[ ctx, stCopy, beaconBlk.GetSlot()+1, - blk.GetConsensusTime().Unwrap(), + blk.GetNextPayloadTimestamp().Unwrap(), prevBlockRoot, lph.GetBlockHash(), lph.GetParentHash(), diff --git a/mod/beacon/blockchain/payload.go b/mod/beacon/blockchain/payload.go index 0f27bd9c00..2398f07a26 100644 --- a/mod/beacon/blockchain/payload.go +++ b/mod/beacon/blockchain/payload.go @@ -60,12 +60,12 @@ func (s *Service[ ]) handleRebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, ) { if err := s.rebuildPayloadForRejectedBlock( ctx, st, - consensusTime, + nextPayloadTimestamp, ); err != nil { s.logger.Error( "failed to rebuild payload for nil block", @@ -86,7 +86,7 @@ func (s *Service[ ]) rebuildPayloadForRejectedBlock( ctx context.Context, st BeaconStateT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, ) error { s.logger.Info("Rebuilding payload for rejected block ⏳ ") @@ -120,7 +120,7 @@ func (s *Service[ st, // We are rebuilding for the current slot. stateSlot, - consensusTime.Unwrap(), + nextPayloadTimestamp.Unwrap(), // We set the parent root to the previous block root. latestHeader.HashTreeRoot(), // We set the head of our chain to the previous finalized block. @@ -145,13 +145,13 @@ func (s *Service[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, ) { if err := s.optimisticPayloadBuild( ctx, st, blk, - consensusTime, + nextPayloadTimestamp, ); err != nil { s.logger.Error( "Failed to build optimistic payload", @@ -168,7 +168,7 @@ func (s *Service[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, ) error { // We are building for the next slot, so we increment the slot relative // to the block we just processed. @@ -189,7 +189,7 @@ func (s *Service[ if _, err := s.localBuilder.RequestPayloadAsync( ctx, st, slot, - consensusTime.Unwrap(), + nextPayloadTimestamp.Unwrap(), // The previous block root is simply the root of the block we just // processed. blk.HashTreeRoot(), diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index d6639812f3..99936c72ed 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -128,7 +128,7 @@ func (s *Service[ // actually irrelevant at this point. SkipPayloadVerification: false, - ConsensusTime: blk.GetConsensusTime(), + NextPayloadTimestamp: blk.GetNextPayloadTimestamp(), }, st, blk.GetBeaconBlock(), diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 1e62990418..3066913eaf 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -38,8 +38,8 @@ func (s *Service[ blk ConsensusBlockT, ) error { var ( - beaconBlk = blk.GetBeaconBlock() - consensusTime = blk.GetConsensusTime() + beaconBlk = blk.GetBeaconBlock() + nextPayloadTimestamp = blk.GetNextPayloadTimestamp() ) // Grab a copy of the state to verify the incoming block. @@ -84,7 +84,7 @@ func (s *Service[ go s.handleRebuildPayloadForRejectedBlock( ctx, preState, - consensusTime, + nextPayloadTimestamp, ) } @@ -102,7 +102,7 @@ func (s *Service[ ctx, postState, beaconBlk, - consensusTime, + nextPayloadTimestamp, ) } @@ -128,7 +128,7 @@ func (s *Service[ SkipPayloadVerification: false, SkipValidateResult: false, SkipValidateRandao: false, - ConsensusTime: blk.GetConsensusTime(), + NextPayloadTimestamp: blk.GetNextPayloadTimestamp(), }, st, blk.GetBeaconBlock(), ) diff --git a/mod/beacon/blockchain/types.go b/mod/beacon/blockchain/types.go index eb8b330842..8a38d7a743 100644 --- a/mod/beacon/blockchain/types.go +++ b/mod/beacon/blockchain/types.go @@ -45,7 +45,10 @@ type AvailabilityStore[BeaconBlockBodyT any] interface { type ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetConsensusTime() math.U64 + // GetNextPayloadTimestamp returns the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + GetNextPayloadTimestamp() math.U64 } // BeaconBlock represents a beacon block interface. diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 7becb7cbd4..c09d04df25 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -75,9 +75,7 @@ func (s *Service[ } // Create a new empty block from the current state. - blk, err = s.getEmptyBeaconBlockForSlot( - st, slotData.GetSlot(), - ) + blk, err = s.getEmptyBeaconBlockForSlot(st, slotData.GetSlot()) if err != nil { return blk, sidecars, err } @@ -116,7 +114,7 @@ func (s *Service[ g.Go(func() error { return s.computeAndSetStateRoot( ctx, - slotData.GetConsensusTime(), + slotData.GetNextPayloadTimestamp(), st, blk, ) @@ -243,7 +241,7 @@ func (s *Service[ ctx, st, blk.GetSlot(), - uint64(slotData.GetConsensusTime()), + slotData.GetNextPayloadTimestamp().Unwrap(), blk.GetParentBlockRoot(), lph.GetBlockHash(), lph.GetParentHash(), @@ -338,11 +336,11 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeAndSetStateRoot( ctx context.Context, - consensusTime math.U64, + nextPayloadTimestamp math.U64, st BeaconStateT, blk BeaconBlockT, ) error { - stateRoot, err := s.computeStateRoot(ctx, consensusTime, st, blk) + stateRoot, err := s.computeStateRoot(ctx, nextPayloadTimestamp, st, blk) if err != nil { s.logger.Error( "failed to compute state root while building block ❗️ ", @@ -360,7 +358,7 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeStateRoot( ctx context.Context, - consensusTime math.U64, + nextPayloadTimestamp math.U64, st BeaconStateT, blk BeaconBlockT, ) (common.Root, error) { @@ -376,7 +374,7 @@ func (s *Service[ SkipPayloadVerification: true, SkipValidateResult: true, SkipValidateRandao: true, - ConsensusTime: consensusTime, + NextPayloadTimestamp: nextPayloadTimestamp, }, st, blk, ); err != nil { diff --git a/mod/beacon/validator/types.go b/mod/beacon/validator/types.go index 8e29a4fcc5..c327753707 100644 --- a/mod/beacon/validator/types.go +++ b/mod/beacon/validator/types.go @@ -190,8 +190,10 @@ type SlotData[AttestationDataT, SlashingInfoT any] interface { GetAttestationData() []AttestationDataT // GetSlashingInfo returns the slashing info of the incoming slot. GetSlashingInfo() []SlashingInfoT - // GetConsensusTime returns network agreed time when slot is proposed - GetConsensusTime() math.U64 + // GetNextPayloadTimestamp returns the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + GetNextPayloadTimestamp() math.U64 } // StateProcessor defines the interface for processing the state. diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index dced149933..3ec7fb4df0 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -212,7 +212,11 @@ func (s *Service[LoggerT]) PrepareProposal( math.Slot(req.GetHeight()), nil, nil, - math.U64(req.GetTime().Unix()), + + // we do not add h.minPayloadDelay here since req.GetTime() + // is guaranteed to be strictly larger than + // prevBlock.GetTime() + h.minPayloadDelay + req.GetTime(), ) blkBz, sidecarsBz, err := s.Middleware.PrepareProposal( s.prepareProposalState.Context(), diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index 2a8139fae7..cbf5ed68f9 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -224,7 +224,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, - req.GetTime(), + req.GetTime().Add(h.minPayloadDelay), ) blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { @@ -341,7 +341,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, - req.GetTime(), + req.GetTime().Add(h.minPayloadDelay), ) blkEvent := async.NewEvent(ctx, async.FinalBeaconBlockReceived, enrichedBlk) if err = h.dispatcher.Publish(blkEvent); err != nil { diff --git a/mod/consensus/pkg/cometbft/service/middleware/middleware.go b/mod/consensus/pkg/cometbft/service/middleware/middleware.go index 9f6a3e0761..e4e3dcd02e 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/middleware.go +++ b/mod/consensus/pkg/cometbft/service/middleware/middleware.go @@ -22,12 +22,14 @@ package middleware import ( "context" + "time" "github.com/berachain/beacon-kit/mod/async/pkg/types" "github.com/berachain/beacon-kit/mod/log" "github.com/berachain/beacon-kit/mod/primitives/pkg/async" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/encoding/json" + cmtcfg "github.com/cometbft/cometbft/config" ) // ABCIMiddleware is a middleware between ABCI and the validator logic. @@ -39,6 +41,9 @@ type ABCIMiddleware[ ] struct { // chainSpec is the chain specification. chainSpec common.ChainSpec + // minimum delay among blocks, useful to set a strictly increasing + // execution payload timestamp. + minPayloadDelay time.Duration // dispatcher is the central dispatcher to dispatcher types.EventDispatcher // metrics is the metrics emitter. @@ -68,16 +73,29 @@ func NewABCIMiddleware[ SlotDataT any, ]( chainSpec common.ChainSpec, + cmtCfg *cmtcfg.Config, dispatcher types.EventDispatcher, logger log.Logger, telemetrySink TelemetrySink, ) *ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, GenesisT, SlotDataT, ] { + // We may build execution payload optimistically, i.e. build execution + // payload for next block while current block is being verified and not yet + // finalized. Hence we need a minPayloadDelay that guarantees that: + // curr + minPayloadDelay := min( + cmtCfg.Consensus.TimeoutPropose, + cmtCfg.Consensus.TimeoutPrevote, + cmtCfg.Consensus.TimeoutPrecommit, + cmtCfg.Consensus.TimeoutCommit, + ) + return &ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, GenesisT, SlotDataT, ]{ chainSpec: chainSpec, + minPayloadDelay: minPayloadDelay, dispatcher: dispatcher, logger: logger, metrics: newABCIMiddlewareMetrics(telemetrySink), diff --git a/mod/consensus/pkg/types/consensus_block.go b/mod/consensus/pkg/types/consensus_block.go index 56c2701544..7f16c0cfea 100644 --- a/mod/consensus/pkg/types/consensus_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -29,18 +29,17 @@ import ( type ConsensusBlock[BeaconBlockT any] struct { blk BeaconBlockT - // consensusTime assigned by CometBFT to the beacon block - consensusTime math.U64 + nextPayloadTimestamp math.U64 } // New creates a new SlotData instance. func (b *ConsensusBlock[BeaconBlockT]) New( beaconBlock BeaconBlockT, - blkTime time.Time, + nextPayloadTimestamp time.Time, ) *ConsensusBlock[BeaconBlockT] { b = &ConsensusBlock[BeaconBlockT]{ - blk: beaconBlock, - consensusTime: math.U64(blkTime.Unix()), + blk: beaconBlock, + nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), } return b } @@ -49,6 +48,9 @@ func (b *ConsensusBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { return b.blk } -func (b *ConsensusBlock[_]) GetConsensusTime() math.U64 { - return b.consensusTime +// GetNextPayloadTimestamp returns the timestamp proposed by consensus +// for the next payload to be proposed. It is also used to bound +// current payload upon validation. +func (b *ConsensusBlock[_]) GetNextPayloadTimestamp() math.U64 { + return b.nextPayloadTimestamp } diff --git a/mod/consensus/pkg/types/slot_data.go b/mod/consensus/pkg/types/slot_data.go index 94db6bd32b..c6acd77323 100644 --- a/mod/consensus/pkg/types/slot_data.go +++ b/mod/consensus/pkg/types/slot_data.go @@ -20,7 +20,11 @@ package types -import "github.com/berachain/beacon-kit/mod/primitives/pkg/math" +import ( + "time" + + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" +) // SlotData represents the data to be used to propose a block. type SlotData[AttestationDataT, SlashingInfoT any] struct { @@ -30,8 +34,10 @@ type SlotData[AttestationDataT, SlashingInfoT any] struct { attestationData []AttestationDataT // slashingInfo is the slashing info of the incoming slot. slashingInfo []SlashingInfoT - // Time tracked by consensus engine at the time SlotData is emitted. - consensusTime math.U64 + // nextPayloadTimestamp is the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + nextPayloadTimestamp math.U64 } // New creates a new SlotData instance. @@ -39,13 +45,13 @@ func (b *SlotData[AttestationDataT, SlashingInfoT]) New( slot math.Slot, attestationData []AttestationDataT, slashingInfo []SlashingInfoT, - consensusTime math.U64, + nextPayloadTimestamp time.Time, ) *SlotData[AttestationDataT, SlashingInfoT] { b = &SlotData[AttestationDataT, SlashingInfoT]{ - slot: slot, - attestationData: attestationData, - slashingInfo: slashingInfo, - consensusTime: consensusTime, + slot: slot, + attestationData: attestationData, + slashingInfo: slashingInfo, + nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), } return b } @@ -71,12 +77,12 @@ func (b *SlotData[ return b.slashingInfo } -// GetConsensusTime retrieves the consensus time. +// GetNextPayloadTimestamp retrieves the proposed next payload timestamp. func (b *SlotData[ AttestationDataT, SlashingInfoT, -]) GetConsensusTime() math.U64 { - return b.consensusTime +]) GetNextPayloadTimestamp() math.U64 { + return b.nextPayloadTimestamp } // SetAttestationData sets the attestation data of the SlotData. diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index 0d943ebc2a..819ed2fc39 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -83,7 +83,10 @@ type ( ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetConsensusTime() math.U64 + // GetNextPayloadTimestamp returns the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + GetNextPayloadTimestamp() math.U64 } // BeaconBlock represents a generic interface for a beacon block. diff --git a/mod/node-core/pkg/components/middleware.go b/mod/node-core/pkg/components/middleware.go index f49411d810..477eb9c9dc 100644 --- a/mod/node-core/pkg/components/middleware.go +++ b/mod/node-core/pkg/components/middleware.go @@ -26,6 +26,7 @@ import ( "github.com/berachain/beacon-kit/mod/log" "github.com/berachain/beacon-kit/mod/node-core/pkg/components/metrics" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + cmtcfg "github.com/cometbft/cometbft/config" ) // ABCIMiddlewareInput is the input for the validator middleware provider. @@ -36,6 +37,7 @@ type ABCIMiddlewareInput[ ] struct { depinject.In ChainSpec common.ChainSpec + CmtCfg *cmtcfg.Config Dispatcher Dispatcher Logger LoggerT TelemetrySink *metrics.TelemetrySink @@ -65,6 +67,7 @@ func ProvideABCIMiddleware[ *SlotData, ]( in.ChainSpec, + in.CmtCfg, in.Dispatcher, in.Logger, in.TelemetrySink, diff --git a/mod/primitives/pkg/transition/context.go b/mod/primitives/pkg/transition/context.go index da543c0fe1..771f9189ae 100644 --- a/mod/primitives/pkg/transition/context.go +++ b/mod/primitives/pkg/transition/context.go @@ -42,9 +42,10 @@ type Context struct { // SkipValidateResult indicates whether to validate the result of // the state transition. SkipValidateResult bool - // ConsensusTime is the network agreed time for the block causing the - // state transition to be performed - ConsensusTime math.U64 + // NextPayloadTimestamp is the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + NextPayloadTimestamp math.U64 } // GetOptimisticEngine returns whether to optimistically assume the execution @@ -72,10 +73,11 @@ func (c *Context) GetSkipValidateResult() bool { return c.SkipValidateResult } -// GetConsensusTime returns the consensus time for the block causing -// the state transition. -func (c *Context) GetConsensusTime() math.U64 { - return c.ConsensusTime +// GetNextPayloadTimestamp returns the timestamp proposed by consensus +// for the next payload to be proposed. It is also used to bound +// current payload upon validation. +func (c *Context) GetNextPayloadTimestamp() math.U64 { + return c.NextPayloadTimestamp } // Unwrap returns the underlying standard context. diff --git a/mod/state-transition/pkg/core/state_processor_payload.go b/mod/state-transition/pkg/core/state_processor_payload.go index b0bbb88157..d0d1ab51ef 100644 --- a/mod/state-transition/pkg/core/state_processor_payload.go +++ b/mod/state-transition/pkg/core/state_processor_payload.go @@ -51,7 +51,7 @@ func (sp *StateProcessor[ g.Go(func() error { return sp.validateExecutionPayload( gCtx, st, blk, - ctx.GetConsensusTime(), + ctx.GetNextPayloadTimestamp(), ctx.GetOptimisticEngine(), ) }) @@ -87,10 +87,10 @@ func (sp *StateProcessor[ ctx context.Context, st BeaconStateT, blk BeaconBlockT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, optimisticEngine bool, ) error { - if err := sp.validateStatelessPayload(blk, consensusTime); err != nil { + if err := sp.validateStatelessPayload(blk, nextPayloadTimestamp); err != nil { return err } return sp.validateStatefulPayload(ctx, st, blk, optimisticEngine) @@ -102,17 +102,16 @@ func (sp *StateProcessor[ _, _, _, _, _, _, _, _, _, _, _, _, _, ]) validateStatelessPayload( blk BeaconBlockT, - consensusTime math.U64, + nextPayloadTimestamp math.U64, ) error { body := blk.GetBody() payload := body.GetExecutionPayload() - timeBound := consensusTime + math.U64(sp.cs.TargetSecondsPerEth1Block()) - if pt := payload.GetTimestamp(); pt > timeBound { + if pt := payload.GetTimestamp(); pt > nextPayloadTimestamp { return errors.Wrapf( ErrTooFarInTheFuture, "payload timestamp, max: %d, got: %d", - timeBound, pt, + nextPayloadTimestamp, pt, ) } diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 99cdce7799..a186f4dc0e 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -118,9 +118,10 @@ type Context interface { // GetSkipValidateResult returns whether to validate the result of the state // transition. GetSkipValidateResult() bool - // GetConsensusTime returns the consensus time for the block causing - // the state transition. - GetConsensusTime() math.U64 + // GetNextPayloadTimestamp returns the timestamp proposed by + // consensus for the next payload to be proposed. It is also + // used to bound current payload upon validation + GetNextPayloadTimestamp() math.U64 } // Deposit is the interface for a deposit. From 6c256d4062a41116b355762c19d53e61ff0db81a Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 25 Oct 2024 22:27:53 +0200 Subject: [PATCH 25/51] fixed comment --- .../cometbft/service/middleware/middleware.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mod/consensus/pkg/cometbft/service/middleware/middleware.go b/mod/consensus/pkg/cometbft/service/middleware/middleware.go index e4e3dcd02e..594fd8930c 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/middleware.go +++ b/mod/consensus/pkg/cometbft/service/middleware/middleware.go @@ -80,15 +80,23 @@ func NewABCIMiddleware[ ) *ABCIMiddleware[ BeaconBlockT, BlobSidecarsT, GenesisT, SlotDataT, ] { - // We may build execution payload optimistically, i.e. build execution + // We may build execution payload optimistically (i.e. build the execution // payload for next block while current block is being verified and not yet - // finalized. Hence we need a minPayloadDelay that guarantees that: - // curr + // finalized) or not (build only after parent block has been finalized). + // Hence we need to guarantee that we provide to the execution layer a + // strictly increasing timestamp for any ABCI valid call sequence of + // Prepare/Propose/FinalizeBlock. + // To this purpose, we set next payload timestamp as follows: + // - ProposeBlock: req.Time + // - Prepare/FinalizeBlock: to req.Time + minPayloadDelay + // Monotonicity across request sequences is ensured by construction of + // minPayloadDelay: no block can be finalized before minPayloadDelay. minPayloadDelay := min( cmtCfg.Consensus.TimeoutPropose, cmtCfg.Consensus.TimeoutPrevote, cmtCfg.Consensus.TimeoutPrecommit, - cmtCfg.Consensus.TimeoutCommit, + // TimeoutCommit can be zero + max(cmtCfg.Consensus.TimeoutCommit, time.Second), ) return &ABCIMiddleware[ From f386d5138988a3e450900b39c0ae81ef7610f427 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 25 Oct 2024 22:38:06 +0200 Subject: [PATCH 26/51] nit to appease rabbit + revert faulty change --- mod/beacon/blockchain/execution_engine.go | 2 +- mod/consensus/pkg/cometbft/service/middleware/middleware.go | 2 +- mod/consensus/pkg/types/consensus_block.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index 252a62a1ff..6cd29fea9d 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -43,7 +43,7 @@ func (s *Service[ return } - if !s.shouldBuildOptimisticPayloads() { + if !s.shouldBuildOptimisticPayloads() && s.localBuilder.Enabled() { s.sendNextFCUWithAttributes(ctx, st, blk, lph) } else { s.sendNextFCUWithoutAttributes(ctx, blk, lph) diff --git a/mod/consensus/pkg/cometbft/service/middleware/middleware.go b/mod/consensus/pkg/cometbft/service/middleware/middleware.go index 594fd8930c..978115dfb0 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/middleware.go +++ b/mod/consensus/pkg/cometbft/service/middleware/middleware.go @@ -88,7 +88,7 @@ func NewABCIMiddleware[ // Prepare/Propose/FinalizeBlock. // To this purpose, we set next payload timestamp as follows: // - ProposeBlock: req.Time - // - Prepare/FinalizeBlock: to req.Time + minPayloadDelay + // - Prepare/FinalizeBlock: req.Time + minPayloadDelay // Monotonicity across request sequences is ensured by construction of // minPayloadDelay: no block can be finalized before minPayloadDelay. minPayloadDelay := min( diff --git a/mod/consensus/pkg/types/consensus_block.go b/mod/consensus/pkg/types/consensus_block.go index 7f16c0cfea..fab4c5fe1d 100644 --- a/mod/consensus/pkg/types/consensus_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -32,7 +32,7 @@ type ConsensusBlock[BeaconBlockT any] struct { nextPayloadTimestamp math.U64 } -// New creates a new SlotData instance. +// New creates a new ConsensusBlock instance. func (b *ConsensusBlock[BeaconBlockT]) New( beaconBlock BeaconBlockT, nextPayloadTimestamp time.Time, From b2bf298cff176087532d45bdae743d5f139f9360 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 25 Oct 2024 23:10:35 +0200 Subject: [PATCH 27/51] wip: added proposerAddress to consensus block --- mod/beacon/blockchain/types.go | 2 ++ mod/consensus/pkg/cometbft/service/middleware/abci.go | 2 ++ mod/consensus/pkg/types/consensus_block.go | 8 ++++++++ mod/node-core/pkg/components/interfaces.go | 2 ++ 4 files changed, 14 insertions(+) diff --git a/mod/beacon/blockchain/types.go b/mod/beacon/blockchain/types.go index 8a38d7a743..89b1653ef7 100644 --- a/mod/beacon/blockchain/types.go +++ b/mod/beacon/blockchain/types.go @@ -45,6 +45,8 @@ type AvailabilityStore[BeaconBlockBodyT any] interface { type ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT + GetProposerAddreess() []byte + // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also // used to bound current payload upon validation diff --git a/mod/consensus/pkg/cometbft/service/middleware/abci.go b/mod/consensus/pkg/cometbft/service/middleware/abci.go index cbf5ed68f9..63fe834404 100644 --- a/mod/consensus/pkg/cometbft/service/middleware/abci.go +++ b/mod/consensus/pkg/cometbft/service/middleware/abci.go @@ -224,6 +224,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, + req.GetProposerAddress(), req.GetTime().Add(h.minPayloadDelay), ) blkEvent := async.NewEvent(ctx, async.BeaconBlockReceived, enrichedBlk) @@ -341,6 +342,7 @@ func (h *ABCIMiddleware[ var enrichedBlk *types.ConsensusBlock[BeaconBlockT] enrichedBlk = enrichedBlk.New( blk, + req.GetProposerAddress(), req.GetTime().Add(h.minPayloadDelay), ) blkEvent := async.NewEvent(ctx, async.FinalBeaconBlockReceived, enrichedBlk) diff --git a/mod/consensus/pkg/types/consensus_block.go b/mod/consensus/pkg/types/consensus_block.go index fab4c5fe1d..666d0c5539 100644 --- a/mod/consensus/pkg/types/consensus_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -29,16 +29,20 @@ import ( type ConsensusBlock[BeaconBlockT any] struct { blk BeaconBlockT + proposerAddress []byte + nextPayloadTimestamp math.U64 } // New creates a new ConsensusBlock instance. func (b *ConsensusBlock[BeaconBlockT]) New( beaconBlock BeaconBlockT, + proposerAddress []byte, nextPayloadTimestamp time.Time, ) *ConsensusBlock[BeaconBlockT] { b = &ConsensusBlock[BeaconBlockT]{ blk: beaconBlock, + proposerAddress: proposerAddress, nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), } return b @@ -48,6 +52,10 @@ func (b *ConsensusBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { return b.blk } +func (b *ConsensusBlock[_]) GetProposerAddreess() []byte { + return b.proposerAddress +} + // GetNextPayloadTimestamp returns the timestamp proposed by consensus // for the next payload to be proposed. It is also used to bound // current payload upon validation. diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index 819ed2fc39..0a22f93f92 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -83,6 +83,8 @@ type ( ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT + GetProposerAddreess() []byte + // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also // used to bound current payload upon validation From 08f00c2265ad7ddb0eb96c2f584cf156e1ed8df7 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 25 Oct 2024 23:33:44 +0200 Subject: [PATCH 28/51] wip: added proposerAddress to slot data --- mod/beacon/blockchain/process.go | 1 + mod/beacon/blockchain/receive.go | 1 + mod/beacon/blockchain/types.go | 2 +- mod/beacon/validator/block_builder.go | 12 +++- mod/beacon/validator/types.go | 1 + mod/consensus/pkg/cometbft/service/abci.go | 1 + mod/consensus/pkg/types/common.go | 40 +++++++++++ mod/consensus/pkg/types/consensus_block.go | 23 ++---- mod/consensus/pkg/types/slot_data.go | 26 +++---- mod/node-core/pkg/components/interfaces.go | 2 +- mod/primitives/pkg/transition/context.go | 2 + .../pkg/core/state_processor.go | 72 +++++++++---------- 12 files changed, 109 insertions(+), 74 deletions(-) create mode 100644 mod/consensus/pkg/types/common.go diff --git a/mod/beacon/blockchain/process.go b/mod/beacon/blockchain/process.go index 99936c72ed..043bba4971 100644 --- a/mod/beacon/blockchain/process.go +++ b/mod/beacon/blockchain/process.go @@ -128,6 +128,7 @@ func (s *Service[ // actually irrelevant at this point. SkipPayloadVerification: false, + ProposerAddress: blk.GetProposerAddress(), NextPayloadTimestamp: blk.GetNextPayloadTimestamp(), }, st, diff --git a/mod/beacon/blockchain/receive.go b/mod/beacon/blockchain/receive.go index 3066913eaf..5b2fde8f18 100644 --- a/mod/beacon/blockchain/receive.go +++ b/mod/beacon/blockchain/receive.go @@ -128,6 +128,7 @@ func (s *Service[ SkipPayloadVerification: false, SkipValidateResult: false, SkipValidateRandao: false, + ProposerAddress: blk.GetProposerAddress(), NextPayloadTimestamp: blk.GetNextPayloadTimestamp(), }, st, blk.GetBeaconBlock(), diff --git a/mod/beacon/blockchain/types.go b/mod/beacon/blockchain/types.go index 89b1653ef7..de6abfbb44 100644 --- a/mod/beacon/blockchain/types.go +++ b/mod/beacon/blockchain/types.go @@ -45,7 +45,7 @@ type AvailabilityStore[BeaconBlockBodyT any] interface { type ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetProposerAddreess() []byte + GetProposerAddress() []byte // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index c09d04df25..64b9737a94 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -114,6 +114,7 @@ func (s *Service[ g.Go(func() error { return s.computeAndSetStateRoot( ctx, + slotData.GetProposerAddress(), slotData.GetNextPayloadTimestamp(), st, blk, @@ -336,11 +337,18 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeAndSetStateRoot( ctx context.Context, + proposerAddress []byte, nextPayloadTimestamp math.U64, st BeaconStateT, blk BeaconBlockT, ) error { - stateRoot, err := s.computeStateRoot(ctx, nextPayloadTimestamp, st, blk) + stateRoot, err := s.computeStateRoot( + ctx, + proposerAddress, + nextPayloadTimestamp, + st, + blk, + ) if err != nil { s.logger.Error( "failed to compute state root while building block ❗️ ", @@ -358,6 +366,7 @@ func (s *Service[ _, BeaconBlockT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, ]) computeStateRoot( ctx context.Context, + proposerAddress []byte, nextPayloadTimestamp math.U64, st BeaconStateT, blk BeaconBlockT, @@ -374,6 +383,7 @@ func (s *Service[ SkipPayloadVerification: true, SkipValidateResult: true, SkipValidateRandao: true, + ProposerAddress: proposerAddress, NextPayloadTimestamp: nextPayloadTimestamp, }, st, blk, diff --git a/mod/beacon/validator/types.go b/mod/beacon/validator/types.go index c327753707..f823138485 100644 --- a/mod/beacon/validator/types.go +++ b/mod/beacon/validator/types.go @@ -190,6 +190,7 @@ type SlotData[AttestationDataT, SlashingInfoT any] interface { GetAttestationData() []AttestationDataT // GetSlashingInfo returns the slashing info of the incoming slot. GetSlashingInfo() []SlashingInfoT + GetProposerAddress() []byte // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also // used to bound current payload upon validation diff --git a/mod/consensus/pkg/cometbft/service/abci.go b/mod/consensus/pkg/cometbft/service/abci.go index 3ec7fb4df0..ddbd1bf875 100644 --- a/mod/consensus/pkg/cometbft/service/abci.go +++ b/mod/consensus/pkg/cometbft/service/abci.go @@ -212,6 +212,7 @@ func (s *Service[LoggerT]) PrepareProposal( math.Slot(req.GetHeight()), nil, nil, + req.GetProposerAddress(), // we do not add h.minPayloadDelay here since req.GetTime() // is guaranteed to be strictly larger than diff --git a/mod/consensus/pkg/types/common.go b/mod/consensus/pkg/types/common.go new file mode 100644 index 0000000000..3e167e26b6 --- /dev/null +++ b/mod/consensus/pkg/types/common.go @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package types + +import "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + +type commonConsensusData struct { + proposerAddress []byte + + nextPayloadTimestamp math.U64 +} + +func (c *commonConsensusData) GetProposerAddress() []byte { + return c.proposerAddress +} + +// GetNextPayloadTimestamp returns the timestamp proposed by consensus +// for the next payload to be proposed. It is also used to bound +// current payload upon validation. +func (c *commonConsensusData) GetNextPayloadTimestamp() math.U64 { + return c.nextPayloadTimestamp +} diff --git a/mod/consensus/pkg/types/consensus_block.go b/mod/consensus/pkg/types/consensus_block.go index 666d0c5539..3a5036efbe 100644 --- a/mod/consensus/pkg/types/consensus_block.go +++ b/mod/consensus/pkg/types/consensus_block.go @@ -29,9 +29,7 @@ import ( type ConsensusBlock[BeaconBlockT any] struct { blk BeaconBlockT - proposerAddress []byte - - nextPayloadTimestamp math.U64 + *commonConsensusData } // New creates a new ConsensusBlock instance. @@ -41,9 +39,11 @@ func (b *ConsensusBlock[BeaconBlockT]) New( nextPayloadTimestamp time.Time, ) *ConsensusBlock[BeaconBlockT] { b = &ConsensusBlock[BeaconBlockT]{ - blk: beaconBlock, - proposerAddress: proposerAddress, - nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), + blk: beaconBlock, + commonConsensusData: &commonConsensusData{ + proposerAddress: proposerAddress, + nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), + }, } return b } @@ -51,14 +51,3 @@ func (b *ConsensusBlock[BeaconBlockT]) New( func (b *ConsensusBlock[BeaconBlockT]) GetBeaconBlock() BeaconBlockT { return b.blk } - -func (b *ConsensusBlock[_]) GetProposerAddreess() []byte { - return b.proposerAddress -} - -// GetNextPayloadTimestamp returns the timestamp proposed by consensus -// for the next payload to be proposed. It is also used to bound -// current payload upon validation. -func (b *ConsensusBlock[_]) GetNextPayloadTimestamp() math.U64 { - return b.nextPayloadTimestamp -} diff --git a/mod/consensus/pkg/types/slot_data.go b/mod/consensus/pkg/types/slot_data.go index c6acd77323..f7c1fe1376 100644 --- a/mod/consensus/pkg/types/slot_data.go +++ b/mod/consensus/pkg/types/slot_data.go @@ -34,10 +34,8 @@ type SlotData[AttestationDataT, SlashingInfoT any] struct { attestationData []AttestationDataT // slashingInfo is the slashing info of the incoming slot. slashingInfo []SlashingInfoT - // nextPayloadTimestamp is the timestamp proposed by - // consensus for the next payload to be proposed. It is also - // used to bound current payload upon validation - nextPayloadTimestamp math.U64 + + *commonConsensusData } // New creates a new SlotData instance. @@ -45,13 +43,17 @@ func (b *SlotData[AttestationDataT, SlashingInfoT]) New( slot math.Slot, attestationData []AttestationDataT, slashingInfo []SlashingInfoT, + proposerAddress []byte, nextPayloadTimestamp time.Time, ) *SlotData[AttestationDataT, SlashingInfoT] { b = &SlotData[AttestationDataT, SlashingInfoT]{ - slot: slot, - attestationData: attestationData, - slashingInfo: slashingInfo, - nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), + slot: slot, + attestationData: attestationData, + slashingInfo: slashingInfo, + commonConsensusData: &commonConsensusData{ + proposerAddress: proposerAddress, + nextPayloadTimestamp: math.U64(nextPayloadTimestamp.Unix()), + }, } return b } @@ -77,14 +79,6 @@ func (b *SlotData[ return b.slashingInfo } -// GetNextPayloadTimestamp retrieves the proposed next payload timestamp. -func (b *SlotData[ - AttestationDataT, - SlashingInfoT, -]) GetNextPayloadTimestamp() math.U64 { - return b.nextPayloadTimestamp -} - // SetAttestationData sets the attestation data of the SlotData. func (b *SlotData[AttestationDataT, SlashingInfoT]) SetAttestationData( attestationData []AttestationDataT, diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index 0a22f93f92..28a118993e 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -83,7 +83,7 @@ type ( ConsensusBlock[BeaconBlockT any] interface { GetBeaconBlock() BeaconBlockT - GetProposerAddreess() []byte + GetProposerAddress() []byte // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also diff --git a/mod/primitives/pkg/transition/context.go b/mod/primitives/pkg/transition/context.go index 771f9189ae..9cda65bffb 100644 --- a/mod/primitives/pkg/transition/context.go +++ b/mod/primitives/pkg/transition/context.go @@ -42,6 +42,8 @@ type Context struct { // SkipValidateResult indicates whether to validate the result of // the state transition. SkipValidateResult bool + // Address of current block proposer + ProposerAddress []byte // NextPayloadTimestamp is the timestamp proposed by // consensus for the next payload to be proposed. It is also // used to bound current payload upon validation diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 05c1a188df..1b1d8bb729 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -349,18 +349,12 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { - var ( - slot math.Slot - err error - latestBlockHeader BeaconBlockHeaderT - - proposer ValidatorT - ) - // Ensure the block slot matches the state slot. - if slot, err = st.GetSlot(); err != nil { + slot, err := st.GetSlot() + if err != nil { return err - } else if blk.GetSlot() != slot { + } + if blk.GetSlot() != slot { return errors.Wrapf( ErrSlotMismatch, "expected: %d, got: %d", @@ -369,23 +363,38 @@ func (sp *StateProcessor[ } // Verify the parent block root is correct. - if latestBlockHeader, err = st.GetLatestBlockHeader(); err != nil { + latestBlockHeader, err := st.GetLatestBlockHeader() + if err != nil { return err - } else if blk.GetSlot() <= latestBlockHeader.GetSlot() { + } + if blk.GetSlot() <= latestBlockHeader.GetSlot() { return errors.Wrapf( ErrBlockSlotTooLow, "expected: > %d, got: %d", latestBlockHeader.GetSlot(), blk.GetSlot(), ) } - if parentBlockRoot := latestBlockHeader. - HashTreeRoot(); parentBlockRoot != blk.GetParentBlockRoot() { + parentBlockRoot := latestBlockHeader.HashTreeRoot() + if parentBlockRoot != blk.GetParentBlockRoot() { return errors.Wrapf(ErrParentRootMismatch, "expected: %s, got: %s", parentBlockRoot.String(), blk.GetParentBlockRoot().String(), ) } + // Check to make sure the proposer isn't slashed. + proposer, err := st.ValidatorByIndex(blk.GetProposerIndex()) + if err != nil { + return err + } + if proposer.IsSlashed() { + return errors.Wrapf( + ErrSlashedProposer, + "index: %d", + blk.GetProposerIndex(), + ) + } + // Ensure the block is within the acceptable range. // TODO: move this is in the wrong spot. deposits := blk.GetBody().GetDeposits() @@ -397,31 +406,18 @@ func (sp *StateProcessor[ } // Calculate the body root to place on the header. - var lbh BeaconBlockHeaderT bodyRoot := blk.GetBody().HashTreeRoot() - if err = st.SetLatestBlockHeader( - lbh.New( - blk.GetSlot(), - blk.GetProposerIndex(), - blk.GetParentBlockRoot(), - // state_root is zeroed and overwritten - // in the next `process_slot` call. - common.Root{}, - bodyRoot, - ), - ); err != nil { - return err - } - - // Check to make sure the proposer isn't slashed. - if proposer, err = st.ValidatorByIndex(blk.GetProposerIndex()); err != nil { - return err - } else if proposer.IsSlashed() { - return errors.Wrapf( - ErrSlashedProposer, "index: %d", blk.GetProposerIndex(), - ) - } - return nil + var lbh BeaconBlockHeaderT + lbh = lbh.New( + blk.GetSlot(), + blk.GetProposerIndex(), + blk.GetParentBlockRoot(), + // state_root is zeroed and overwritten + // in the next `process_slot` call. + common.Root{}, + bodyRoot, + ) + return st.SetLatestBlockHeader(lbh) } // getAttestationDeltas as defined in the Ethereum 2.0 specification. From 3ee634dbe85679865c5052a9449731b55a58d9aa Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 26 Oct 2024 00:01:21 +0200 Subject: [PATCH 29/51] nit --- mod/primitives/pkg/crypto/bls.go | 13 +++--------- .../pkg/core/state_processor.go | 20 ++++++++----------- .../pkg/core/state_processor_randao.go | 6 +++--- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/mod/primitives/pkg/crypto/bls.go b/mod/primitives/pkg/crypto/bls.go index cc148ec47c..3d450650a2 100644 --- a/mod/primitives/pkg/crypto/bls.go +++ b/mod/primitives/pkg/crypto/bls.go @@ -22,16 +22,9 @@ package crypto import "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" -const ( - // CometBLSType is the BLS curve type used in the Comet BFT consensus - // algorithm. - CometBLSType = "bls12_381" - - // CometBLSPower is the voting power given to a validator when they - // are in the active set. - // TODO: Move this, it doesn't really belong here. - CometBLSPower = 1e10 -) +// CometBLSType is the BLS curve type used in the Comet BFT consensus +// algorithm. +const CometBLSType = "bls12_381" //nolint:lll // link. type ( diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 1b1d8bb729..49216f6e74 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -278,29 +278,22 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { - // process the freshly created header. - if err := sp.processBlockHeader(st, blk); err != nil { + if err := sp.processBlockHeader(ctx, st, blk); err != nil { return err } - // process the execution payload. if err := sp.processExecutionPayload(ctx, st, blk); err != nil { return err } - // process the withdrawals. if err := sp.processWithdrawals(st, blk.GetBody()); err != nil { return err } - // process the randao reveal. - if err := sp.processRandaoReveal( - st, blk, ctx.GetSkipValidateRandao(), - ); err != nil { + if err := sp.processRandaoReveal(ctx, st, blk); err != nil { return err } - // process the deposits and ensure they match the local state. if err := sp.processOperations(st, blk); err != nil { return err } @@ -332,9 +325,11 @@ func (sp *StateProcessor[ ) (transition.ValidatorUpdates, error) { if err := sp.processRewardsAndPenalties(st); err != nil { return nil, err - } else if err = sp.processSlashingsReset(st); err != nil { + } + if err := sp.processSlashingsReset(st); err != nil { return nil, err - } else if err = sp.processRandaoMixesReset(st); err != nil { + } + if err := sp.processRandaoMixesReset(st); err != nil { return nil, err } return sp.processSyncCommitteeUpdates(st) @@ -344,8 +339,9 @@ func (sp *StateProcessor[ // state. func (sp *StateProcessor[ BeaconBlockT, _, BeaconBlockHeaderT, BeaconStateT, - _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, + ContextT, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, ]) processBlockHeader( + _ ContextT, st BeaconStateT, blk BeaconBlockT, ) error { diff --git a/mod/state-transition/pkg/core/state_processor_randao.go b/mod/state-transition/pkg/core/state_processor_randao.go index ff7bf3ba9e..7d0be4494b 100644 --- a/mod/state-transition/pkg/core/state_processor_randao.go +++ b/mod/state-transition/pkg/core/state_processor_randao.go @@ -33,11 +33,11 @@ import ( // ensures it matches the local state. func (sp *StateProcessor[ BeaconBlockT, _, _, BeaconStateT, - _, _, _, _, _, _, ForkDataT, _, _, _, _, _, _, + ContextT, _, _, _, _, _, ForkDataT, _, _, _, _, _, _, ]) processRandaoReveal( + ctx ContextT, st BeaconStateT, blk BeaconBlockT, - skipVerification bool, ) error { slot, err := st.GetSlot() if err != nil { @@ -65,7 +65,7 @@ func (sp *StateProcessor[ ), genesisValidatorsRoot, ) - if !skipVerification { + if !ctx.GetSkipValidateRandao() { signingRoot := fd.ComputeRandaoSigningRoot( sp.cs.DomainTypeRandao(), epoch, ) From e66ef6ce5614e35f011eab4112d9ac6fa66ba8b7 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 26 Oct 2024 00:33:53 +0200 Subject: [PATCH 30/51] hardened check --- mod/state-transition/pkg/core/state_processor_payload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/state_processor_payload.go b/mod/state-transition/pkg/core/state_processor_payload.go index d0d1ab51ef..a1cfd02234 100644 --- a/mod/state-transition/pkg/core/state_processor_payload.go +++ b/mod/state-transition/pkg/core/state_processor_payload.go @@ -107,7 +107,7 @@ func (sp *StateProcessor[ body := blk.GetBody() payload := body.GetExecutionPayload() - if pt := payload.GetTimestamp(); pt > nextPayloadTimestamp { + if pt := payload.GetTimestamp(); pt >= nextPayloadTimestamp { return errors.Wrapf( ErrTooFarInTheFuture, "payload timestamp, max: %d, got: %d", From d4779f965e110b41293eea5d4379f8e2b8978487 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 26 Oct 2024 01:17:03 +0200 Subject: [PATCH 31/51] wip: adding validation --- mod/primitives/pkg/crypto/bls.go | 15 ++++++++++++++- mod/primitives/pkg/transition/context.go | 4 ++++ mod/state-transition/pkg/core/errors.go | 2 ++ mod/state-transition/pkg/core/state_processor.go | 13 ++++++++++++- mod/state-transition/pkg/core/types.go | 1 + 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/mod/primitives/pkg/crypto/bls.go b/mod/primitives/pkg/crypto/bls.go index 3d450650a2..a568de650f 100644 --- a/mod/primitives/pkg/crypto/bls.go +++ b/mod/primitives/pkg/crypto/bls.go @@ -20,7 +20,12 @@ package crypto -import "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" +import ( + "fmt" + + "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" + cometencoding "github.com/cometbft/cometbft/crypto/encoding" +) // CometBLSType is the BLS curve type used in the Comet BFT consensus // algorithm. @@ -37,6 +42,14 @@ type ( BLSSignature = bytes.B96 ) +func GetAddressFromPubKey(pubKey BLSPubkey) ([]byte, error) { + pk, err := cometencoding.PubKeyFromTypeAndBytes(CometBLSType, pubKey[:]) + if err != nil { + return nil, fmt.Errorf("failed retrieving pubKey from bytes: %w", err) + } + return pk.Address(), nil +} + // BLSSigner defines an interface for cryptographic signing operations. // It uses generic type parameters Signature and Pubkey, both of which are // slices of bytes. diff --git a/mod/primitives/pkg/transition/context.go b/mod/primitives/pkg/transition/context.go index 9cda65bffb..9687e06f42 100644 --- a/mod/primitives/pkg/transition/context.go +++ b/mod/primitives/pkg/transition/context.go @@ -75,6 +75,10 @@ func (c *Context) GetSkipValidateResult() bool { return c.SkipValidateResult } +func (c *Context) GetProposerAddress() []byte { + return c.ProposerAddress +} + // GetNextPayloadTimestamp returns the timestamp proposed by consensus // for the next payload to be proposed. It is also used to bound // current payload upon validation. diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index 9940eb519c..a0e2160ac8 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -30,6 +30,8 @@ var ( // match the expected value. ErrSlotMismatch = errors.New("slot mismatch") + ErrProposerMismatch = errors.New("proposer key mismatch") + // ErrParentRootMismatch is returned when the parent root in an execution // payload does not match the expected value. ErrParentRootMismatch = errors.New("parent root mismatch") diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 49216f6e74..244464a05c 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -341,7 +341,7 @@ func (sp *StateProcessor[ BeaconBlockT, _, BeaconBlockHeaderT, BeaconStateT, ContextT, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, ]) processBlockHeader( - _ ContextT, + ctx ContextT, st BeaconStateT, blk BeaconBlockT, ) error { @@ -383,6 +383,17 @@ func (sp *StateProcessor[ if err != nil { return err } + stateProposerAddress, err := crypto.GetAddressFromPubKey(proposer.GetPubkey()) + if err != nil { + return err + } + if !bytes.Equal(stateProposerAddress, ctx.GetProposerAddress()) { + return errors.Wrapf( + ErrProposerMismatch, "store key: %s, consensus key: %s", + stateProposerAddress, ctx.GetProposerAddress(), + ) + } + if proposer.IsSlashed() { return errors.Wrapf( ErrSlashedProposer, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index a186f4dc0e..7ab7c52a97 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -118,6 +118,7 @@ type Context interface { // GetSkipValidateResult returns whether to validate the result of the state // transition. GetSkipValidateResult() bool + GetProposerAddress() []byte // GetNextPayloadTimestamp returns the timestamp proposed by // consensus for the next payload to be proposed. It is also // used to bound current payload upon validation From f4a7d795e9d0c005617fc8a4fc6f31c12de3ed4e Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 15:45:26 +0100 Subject: [PATCH 32/51] wip: adding UTs to state transition package --- .../pkg/core/state_processor_genesis_test.go | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 mod/state-transition/pkg/core/state_processor_genesis_test.go diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go new file mode 100644 index 0000000000..cc30205815 --- /dev/null +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package core_test + +import ( + "testing" + + "github.com/berachain/beacon-kit/mod/config/pkg/spec" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" + "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" +) + +type ( + TestBeaconStateMarshallableT = types.BeaconState[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.BeaconBlockHeader, + types.Eth1Data, + types.ExecutionPayloadHeader, + types.Fork, + types.Validator, + ] + + TestKVStoreT = beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ] + + TestBeaconStateT = statedb.StateDB[ + *types.BeaconBlockHeader, + *TestBeaconStateMarshallableT, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + types.WithdrawalCredentials, + ] +) + +func TestInitialize(t *testing.T) { + cs := spec.TestnetChainSpec() + // in.ExecutionEngine, + mocksSigner := &mocks.BLSSigner{} + + _ = core.NewStateProcessor[ + *types.BeaconBlock, + *types.BeaconBlockBody, + *types.BeaconBlockHeader, + *TestBeaconStateT, + + *transition.Context, + *types.Deposit, + *types.Eth1Data, + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.ForkData, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + engineprimitives.Withdrawals, + types.WithdrawalCredentials, + ]( + cs, + nil, + mocksSigner, + ) + + // vals, err := sp.InitializePreminedBeaconStateFromEth1() + // require.NoError(t, err) + + // This is not the right assert, just want to get to compile + // require.Empty(t, vals) + +} From 0f461722ebcd59cbf8cfa935b9cd28fc37503a56 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 17:17:16 +0100 Subject: [PATCH 33/51] wip: completed simple UT for state transition package --- .../pkg/core/state_processor_genesis_test.go | 120 +++++++++++++++++- 1 file changed, 114 insertions(+), 6 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index cc30205815..4184c762e1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -21,16 +21,33 @@ package core_test import ( + "context" + "fmt" "testing" + corestore "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" + "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" + "github.com/berachain/beacon-kit/mod/storage/pkg/db" + "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" + dbm "github.com/cosmos/cosmos-db" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" ) type ( @@ -75,12 +92,11 @@ func TestInitialize(t *testing.T) { // in.ExecutionEngine, mocksSigner := &mocks.BLSSigner{} - _ = core.NewStateProcessor[ + sp := core.NewStateProcessor[ *types.BeaconBlock, *types.BeaconBlockBody, *types.BeaconBlockHeader, *TestBeaconStateT, - *transition.Context, *types.Deposit, *types.Eth1Data, @@ -100,10 +116,102 @@ func TestInitialize(t *testing.T) { mocksSigner, ) - // vals, err := sp.InitializePreminedBeaconStateFromEth1() - // require.NoError(t, err) + kvStore, err := initTestStore() + require.NoError(t, err) + + var ( + beaconState = new(TestBeaconStateT).NewFromDB(kvStore, cs) + deposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x01}, + Amount: math.Gwei(1_000), + Index: uint64(0), + }, + { + Pubkey: [48]byte{0x02}, + Amount: math.Gwei(2_000), + Index: uint64(1), + }, + } + executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genesisVersion = version.FromUint32[common.Version](version.Deneb) + ) + + mocksSigner.On( + "VerifySignature", + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(nil) + + vals, err := sp.InitializePreminedBeaconStateFromEth1( + beaconState, + deposits, + executionPayloadHeader, + genesisVersion, + ) + require.NoError(t, err) + require.Len(t, vals, len(deposits)) +} + +// Unit tests helpers + +type testKVStoreService struct { + ctx sdk.Context +} + +func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { + //nolint:contextcheck // fine with tests + return components.NewKVStore( + sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), + ) +} + +var ( + testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") + testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} +) + +func initTestStore() ( + *beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ], error) { + db, err := db.OpenDB("", dbm.MemDBBackend) + if err != nil { + return nil, fmt.Errorf("failed opening mem db: %w", err) + } + var ( + nopLog = log.NewNopLogger() + nopMetrics = metrics.NewNoOpMetrics() + ) + + cms := store.NewCommitMultiStore( + db, + nopLog, + nopMetrics, + ) - // This is not the right assert, just want to get to compile - // require.Empty(t, vals) + ctx := sdk.NewContext(cms, true, nopLog) + cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) + if err = cms.LoadLatestVersion(); err != nil { + return nil, fmt.Errorf("failed to load latest version: %w", err) + } + testStoreService := &testKVStoreService{ctx: ctx} + return beacondb.New[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ]( + testStoreService, + testCodec, + ), nil } From 22c7717d0648daf68814321d0f1e9d0fb826da29 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 22:07:41 +0100 Subject: [PATCH 34/51] wip: minimal execution engine stub --- mod/state-transition/pkg/core/helpers_test.go | 113 ++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 78 +----------- 2 files changed, 115 insertions(+), 76 deletions(-) create mode 100644 mod/state-transition/pkg/core/helpers_test.go diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go new file mode 100644 index 0000000000..1631830784 --- /dev/null +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package core_test + +import ( + "context" + "fmt" + + corestore "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" + "github.com/berachain/beacon-kit/mod/storage/pkg/db" + "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" + dbm "github.com/cosmos/cosmos-db" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// TODO: replace with proper mock +type testExecutionEngine struct{} + +func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( + _ context.Context, + _ *engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ], +) error { + return nil +} + +type testKVStoreService struct { + ctx sdk.Context +} + +func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { + //nolint:contextcheck // fine with tests + return components.NewKVStore( + sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), + ) +} + +var ( + testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") + testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} +) + +func initTestStore() ( + *beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ], error) { + db, err := db.OpenDB("", dbm.MemDBBackend) + if err != nil { + return nil, fmt.Errorf("failed opening mem db: %w", err) + } + var ( + nopLog = log.NewNopLogger() + nopMetrics = metrics.NewNoOpMetrics() + ) + + cms := store.NewCommitMultiStore( + db, + nopLog, + nopMetrics, + ) + + ctx := sdk.NewContext(cms, true, nopLog) + cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) + if err = cms.LoadLatestVersion(); err != nil { + return nil, fmt.Errorf("failed to load latest version: %w", err) + } + testStoreService := &testKVStoreService{ctx: ctx} + + return beacondb.New[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ]( + testStoreService, + testCodec, + ), nil +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 4184c762e1..d27efca6a1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -21,19 +21,11 @@ package core_test import ( - "context" - "fmt" "testing" - corestore "cosmossdk.io/core/store" - "cosmossdk.io/log" - "cosmossdk.io/store" - "cosmossdk.io/store/metrics" - storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - "github.com/berachain/beacon-kit/mod/node-core/pkg/components" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -42,10 +34,6 @@ import ( "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" - "github.com/berachain/beacon-kit/mod/storage/pkg/db" - "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" - dbm "github.com/cosmos/cosmos-db" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) @@ -89,7 +77,7 @@ type ( func TestInitialize(t *testing.T) { cs := spec.TestnetChainSpec() - // in.ExecutionEngine, + execEngine := &testExecutionEngine{} mocksSigner := &mocks.BLSSigner{} sp := core.NewStateProcessor[ @@ -112,7 +100,7 @@ func TestInitialize(t *testing.T) { types.WithdrawalCredentials, ]( cs, - nil, + execEngine, mocksSigner, ) @@ -153,65 +141,3 @@ func TestInitialize(t *testing.T) { require.NoError(t, err) require.Len(t, vals, len(deposits)) } - -// Unit tests helpers - -type testKVStoreService struct { - ctx sdk.Context -} - -func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { - //nolint:contextcheck // fine with tests - return components.NewKVStore( - sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), - ) -} - -var ( - testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") - testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} -) - -func initTestStore() ( - *beacondb.KVStore[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ], error) { - db, err := db.OpenDB("", dbm.MemDBBackend) - if err != nil { - return nil, fmt.Errorf("failed opening mem db: %w", err) - } - var ( - nopLog = log.NewNopLogger() - nopMetrics = metrics.NewNoOpMetrics() - ) - - cms := store.NewCommitMultiStore( - db, - nopLog, - nopMetrics, - ) - - ctx := sdk.NewContext(cms, true, nopLog) - cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) - if err = cms.LoadLatestVersion(); err != nil { - return nil, fmt.Errorf("failed to load latest version: %w", err) - } - testStoreService := &testKVStoreService{ctx: ctx} - - return beacondb.New[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ]( - testStoreService, - testCodec, - ), nil -} From 05cba8072be6c116b7a733f881653316053056e4 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 22:15:12 +0100 Subject: [PATCH 35/51] extended asserts --- .../pkg/core/state_processor_genesis_test.go | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index d27efca6a1..88450c897b 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -27,6 +27,7 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" @@ -76,6 +77,7 @@ type ( ) func TestInitialize(t *testing.T) { + // Create state processor to test cs := spec.TestnetChainSpec() execEngine := &testExecutionEngine{} mocksSigner := &mocks.BLSSigner{} @@ -104,6 +106,7 @@ func TestInitialize(t *testing.T) { mocksSigner, ) + // create test inputs kvStore, err := initTestStore() require.NoError(t, err) @@ -112,12 +115,12 @@ func TestInitialize(t *testing.T) { deposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(1_000), + Amount: math.Gwei(cs.MaxEffectiveBalance()), Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(2_000), + Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), Index: uint64(1), }, } @@ -125,19 +128,49 @@ func TestInitialize(t *testing.T) { genesisVersion = version.FromUint32[common.Version](version.Deneb) ) + // define mocks expectations mocksSigner.On( "VerifySignature", - mock.Anything, - mock.Anything, - mock.Anything, + mock.Anything, mock.Anything, mock.Anything, ).Return(nil) + // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, deposits, executionPayloadHeader, genesisVersion, ) + + // check outputs require.NoError(t, err) require.Len(t, vals, len(deposits)) + + // check beacon state changes + resSlot, err := beaconState.GetSlot() + require.NoError(t, err) + require.Equal(t, math.Slot(0), resSlot) + + resFork, err := beaconState.GetFork() + require.NoError(t, err) + require.Equal(t, + &types.Fork{ + PreviousVersion: genesisVersion, + CurrentVersion: genesisVersion, + Epoch: math.Epoch(constants.GenesisEpoch), + }, + resFork) + + for _, dep := range deposits { + var idx math.U64 + idx, err = beaconState.ValidatorIndexByPubkey(dep.Pubkey) + require.NoError(t, err) + require.Equal(t, math.U64(dep.Index), idx) + + var val *types.Validator + val, err = beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, dep.Pubkey, val.Pubkey) + require.Equal(t, dep.Amount, val.EffectiveBalance) + } } From 443ac1b524ff4bf2bb79fa61485a7414cf566930 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 23:40:42 +0100 Subject: [PATCH 36/51] added test case --- .../pkg/core/state_processor_genesis_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 88450c897b..a37cca2a1e 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -123,6 +123,11 @@ func TestInitialize(t *testing.T) { Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), Index: uint64(1), }, + { + Pubkey: [48]byte{0x03}, + Amount: math.Gwei(cs.EffectiveBalanceIncrement()), + Index: uint64(2), + }, } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genesisVersion = version.FromUint32[common.Version](version.Deneb) From 10efd5ebef93349d9e2096c4e1a16be3fc91c389 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 23:51:17 +0100 Subject: [PATCH 37/51] nits --- .../pkg/core/state_processor_staking.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a98def71a3..fc336908da 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -131,12 +131,6 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - var ( - genesisValidatorsRoot common.Root - epoch math.Epoch - err error - ) - // Get the current slot. slot, err := st.GetSlot() if err != nil { @@ -144,9 +138,8 @@ func (sp *StateProcessor[ } // At genesis, the validators sign over an empty root. - if slot == 0 { - genesisValidatorsRoot = common.Root{} - } else { + genesisValidatorsRoot := common.Root{} + if slot != 0 { // Get the genesis validators root to be used to find fork data later. genesisValidatorsRoot, err = st.GetGenesisValidatorsRoot() if err != nil { @@ -155,7 +148,7 @@ func (sp *StateProcessor[ } // Get the current epoch. - epoch = sp.cs.SlotToEpoch(slot) + epoch := sp.cs.SlotToEpoch(slot) // Verify that the message was signed correctly. var d ForkDataT @@ -192,7 +185,6 @@ func (sp *StateProcessor[ ) // TODO: This is a bug that lives on bArtio. Delete this eventually. - const bArtioChainID = 80084 if sp.cs.DepositEth1ChainID() == bArtioChainID { if err := st.AddValidatorBartio(val); err != nil { return err From 099716dbbf3b190b5622493a85a3279fd3b27821 Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 12:22:16 +0530 Subject: [PATCH 38/51] tests for helpers in state transition using mock Signed-off-by: nidhi-singh02 --- .mockery.yaml | 5 + .../pkg/types/deposit_message_test.go | 2 +- .../mocks/blobs_bundle.mock.go | 13 +- .../mocks/built_execution_payload_env.mock.go | 16 +- .../backend/mocks/availability_store.mock.go | 24 +- .../backend/mocks/beacon_block_header.mock.go | 38 +- .../backend/mocks/beacon_state.mock.go | 164 +- .../backend/mocks/block_store.mock.go | 42 +- .../backend/mocks/state_processor.mock.go | 16 +- mod/node-api/backend/mocks/validator.mock.go | 28 +- mod/node-api/backend/mocks/withdrawal.mock.go | 14 +- .../pkg/crypto/mocks/bls_signer.mock.go | 66 +- mod/state-transition/pkg/core/helpers_test.go | 43 +- .../pkg/core/mocks/beacon_block.mock.go | 313 +++ .../pkg/core/mocks/beacon_block_body.mock.go | 320 +++ .../core/mocks/beacon_block_header.mock.go | 399 +++ .../pkg/core/mocks/beacon_state.mock.go | 2395 +++++++++++++++++ .../pkg/core/mocks/context.mock.go | 411 +++ .../pkg/core/mocks/deposit.mock.go | 225 ++ .../pkg/core/mocks/execution_engine.mock.go | 86 + .../pkg/core/mocks/execution_payload.mock.go | 1122 ++++++++ .../mocks/execution_payload_header.mock.go | 83 + .../pkg/core/mocks/fork_data.mock.go | 134 + .../core/mocks/read_only_beacon_state.mock.go | 1326 +++++++++ .../core/mocks/read_only_eth_1_data.mock.go | 197 ++ .../core/mocks/read_only_randao_mixes.mock.go | 94 + .../core/mocks/read_only_state_roots.mock.go | 94 + .../core/mocks/read_only_validators.mock.go | 149 + .../core/mocks/read_only_withdrawals.mock.go | 89 + .../pkg/core/mocks/validator.mock.go | 500 ++++ .../pkg/core/mocks/validators.mock.go | 83 + .../pkg/core/mocks/withdrawal.mock.go | 266 ++ .../core/mocks/withdrawals_constraint.mock.go | 115 + .../mocks/write_only_beacon_state.mock.go | 919 +++++++ .../core/mocks/write_only_eth_1_data.mock.go | 170 ++ .../mocks/write_only_randao_mixes.mock.go | 83 + .../core/mocks/write_only_state_roots.mock.go | 83 + .../core/mocks/write_only_validators.mock.go | 174 ++ .../pkg/core/state_processor_genesis_test.go | 12 +- mod/state-transition/pkg/core/types.go | 11 +- mod/storage/pkg/filedb/range_db_test.go | 4 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 82 +- 42 files changed, 10138 insertions(+), 272 deletions(-) create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/context.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/deposit.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_payload.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/fork_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_validators.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/validator.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/validators.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/withdrawal.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_validators.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index 6062236306..dbbc916112 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,3 +68,8 @@ packages: recursive: False with-expecter: true all: True + github.com/berachain/beacon-kit/mod/state-transition/pkg/core: + config: + recursive: False + with-expecter: true + all: True diff --git a/mod/consensus-types/pkg/types/deposit_message_test.go b/mod/consensus-types/pkg/types/deposit_message_test.go index 66e4f89a3d..02cd17ab7b 100644 --- a/mod/consensus-types/pkg/types/deposit_message_test.go +++ b/mod/consensus-types/pkg/types/deposit_message_test.go @@ -44,7 +44,7 @@ func TestCreateAndSignDepositMessage(t *testing.T) { 0x01, 0x00, 0x00, 0x00, } - mocksSigner := &mocks.BLSSigner{} + mocksSigner := &mocks.Blssigner{} mocksSigner.On("PublicKey").Return(crypto.BLSPubkey{}) mocksSigner.On("Sign", mock.Anything).Return(crypto.BLSSignature{}, nil) diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go index 94ad0fad6e..688aad3a39 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go @@ -3,7 +3,6 @@ package mocks import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" mock "github.com/stretchr/testify/mock" @@ -117,19 +116,19 @@ func (_c *BlobsBundle_GetCommitments_Call) RunAndReturn(run func() []eip4844.KZG } // GetProofs provides a mock function with given fields: -func (_m *BlobsBundle) GetProofs() []bytes.B48 { +func (_m *BlobsBundle) GetProofs() []eip4844.KZGProof { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProofs") } - var r0 []bytes.B48 - if rf, ok := ret.Get(0).(func() []bytes.B48); ok { + var r0 []eip4844.KZGProof + if rf, ok := ret.Get(0).(func() []eip4844.KZGProof); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]bytes.B48) + r0 = ret.Get(0).([]eip4844.KZGProof) } } @@ -153,12 +152,12 @@ func (_c *BlobsBundle_GetProofs_Call) Run(run func()) *BlobsBundle_GetProofs_Cal return _c } -func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []bytes.B48) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { _c.Call.Return(_a0) return _c } -func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []bytes.B48) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { _c.Call.Return(run) return _c } diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go index 0ec103484e..01235c4ba2 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go @@ -4,9 +4,9 @@ package mocks import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - mock "github.com/stretchr/testify/mock" + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - uint256 "github.com/holiman/uint256" + mock "github.com/stretchr/testify/mock" ) // BuiltExecutionPayloadEnv is an autogenerated mock type for the BuiltExecutionPayloadEnv type @@ -115,19 +115,19 @@ func (_c *BuiltExecutionPayloadEnv_GetExecutionPayload_Call[ExecutionPayloadT]) } // GetValue provides a mock function with given fields: -func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *uint256.Int { +func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *math.U256 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetValue") } - var r0 *uint256.Int - if rf, ok := ret.Get(0).(func() *uint256.Int); ok { + var r0 *math.U256 + if rf, ok := ret.Get(0).(func() *math.U256); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*uint256.Int) + r0 = ret.Get(0).(*math.U256) } } @@ -151,12 +151,12 @@ func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Run(run fun return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(_a0) return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 17d2d80e87..784cdda804 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -23,7 +23,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) EXPECT() *Availabi } // IsDataAvailable provides a mock function with given fields: _a0, _a1, _a2 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT) bool { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT) bool { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a } var r0 bool - if rf, ok := ret.Get(0).(func(context.Context, math.U64, BeaconBlockBodyT) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, math.Slot, BeaconBlockBodyT) bool); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(bool) @@ -47,15 +47,15 @@ type AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT any, BlobSidecarsT // IsDataAvailable is a helper method to define mock.On call // - _a0 context.Context -// - _a1 math.U64 +// - _a1 math.Slot // - _a2 BeaconBlockBodyT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("IsDataAvailable", _a0, _a1, _a2)} } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(math.U64), args[2].(BeaconBlockBodyT)) + run(args[0].(context.Context), args[1].(math.Slot), args[2].(BeaconBlockBodyT)) }) return _c } @@ -65,13 +65,13 @@ func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT return _c } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.U64, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.Slot, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } // Persist provides a mock function with given fields: _a0, _a1 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U64, _a1 BlobSidecarsT) error { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.Slot, _a1 BlobSidecarsT) error { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -79,7 +79,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U } var r0 error - if rf, ok := ret.Get(0).(func(math.U64, BlobSidecarsT) error); ok { + if rf, ok := ret.Get(0).(func(math.Slot, BlobSidecarsT) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -94,15 +94,15 @@ type AvailabilityStore_Persist_Call[BeaconBlockBodyT any, BlobSidecarsT any] str } // Persist is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.Slot // - _a1 BlobSidecarsT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 interface{}, _a1 interface{}) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("Persist", _a0, _a1)} } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.U64, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.Slot, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(BlobSidecarsT)) + run(args[0].(math.Slot), args[1].(BlobSidecarsT)) }) return _c } @@ -112,7 +112,7 @@ func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Retur return _c } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.U64, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.Slot, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_block_header.mock.go b/mod/node-api/backend/mocks/beacon_block_header.mock.go index c9d0cd0b6d..5e019b5821 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -117,18 +117,18 @@ func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndR } // GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.U64 { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProposerIndex") } - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } return r0 @@ -151,29 +151,29 @@ func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run f return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.U64 { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } return r0 @@ -196,12 +196,12 @@ func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *B return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } @@ -358,7 +358,7 @@ func (_c *BeaconBlockHeader_MarshalSSZ_Call[BeaconBlockHeaderT]) RunAndReturn(ru } // New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) if len(ret) == 0 { @@ -366,7 +366,7 @@ func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerInde } var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) } else { r0 = ret.Get(0).(BeaconBlockHeaderT) @@ -381,8 +381,8 @@ type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { } // New is a helper method to define mock.On call -// - slot math.U64 -// - proposerIndex math.U64 +// - slot math.Slot +// - proposerIndex math.ValidatorIndex // - parentBlockRoot common.Root // - stateRoot common.Root // - bodyRoot common.Root @@ -390,9 +390,9 @@ func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) }) return _c } @@ -402,7 +402,7 @@ func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlock return _c } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 184d2d7024..1f9fdf1302 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -3,9 +3,7 @@ package mocks import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -84,25 +82,25 @@ func (_c *BeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, Ex } // GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.U64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetBalance") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } - if rf, ok := ret.Get(1).(func(math.U64) error); ok { + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -117,24 +115,24 @@ type BeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, Executio } // GetBalance is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.ValidatorIndex func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.ValidatorIndex)) }) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -585,22 +583,22 @@ func (_c *BeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, } // GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetNextWithdrawalValidatorIndex") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func() error); ok { @@ -629,34 +627,34 @@ func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (bytes.B32, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetRandaoMixAtIndex") } - var r0 bytes.B32 + var r0 common.Bytes32 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (bytes.B32, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) bytes.B32); ok { + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(bytes.B32) + r0 = ret.Get(0).(common.Bytes32) } } @@ -687,33 +685,33 @@ func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Ex return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 bytes.B32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (bytes.B32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetSlashingAtIndex") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -743,33 +741,33 @@ func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Exe return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.Slot); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func() error); ok { @@ -798,33 +796,33 @@ func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetTotalActiveBalances") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -854,33 +852,33 @@ func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetTotalSlashing") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.Gwei); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func() error); ok { @@ -909,12 +907,12 @@ func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1087,7 +1085,7 @@ func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, E } // SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.U64) error { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1095,7 +1093,7 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo } var r0 error - if rf, ok := ret.Get(0).(func(math.U64) error); ok { + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -1110,14 +1108,14 @@ type BeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPa } // SetSlot is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.Slot func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.Slot)) }) return _c } @@ -1127,7 +1125,7 @@ func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1191,7 +1189,7 @@ func (_c *BeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu } // ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.U64) (ValidatorT, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1200,16 +1198,16 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo var r0 ValidatorT var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (ValidatorT, error)); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.U64) ValidatorT); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ValidatorT) } - if rf, ok := ret.Get(1).(func(math.U64) error); ok { + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -1224,14 +1222,14 @@ type BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, Ex } // ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.ValidatorIndex func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.ValidatorIndex)) }) return _c } @@ -1241,28 +1239,28 @@ func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { ret := _m.Called(cometBFTAddress) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByCometBFTAddress") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { return rf(cometBFTAddress) } - if rf, ok := ret.Get(0).(func([]byte) math.U64); ok { + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { r0 = rf(cometBFTAddress) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func([]byte) error); ok { @@ -1292,33 +1290,33 @@ func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.U64, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByPubkey") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.U64); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { @@ -1348,12 +1346,12 @@ func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.U64, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 4e532a619f..74f3b716a2 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -23,22 +23,22 @@ func (_m *BlockStore[BeaconBlockT]) EXPECT() *BlockStore_Expecter[BeaconBlockT] } // GetParentSlotByTimestamp provides a mock function with given fields: timestamp -func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.Slot, error) { ret := _m.Called(timestamp) if len(ret) == 0 { panic("no return value specified for GetParentSlotByTimestamp") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.Slot, error)); ok { return rf(timestamp) } - if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.Slot); ok { r0 = rf(timestamp) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(math.U64) error); ok { @@ -68,33 +68,33 @@ func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Run(run func(t return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.Slot, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByBlockRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.Slot, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByBlockRoot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -124,33 +124,33 @@ func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByStateRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.Slot, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByStateRoot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -180,12 +180,12 @@ func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index a7103536ed..7dcf5f3002 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -23,7 +23,7 @@ func (_m *StateProcessor[BeaconStateT]) EXPECT() *StateProcessor_Expecter[Beacon } // ProcessSlots provides a mock function with given fields: _a0, _a1 -func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.U64) (transition.ValidatorUpdates, error) { +func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.Slot) (transition.ValidatorUpdates, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -32,10 +32,10 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. var r0 transition.ValidatorUpdates var r1 error - if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) transition.ValidatorUpdates); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) transition.ValidatorUpdates); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -43,7 +43,7 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. } } - if rf, ok := ret.Get(1).(func(BeaconStateT, math.U64) error); ok { + if rf, ok := ret.Get(1).(func(BeaconStateT, math.Slot) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -59,14 +59,14 @@ type StateProcessor_ProcessSlots_Call[BeaconStateT any] struct { // ProcessSlots is a helper method to define mock.On call // - _a0 BeaconStateT -// - _a1 math.U64 +// - _a1 math.Slot func (_e *StateProcessor_Expecter[BeaconStateT]) ProcessSlots(_a0 interface{}, _a1 interface{}) *StateProcessor_ProcessSlots_Call[BeaconStateT] { return &StateProcessor_ProcessSlots_Call[BeaconStateT]{Call: _e.mock.On("ProcessSlots", _a0, _a1)} } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.U64)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.Slot)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconStateT), args[1].(math.U64)) + run(args[0].(BeaconStateT), args[1].(math.Slot)) }) return _c } @@ -76,7 +76,7 @@ func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Return(_a0 transition. return _c } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 73404aa0d7..655e2123b2 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -68,7 +68,7 @@ func (_c *Validator_GetWithdrawalCredentials_Call[WithdrawalCredentialsT]) RunAn } // IsFullyWithdrawable provides a mock function with given fields: amount, epoch -func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64, epoch math.U64) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwei, epoch math.Epoch) bool { ret := _m.Called(amount, epoch) if len(ret) == 0 { @@ -76,7 +76,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64 } var r0 bool - if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { + if rf, ok := ret.Get(0).(func(math.Gwei, math.Epoch) bool); ok { r0 = rf(amount, epoch) } else { r0 = ret.Get(0).(bool) @@ -91,15 +91,15 @@ type Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT backend.Withdrawa } // IsFullyWithdrawable is a helper method to define mock.On call -// - amount math.U64 -// - epoch math.U64 +// - amount math.Gwei +// - epoch math.Epoch func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsFullyWithdrawable(amount interface{}, epoch interface{}) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsFullyWithdrawable", amount, epoch)} } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.U64, epoch math.U64)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.Gwei, epoch math.Epoch)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64)) + run(args[0].(math.Gwei), args[1].(math.Epoch)) }) return _c } @@ -109,13 +109,13 @@ func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Return(_a0 return _c } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Epoch) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } // IsPartiallyWithdrawable provides a mock function with given fields: amount1, amount2 -func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.U64, amount2 math.U64) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.Gwei, amount2 math.Gwei) bool { ret := _m.Called(amount1, amount2) if len(ret) == 0 { @@ -123,7 +123,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 mat } var r0 bool - if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { + if rf, ok := ret.Get(0).(func(math.Gwei, math.Gwei) bool); ok { r0 = rf(amount1, amount2) } else { r0 = ret.Get(0).(bool) @@ -138,15 +138,15 @@ type Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT backend.Withd } // IsPartiallyWithdrawable is a helper method to define mock.On call -// - amount1 math.U64 -// - amount2 math.U64 +// - amount1 math.Gwei +// - amount2 math.Gwei func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 interface{}, amount2 interface{}) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsPartiallyWithdrawable", amount1, amount2)} } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.U64, amount2 math.U64)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.Gwei, amount2 math.Gwei)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64)) + run(args[0].(math.Gwei), args[1].(math.Gwei)) }) return _c } @@ -156,7 +156,7 @@ func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Return return _c } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Gwei) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index d7dbcb6747..72fd41fa44 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -23,7 +23,7 @@ func (_m *Withdrawal[T]) EXPECT() *Withdrawal_Expecter[T] { } // New provides a mock function with given fields: index, validator, address, amount -func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64) T { +func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei) T { ret := _m.Called(index, validator, address, amount) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common. } var r0 T - if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.ExecutionAddress, math.U64) T); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T); ok { r0 = rf(index, validator, address, amount) } else { r0 = ret.Get(0).(T) @@ -47,16 +47,16 @@ type Withdrawal_New_Call[T any] struct { // New is a helper method to define mock.On call // - index math.U64 -// - validator math.U64 +// - validator math.ValidatorIndex // - address common.ExecutionAddress -// - amount math.U64 +// - amount math.Gwei func (_e *Withdrawal_Expecter[T]) New(index interface{}, validator interface{}, address interface{}, amount interface{}) *Withdrawal_New_Call[T] { return &Withdrawal_New_Call[T]{Call: _e.mock.On("New", index, validator, address, amount)} } -func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64)) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei)) *Withdrawal_New_Call[T] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64), args[2].(common.ExecutionAddress), args[3].(math.U64)) + run(args[0].(math.U64), args[1].(math.ValidatorIndex), args[2].(common.ExecutionAddress), args[3].(math.Gwei)) }) return _c } @@ -66,7 +66,7 @@ func (_c *Withdrawal_New_Call[T]) Return(_a0 T) *Withdrawal_New_Call[T] { return _c } -func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.U64, common.ExecutionAddress, math.U64) T) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T) *Withdrawal_New_Call[T] { _c.Call.Return(run) return _c } diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index 4ea1d83c10..a9e52cb133 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -7,21 +7,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// BLSSigner is an autogenerated mock type for the BLSSigner type -type BLSSigner struct { +// Blssigner is an autogenerated mock type for the BLSSigner type +type Blssigner struct { mock.Mock } -type BLSSigner_Expecter struct { +type Blssigner_Expecter struct { mock *mock.Mock } -func (_m *BLSSigner) EXPECT() *BLSSigner_Expecter { - return &BLSSigner_Expecter{mock: &_m.Mock} +func (_m *Blssigner) EXPECT() *Blssigner_Expecter { + return &Blssigner_Expecter{mock: &_m.Mock} } // PublicKey provides a mock function with given fields: -func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { +func (_m *Blssigner) PublicKey() crypto.BLSPubkey { ret := _m.Called() if len(ret) == 0 { @@ -40,35 +40,35 @@ func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { return r0 } -// BLSSigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' -type BLSSigner_PublicKey_Call struct { +// Blssigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' +type Blssigner_PublicKey_Call struct { *mock.Call } // PublicKey is a helper method to define mock.On call -func (_e *BLSSigner_Expecter) PublicKey() *BLSSigner_PublicKey_Call { - return &BLSSigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} +func (_e *Blssigner_Expecter) PublicKey() *Blssigner_PublicKey_Call { + return &Blssigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} } -func (_c *BLSSigner_PublicKey_Call) Run(run func()) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) Run(run func()) *Blssigner_PublicKey_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } -func (_c *BLSSigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *Blssigner_PublicKey_Call { _c.Call.Return(_a0) return _c } -func (_c *BLSSigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *Blssigner_PublicKey_Call { _c.Call.Return(run) return _c } // Sign provides a mock function with given fields: _a0 -func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { +func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -97,36 +97,36 @@ func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { return r0, r1 } -// BLSSigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' -type BLSSigner_Sign_Call struct { +// Blssigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Blssigner_Sign_Call struct { *mock.Call } // Sign is a helper method to define mock.On call // - _a0 []byte -func (_e *BLSSigner_Expecter) Sign(_a0 interface{}) *BLSSigner_Sign_Call { - return &BLSSigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} +func (_e *Blssigner_Expecter) Sign(_a0 interface{}) *Blssigner_Sign_Call { + return &Blssigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} } -func (_c *BLSSigner_Sign_Call) Run(run func(_a0 []byte)) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) Run(run func(_a0 []byte)) *Blssigner_Sign_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *BLSSigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *Blssigner_Sign_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *BLSSigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *Blssigner_Sign_Call { _c.Call.Return(run) return _c } // VerifySignature provides a mock function with given fields: pubKey, msg, signature -func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { +func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { ret := _m.Called(pubKey, msg, signature) if len(ret) == 0 { @@ -143,8 +143,8 @@ func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signat return r0 } -// BLSSigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type BLSSigner_VerifySignature_Call struct { +// Blssigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type Blssigner_VerifySignature_Call struct { *mock.Call } @@ -152,34 +152,34 @@ type BLSSigner_VerifySignature_Call struct { // - pubKey crypto.BLSPubkey // - msg []byte // - signature crypto.BLSSignature -func (_e *BLSSigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *BLSSigner_VerifySignature_Call { - return &BLSSigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} +func (_e *Blssigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *Blssigner_VerifySignature_Call { + return &Blssigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} } -func (_c *BLSSigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *Blssigner_VerifySignature_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(crypto.BLSPubkey), args[1].([]byte), args[2].(crypto.BLSSignature)) }) return _c } -func (_c *BLSSigner_VerifySignature_Call) Return(_a0 error) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) Return(_a0 error) *Blssigner_VerifySignature_Call { _c.Call.Return(_a0) return _c } -func (_c *BLSSigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *Blssigner_VerifySignature_Call { _c.Call.Return(run) return _c } -// NewBLSSigner creates a new instance of BLSSigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewBlssigner creates a new instance of Blssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewBLSSigner(t interface { +func NewBlssigner(t interface { mock.TestingT Cleanup(func()) -}) *BLSSigner { - mock := &BLSSigner{} +}) *Blssigner { + mock := &Blssigner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 1631830784..b982800a67 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,6 +23,7 @@ package core_test import ( "context" "fmt" + "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -32,24 +33,48 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" ) -// TODO: replace with proper mock -type testExecutionEngine struct{} - -func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( - _ context.Context, - _ *engineprimitives.NewPayloadRequest[ +func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { + mockEngine := mocks.NewExecutionEngine[ *types.ExecutionPayload, + *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ], -) error { - return nil + ](t) + + t.Run("successful verification with complete payload", func(t *testing.T) { + req := &engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ]{ + ExecutionPayload: &types.ExecutionPayload{}, + VersionedHashes: []common.ExecutionHash{ + {0x1}, + {0x2}, + }, + ParentBeaconBlockRoot: &common.Root{0x3}, + Optimistic: false, + } + + // Set up expectation for successful verification + mockEngine.EXPECT(). + VerifyAndNotifyNewPayload( + context.Background(), + req, + ). + Return(nil) + + err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) + require.NoError(t, err) + }) } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go new file mode 100644 index 0000000000..9b7182a9b9 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go @@ -0,0 +1,313 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlock is an autogenerated mock type for the BeaconBlock type +type BeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock.Mock +} + +type BeaconBlock_Expecter[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// GetBody provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() BeaconBlockBodyT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBody") + } + + var r0 BeaconBlockBodyT + if rf, ok := ret.Get(0).(func() BeaconBlockBodyT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockBodyT) + } + + return r0 +} + +// BeaconBlock_GetBody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBody' +type BeaconBlock_GetBody_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetBody is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBody")} +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetParentBlockRoot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentBlockRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlock_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' +type BeaconBlock_GetParentBlockRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetParentBlockRoot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentBlockRoot")} +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetProposerIndex provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// BeaconBlock_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' +type BeaconBlock_GetProposerIndex_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetProposerIndex is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetProposerIndex")} +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() math.Slot { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + return r0 +} + +// BeaconBlock_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconBlock_GetSlot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlock_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type BeaconBlock_GetStateRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// IsNil provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsNil") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// BeaconBlock_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' +type BeaconBlock_IsNil_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// IsNil is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlock creates a new instance of BeaconBlock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go new file mode 100644 index 0000000000..cc750bf211 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go @@ -0,0 +1,320 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlockBody is an autogenerated mock type for the BeaconBlockBody type +type BeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock.Mock +} + +type BeaconBlockBody_Expecter[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// Empty provides a mock function with given fields: _a0 +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) BeaconBlockBodyT { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Empty") + } + + var r0 BeaconBlockBodyT + if rf, ok := ret.Get(0).(func(uint32) BeaconBlockBodyT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(BeaconBlockBodyT) + } + + return r0 +} + +// BeaconBlockBody_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' +type BeaconBlockBody_Empty_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// Empty is a helper method to define mock.On call +// - _a0 uint32 +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint32)) + }) + return _c +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlobKzgCommitments provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() eip4844.KZGCommitments[common.ExecutionHash] { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlobKzgCommitments") + } + + var r0 eip4844.KZGCommitments[common.ExecutionHash] + if rf, ok := ret.Get(0).(func() eip4844.KZGCommitments[common.ExecutionHash]); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(eip4844.KZGCommitments[common.ExecutionHash]) + } + } + + return r0 +} + +// BeaconBlockBody_GetBlobKzgCommitments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobKzgCommitments' +type BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlobKzgCommitments is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobKzgCommitments")} +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetDeposits provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() []DepositT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDeposits") + } + + var r0 []DepositT + if rf, ok := ret.Get(0).(func() []DepositT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]DepositT) + } + } + + return r0 +} + +// BeaconBlockBody_GetDeposits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeposits' +type BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetDeposits is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetDeposits")} +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExecutionPayload provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() ExecutionPayloadT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExecutionPayload") + } + + var r0 ExecutionPayloadT + if rf, ok := ret.Get(0).(func() ExecutionPayloadT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadT) + } + + return r0 +} + +// BeaconBlockBody_GetExecutionPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionPayload' +type BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetExecutionPayload is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExecutionPayload")} +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoReveal provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() crypto.BLSSignature { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRandaoReveal") + } + + var r0 crypto.BLSSignature + if rf, ok := ret.Get(0).(func() crypto.BLSSignature); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSSignature) + } + } + + return r0 +} + +// BeaconBlockBody_GetRandaoReveal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoReveal' +type BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetRandaoReveal is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetRandaoReveal")} +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockBody_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlockBody creates a new instance of BeaconBlockBody. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go new file mode 100644 index 0000000000..e8353c6e6d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go @@ -0,0 +1,399 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlockHeader is an autogenerated mock type for the BeaconBlockHeader type +type BeaconBlockHeader[BeaconBlockHeaderT any] struct { + mock.Mock +} + +type BeaconBlockHeader_Expecter[BeaconBlockHeaderT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) EXPECT() *BeaconBlockHeader_Expecter[BeaconBlockHeaderT] { + return &BeaconBlockHeader_Expecter[BeaconBlockHeaderT]{mock: &_m.Mock} +} + +// GetBodyRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetBodyRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBodyRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetBodyRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBodyRoot' +type BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetBodyRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetBodyRoot() *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetBodyRoot")} +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetParentBlockRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetParentBlockRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentBlockRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' +type BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetParentBlockRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetParentBlockRoot() *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetParentBlockRoot")} +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetProposerIndex provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// BeaconBlockHeader_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' +type BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetProposerIndex is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetProposerIndex() *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetProposerIndex")} +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + return r0 +} + +// BeaconBlockHeader_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetSlot() *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetStateRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetStateRoot() *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) HashTreeRoot() *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { + ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 BeaconBlockHeaderT + if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + return r0 +} + +// BeaconBlockHeader_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - slot math.Slot +// - proposerIndex math.ValidatorIndex +// - parentBlockRoot common.Root +// - stateRoot common.Root +// - bodyRoot common.Root +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, proposerIndex interface{}, parentBlockRoot interface{}, stateRoot interface{}, bodyRoot interface{}) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + }) + return _c +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetStateRoot provides a mock function with given fields: _a0 +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) SetStateRoot(_a0 common.Root) { + _m.Called(_a0) +} + +// BeaconBlockHeader_SetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStateRoot' +type BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// SetStateRoot is a helper method to define mock.On call +// - _a0 common.Root +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) SetStateRoot(_a0 interface{}) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("SetStateRoot", _a0)} +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Run(run func(_a0 common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Return() *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return() + return _c +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func(common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlockHeader creates a new instance of BeaconBlockHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlockHeader[BeaconBlockHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlockHeader[BeaconBlockHeaderT] { + mock := &BeaconBlockHeader[BeaconBlockHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go new file mode 100644 index 0000000000..c857192228 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go @@ -0,0 +1,2395 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconState is an autogenerated mock type for the BeaconState type +type BeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock.Mock +} + +type BeaconState_Expecter[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type BeaconState_AddValidator_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 interface{}) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type BeaconState_AddValidatorBartio_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 interface{}) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// Context provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() context.Context { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Context") + } + + var r0 context.Context + if rf, ok := ret.Get(0).(func() context.Context); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + + return r0 +} + +// BeaconState_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' +type BeaconState_Context_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// Context is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Context")} +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// Copy provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() T { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Copy") + } + + var r0 T + if rf, ok := ret.Get(0).(func() T); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(T) + } + + return r0 +} + +// BeaconState_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' +type BeaconState_Copy_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// Copy is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Copy")} +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// DecreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for DecreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' +type BeaconState_DecreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// DecreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type BeaconState_ExpectedWithdrawals_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBalance provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBalance") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type BeaconState_GetBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBlockRootAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBlockRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' +type BeaconState_GetBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1Data provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type BeaconState_GetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type BeaconState_GetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetFork provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFork") + } + + var r0 ForkT + var r1 error + if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ForkT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ForkT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' +type BeaconState_GetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetFork is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetGenesisValidatorsRoot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGenesisValidatorsRoot") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' +type BeaconState_GetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetGenesisValidatorsRoot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestBlockHeader provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestBlockHeader") + } + + var r0 BeaconBlockHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' +type BeaconState_GetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestBlockHeader is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type BeaconState_GetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' +type BeaconState_GetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalValidatorIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalValidatorIndex") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' +type BeaconState_GetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type BeaconState_GetRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlashingAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetSlashingAtIndex") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' +type BeaconState_GetSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + var r1 error + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconState_GetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalActiveBalances provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetTotalActiveBalances") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' +type BeaconState_GetTotalActiveBalances_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalActiveBalances is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalSlashing provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalSlashing") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' +type BeaconState_GetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalSlashing is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalValidators provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalValidators") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' +type BeaconState_GetTotalValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalValidators is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidators provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidators") + } + + var r0 ValidatorsT + var r1 error + if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ValidatorsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ValidatorsT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' +type BeaconState_GetValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidators is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorsByEffectiveBalance provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorsByEffectiveBalance") + } + + var r0 []ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []ValidatorT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ValidatorT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' +type BeaconState_GetValidatorsByEffectiveBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorsByEffectiveBalance is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconState_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconState_HashTreeRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// IncreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IncreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' +type BeaconState_IncreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// IncreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewFromDB provides a mock function with given fields: bdb, cs +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb KVStoreT, cs common.ChainSpec) T { + ret := _m.Called(bdb, cs) + + if len(ret) == 0 { + panic("no return value specified for NewFromDB") + } + + var r0 T + if rf, ok := ret.Get(0).(func(KVStoreT, common.ChainSpec) T); ok { + r0 = rf(bdb, cs) + } else { + r0 = ret.Get(0).(T) + } + + return r0 +} + +// BeaconState_NewFromDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewFromDB' +type BeaconState_NewFromDB_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// NewFromDB is a helper method to define mock.On call +// - bdb KVStoreT +// - cs common.ChainSpec +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb interface{}, cs interface{}) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("NewFromDB", bdb, cs)} +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(bdb KVStoreT, cs common.ChainSpec)) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(KVStoreT), args[1].(common.ChainSpec)) + }) + return _c +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(KVStoreT, common.ChainSpec) T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type BeaconState_SetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 interface{}) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 Eth1DataT)) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(Eth1DataT) error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type BeaconState_SetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 interface{}) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetFork provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 ForkT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetFork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' +type BeaconState_SetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetFork is a helper method to define mock.On call +// - _a0 ForkT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 interface{}) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetFork", _a0)} +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ForkT)) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkT)) + }) + return _c +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ForkT) error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetGenesisValidatorsRoot provides a mock function with given fields: root +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root common.Root) error { + ret := _m.Called(root) + + if len(ret) == 0 { + panic("no return value specified for SetGenesisValidatorsRoot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(common.Root) error); ok { + r0 = rf(root) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' +type BeaconState_SetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetGenesisValidatorsRoot is a helper method to define mock.On call +// - root common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root interface{}) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(root common.Root)) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(common.Root) error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetLatestBlockHeader provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestBlockHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' +type BeaconState_SetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetLatestBlockHeader is a helper method to define mock.On call +// - _a0 BeaconBlockHeaderT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 interface{}) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 BeaconBlockHeaderT)) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(BeaconBlockHeaderT)) + }) + return _c +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type BeaconState_SetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' +type BeaconState_SetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetNextWithdrawalIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalValidatorIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' +type BeaconState_SetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetSlot provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetSlot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' +type BeaconState_SetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetSlot is a helper method to define mock.On call +// - _a0 math.Slot +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot)) + }) + return _c +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetTotalSlashing provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 math.Gwei) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetTotalSlashing") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' +type BeaconState_SetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetTotalSlashing is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 interface{}) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetTotalSlashing", _a0)} +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Gwei)) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Gwei) error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type BeaconState_StateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateBlockRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' +type BeaconState_UpdateBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type BeaconState_UpdateRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Bytes32) error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateSlashingAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' +type BeaconState_UpdateSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, math.Gwei) error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type BeaconState_UpdateStateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type BeaconState_UpdateValidatorAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type BeaconState_ValidatorByIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { + ret := _m.Called(cometBFTAddress) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByCometBFTAddress") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + return rf(cometBFTAddress) + } + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + r0 = rf(cometBFTAddress) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(cometBFTAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' +type BeaconState_ValidatorIndexByCometBFTAddress_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call +// - cometBFTAddress []byte +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type BeaconState_ValidatorIndexByPubkey_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconState creates a new instance of BeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + mock := &BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/context.mock.go b/mod/state-transition/pkg/core/mocks/context.mock.go new file mode 100644 index 0000000000..580f0c7713 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/context.mock.go @@ -0,0 +1,411 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + time "time" + + mock "github.com/stretchr/testify/mock" +) + +// Context is an autogenerated mock type for the Context type +type Context struct { + mock.Mock +} + +type Context_Expecter struct { + mock *mock.Mock +} + +func (_m *Context) EXPECT() *Context_Expecter { + return &Context_Expecter{mock: &_m.Mock} +} + +// Deadline provides a mock function with given fields: +func (_m *Context) Deadline() (time.Time, bool) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Deadline") + } + + var r0 time.Time + var r1 bool + if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() time.Time); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Time) + } + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// Context_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline' +type Context_Deadline_Call struct { + *mock.Call +} + +// Deadline is a helper method to define mock.On call +func (_e *Context_Expecter) Deadline() *Context_Deadline_Call { + return &Context_Deadline_Call{Call: _e.mock.On("Deadline")} +} + +func (_c *Context_Deadline_Call) Run(run func()) *Context_Deadline_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Deadline_Call) Return(deadline time.Time, ok bool) *Context_Deadline_Call { + _c.Call.Return(deadline, ok) + return _c +} + +func (_c *Context_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *Context_Deadline_Call { + _c.Call.Return(run) + return _c +} + +// Done provides a mock function with given fields: +func (_m *Context) Done() <-chan struct{} { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 <-chan struct{} + if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan struct{}) + } + } + + return r0 +} + +// Context_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type Context_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +func (_e *Context_Expecter) Done() *Context_Done_Call { + return &Context_Done_Call{Call: _e.mock.On("Done")} +} + +func (_c *Context_Done_Call) Run(run func()) *Context_Done_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Done_Call) Return(_a0 <-chan struct{}) *Context_Done_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Done_Call) RunAndReturn(run func() <-chan struct{}) *Context_Done_Call { + _c.Call.Return(run) + return _c +} + +// Err provides a mock function with given fields: +func (_m *Context) Err() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Err") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Context_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Context_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Context_Expecter) Err() *Context_Err_Call { + return &Context_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Context_Err_Call) Run(run func()) *Context_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Err_Call) Return(_a0 error) *Context_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Err_Call) RunAndReturn(run func() error) *Context_Err_Call { + _c.Call.Return(run) + return _c +} + +// GetOptimisticEngine provides a mock function with given fields: +func (_m *Context) GetOptimisticEngine() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetOptimisticEngine") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetOptimisticEngine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOptimisticEngine' +type Context_GetOptimisticEngine_Call struct { + *mock.Call +} + +// GetOptimisticEngine is a helper method to define mock.On call +func (_e *Context_Expecter) GetOptimisticEngine() *Context_GetOptimisticEngine_Call { + return &Context_GetOptimisticEngine_Call{Call: _e.mock.On("GetOptimisticEngine")} +} + +func (_c *Context_GetOptimisticEngine_Call) Run(run func()) *Context_GetOptimisticEngine_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetOptimisticEngine_Call) Return(_a0 bool) *Context_GetOptimisticEngine_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetOptimisticEngine_Call) RunAndReturn(run func() bool) *Context_GetOptimisticEngine_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipPayloadVerification provides a mock function with given fields: +func (_m *Context) GetSkipPayloadVerification() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipPayloadVerification") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipPayloadVerification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipPayloadVerification' +type Context_GetSkipPayloadVerification_Call struct { + *mock.Call +} + +// GetSkipPayloadVerification is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipPayloadVerification() *Context_GetSkipPayloadVerification_Call { + return &Context_GetSkipPayloadVerification_Call{Call: _e.mock.On("GetSkipPayloadVerification")} +} + +func (_c *Context_GetSkipPayloadVerification_Call) Run(run func()) *Context_GetSkipPayloadVerification_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipPayloadVerification_Call) Return(_a0 bool) *Context_GetSkipPayloadVerification_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipPayloadVerification_Call) RunAndReturn(run func() bool) *Context_GetSkipPayloadVerification_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipValidateRandao provides a mock function with given fields: +func (_m *Context) GetSkipValidateRandao() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipValidateRandao") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipValidateRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateRandao' +type Context_GetSkipValidateRandao_Call struct { + *mock.Call +} + +// GetSkipValidateRandao is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipValidateRandao() *Context_GetSkipValidateRandao_Call { + return &Context_GetSkipValidateRandao_Call{Call: _e.mock.On("GetSkipValidateRandao")} +} + +func (_c *Context_GetSkipValidateRandao_Call) Run(run func()) *Context_GetSkipValidateRandao_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipValidateRandao_Call) Return(_a0 bool) *Context_GetSkipValidateRandao_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipValidateRandao_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateRandao_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipValidateResult provides a mock function with given fields: +func (_m *Context) GetSkipValidateResult() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipValidateResult") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipValidateResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateResult' +type Context_GetSkipValidateResult_Call struct { + *mock.Call +} + +// GetSkipValidateResult is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipValidateResult() *Context_GetSkipValidateResult_Call { + return &Context_GetSkipValidateResult_Call{Call: _e.mock.On("GetSkipValidateResult")} +} + +func (_c *Context_GetSkipValidateResult_Call) Run(run func()) *Context_GetSkipValidateResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipValidateResult_Call) Return(_a0 bool) *Context_GetSkipValidateResult_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipValidateResult_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateResult_Call { + _c.Call.Return(run) + return _c +} + +// Value provides a mock function with given fields: key +func (_m *Context) Value(key any) any { + ret := _m.Called(key) + + if len(ret) == 0 { + panic("no return value specified for Value") + } + + var r0 any + if rf, ok := ret.Get(0).(func(any) any); ok { + r0 = rf(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + + return r0 +} + +// Context_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' +type Context_Value_Call struct { + *mock.Call +} + +// Value is a helper method to define mock.On call +// - key any +func (_e *Context_Expecter) Value(key interface{}) *Context_Value_Call { + return &Context_Value_Call{Call: _e.mock.On("Value", key)} +} + +func (_c *Context_Value_Call) Run(run func(key any)) *Context_Value_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(any)) + }) + return _c +} + +func (_c *Context_Value_Call) Return(_a0 any) *Context_Value_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Value_Call) RunAndReturn(run func(any) any) *Context_Value_Call { + _c.Call.Return(run) + return _c +} + +// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewContext(t interface { + mock.TestingT + Cleanup(func()) +}) *Context { + mock := &Context{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/deposit.mock.go b/mod/state-transition/pkg/core/mocks/deposit.mock.go new file mode 100644 index 0000000000..d424fc8c1d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/deposit.mock.go @@ -0,0 +1,225 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Deposit is an autogenerated mock type for the Deposit type +type Deposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + mock.Mock +} + +type Deposit_Expecter[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + mock *mock.Mock +} + +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) EXPECT() *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]{mock: &_m.Mock} +} + +// GetAmount provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetAmount() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAmount") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Deposit_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' +type Deposit_GetAmount_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetAmount is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetAmount() *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetAmount")} +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetPubkey provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetPubkey() crypto.BLSPubkey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPubkey") + } + + var r0 crypto.BLSPubkey + if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSPubkey) + } + } + + return r0 +} + +// Deposit_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' +type Deposit_GetPubkey_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetPubkey is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetPubkey() *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetPubkey")} +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawalCredentials provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() WithdrawlCredentialsT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawalCredentials") + } + + var r0 WithdrawlCredentialsT + if rf, ok := ret.Get(0).(func() WithdrawlCredentialsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(WithdrawlCredentialsT) + } + + return r0 +} + +// Deposit_GetWithdrawalCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawalCredentials' +type Deposit_GetWithdrawalCredentials_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetWithdrawalCredentials is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetWithdrawalCredentials")} +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// VerifySignature provides a mock function with given fields: forkData, domainType, signatureVerificationFn +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error { + ret := _m.Called(forkData, domainType, signatureVerificationFn) + + if len(ret) == 0 { + panic("no return value specified for VerifySignature") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error); ok { + r0 = rf(forkData, domainType, signatureVerificationFn) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Deposit_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type Deposit_VerifySignature_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// VerifySignature is a helper method to define mock.On call +// - forkData ForkDataT +// - domainType common.DomainType +// - signatureVerificationFn func(crypto.BLSPubkey , []byte , crypto.BLSSignature) error +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData interface{}, domainType interface{}, signatureVerificationFn interface{}) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("VerifySignature", forkData, domainType, signatureVerificationFn)} +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkDataT), args[1].(common.DomainType), args[2].(func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) + }) + return _c +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// NewDeposit creates a new instance of Deposit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDeposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }](t interface { + mock.TestingT + Cleanup(func()) +}) *Deposit[ForkDataT, WithdrawlCredentialsT] { + mock := &Deposit[ForkDataT, WithdrawlCredentialsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go new file mode 100644 index 0000000000..77baa04080 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -0,0 +1,86 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type +type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + mock.Mock +} + +type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + mock *mock.Mock +} + +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for VerifyAndNotifyNewPayload") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { + r0 = rf(ctx, req) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' +type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + *mock.Call +} + +// VerifyAndNotifyNewPayload is a helper method to define mock.On call +// - ctx context.Context +// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] +func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) + }) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go new file mode 100644 index 0000000000..9f22de5ead --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go @@ -0,0 +1,1122 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionPayload is an autogenerated mock type for the ExecutionPayload type +type ExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + mock.Mock +} + +type ExecutionPayload_Expecter[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// Empty provides a mock function with given fields: _a0 +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) ExecutionPayloadT { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Empty") + } + + var r0 ExecutionPayloadT + if rf, ok := ret.Get(0).(func(uint32) ExecutionPayloadT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ExecutionPayloadT) + } + + return r0 +} + +// ExecutionPayload_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' +type ExecutionPayload_Empty_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// Empty is a helper method to define mock.On call +// - _a0 uint32 +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint32)) + }) + return _c +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBaseFeePerGas provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *math.U256 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBaseFeePerGas") + } + + var r0 *math.U256 + if rf, ok := ret.Get(0).(func() *math.U256); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*math.U256) + } + } + + return r0 +} + +// ExecutionPayload_GetBaseFeePerGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBaseFeePerGas' +type ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBaseFeePerGas is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBaseFeePerGas")} +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlobGasUsed provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlobGasUsed") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetBlobGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobGasUsed' +type ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlobGasUsed is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobGasUsed")} +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlockHash provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlockHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayload_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' +type ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlockHash is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlockHash")} +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExcessBlobGas provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExcessBlobGas") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetExcessBlobGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExcessBlobGas' +type ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetExcessBlobGas is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExcessBlobGas")} +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExtraData provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() []byte { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExtraData") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// ExecutionPayload_GetExtraData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExtraData' +type ExecutionPayload_GetExtraData_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetExtraData is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExtraData")} +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetFeeRecipient provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() common.ExecutionAddress { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFeeRecipient") + } + + var r0 common.ExecutionAddress + if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionAddress) + } + } + + return r0 +} + +// ExecutionPayload_GetFeeRecipient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeRecipient' +type ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetFeeRecipient is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetFeeRecipient")} +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetGasLimit provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasLimit") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetGasLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasLimit' +type ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetGasLimit is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasLimit")} +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetGasUsed provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasUsed") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasUsed' +type ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetGasUsed is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasUsed")} +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetLogsBloom provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() bytes.B256 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogsBloom") + } + + var r0 bytes.B256 + if rf, ok := ret.Get(0).(func() bytes.B256); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(bytes.B256) + } + } + + return r0 +} + +// ExecutionPayload_GetLogsBloom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogsBloom' +type ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetLogsBloom is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetLogsBloom")} +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetNumber provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNumber") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNumber' +type ExecutionPayload_GetNumber_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetNumber is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetNumber")} +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetParentHash provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayload_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' +type ExecutionPayload_GetParentHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetParentHash is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentHash")} +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetPrevRandao provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrevRandao") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetPrevRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrevRandao' +type ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetPrevRandao is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetPrevRandao")} +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetReceiptsRoot provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetReceiptsRoot") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetReceiptsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReceiptsRoot' +type ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetReceiptsRoot is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetReceiptsRoot")} +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetTimestamp provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTimestamp") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' +type ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetTimestamp is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTimestamp")} +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetTransactions provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() engineprimitives.Transactions { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTransactions") + } + + var r0 engineprimitives.Transactions + if rf, ok := ret.Get(0).(func() engineprimitives.Transactions); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(engineprimitives.Transactions) + } + } + + return r0 +} + +// ExecutionPayload_GetTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactions' +type ExecutionPayload_GetTransactions_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetTransactions is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTransactions")} +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawals provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() WithdrawalsT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawals") + } + + var r0 WithdrawalsT + if rf, ok := ret.Get(0).(func() WithdrawalsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(WithdrawalsT) + } + + return r0 +} + +// ExecutionPayload_GetWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawals' +type ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetWithdrawals is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetWithdrawals")} +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// IsNil provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsNil") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// ExecutionPayload_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' +type ExecutionPayload_IsNil_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// IsNil is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// MarshalJSON provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() ([]byte, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MarshalJSON") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ExecutionPayload_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' +type ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// MarshalJSON is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("MarshalJSON")} +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte, _a1 error) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ([]byte, error)) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// ToHeader provides a mock function with given fields: maxWithdrawalsPerPayload, eth1ChainID +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload uint64, eth1ChainID uint64) (ExecutionPayloadHeaderT, error) { + ret := _m.Called(maxWithdrawalsPerPayload, eth1ChainID) + + if len(ret) == 0 { + panic("no return value specified for ToHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func(uint64, uint64) (ExecutionPayloadHeaderT, error)); ok { + return rf(maxWithdrawalsPerPayload, eth1ChainID) + } + if rf, ok := ret.Get(0).(func(uint64, uint64) ExecutionPayloadHeaderT); ok { + r0 = rf(maxWithdrawalsPerPayload, eth1ChainID) + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func(uint64, uint64) error); ok { + r1 = rf(maxWithdrawalsPerPayload, eth1ChainID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ExecutionPayload_ToHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToHeader' +type ExecutionPayload_ToHeader_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// ToHeader is a helper method to define mock.On call +// - maxWithdrawalsPerPayload uint64 +// - eth1ChainID uint64 +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload interface{}, eth1ChainID interface{}) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("ToHeader", maxWithdrawalsPerPayload, eth1ChainID)} +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(maxWithdrawalsPerPayload uint64, eth1ChainID uint64)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(uint64)) + }) + return _c +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint64, uint64) (ExecutionPayloadHeaderT, error)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// UnmarshalJSON provides a mock function with given fields: _a0 +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 []byte) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for UnmarshalJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]byte) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionPayload_UnmarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalJSON' +type ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// UnmarshalJSON is a helper method to define mock.On call +// - _a0 []byte +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 interface{}) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("UnmarshalJSON", _a0)} +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 []byte)) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func([]byte) error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// ExecutionPayload_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type ExecutionPayload_Version_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Version")} +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionPayload creates a new instance of ExecutionPayload. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go new file mode 100644 index 0000000000..eda051f23d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionPayloadHeader is an autogenerated mock type for the ExecutionPayloadHeader type +type ExecutionPayloadHeader struct { + mock.Mock +} + +type ExecutionPayloadHeader_Expecter struct { + mock *mock.Mock +} + +func (_m *ExecutionPayloadHeader) EXPECT() *ExecutionPayloadHeader_Expecter { + return &ExecutionPayloadHeader_Expecter{mock: &_m.Mock} +} + +// GetBlockHash provides a mock function with given fields: +func (_m *ExecutionPayloadHeader) GetBlockHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlockHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayloadHeader_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' +type ExecutionPayloadHeader_GetBlockHash_Call struct { + *mock.Call +} + +// GetBlockHash is a helper method to define mock.On call +func (_e *ExecutionPayloadHeader_Expecter) GetBlockHash() *ExecutionPayloadHeader_GetBlockHash_Call { + return &ExecutionPayloadHeader_GetBlockHash_Call{Call: _e.mock.On("GetBlockHash")} +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Run(run func()) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Return(_a0 common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Return(run) + return _c +} + +// NewExecutionPayloadHeader creates a new instance of ExecutionPayloadHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionPayloadHeader(t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionPayloadHeader { + mock := &ExecutionPayloadHeader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/fork_data.mock.go b/mod/state-transition/pkg/core/mocks/fork_data.mock.go new file mode 100644 index 0000000000..5b0d48628a --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/fork_data.mock.go @@ -0,0 +1,134 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ForkData is an autogenerated mock type for the ForkData type +type ForkData[ForkDataT any] struct { + mock.Mock +} + +type ForkData_Expecter[ForkDataT any] struct { + mock *mock.Mock +} + +func (_m *ForkData[ForkDataT]) EXPECT() *ForkData_Expecter[ForkDataT] { + return &ForkData_Expecter[ForkDataT]{mock: &_m.Mock} +} + +// ComputeRandaoSigningRoot provides a mock function with given fields: domainType, epoch +func (_m *ForkData[ForkDataT]) ComputeRandaoSigningRoot(domainType common.DomainType, epoch math.Epoch) common.Root { + ret := _m.Called(domainType, epoch) + + if len(ret) == 0 { + panic("no return value specified for ComputeRandaoSigningRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func(common.DomainType, math.Epoch) common.Root); ok { + r0 = rf(domainType, epoch) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// ForkData_ComputeRandaoSigningRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputeRandaoSigningRoot' +type ForkData_ComputeRandaoSigningRoot_Call[ForkDataT any] struct { + *mock.Call +} + +// ComputeRandaoSigningRoot is a helper method to define mock.On call +// - domainType common.DomainType +// - epoch math.Epoch +func (_e *ForkData_Expecter[ForkDataT]) ComputeRandaoSigningRoot(domainType interface{}, epoch interface{}) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + return &ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]{Call: _e.mock.On("ComputeRandaoSigningRoot", domainType, epoch)} +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Run(run func(domainType common.DomainType, epoch math.Epoch)) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.DomainType), args[1].(math.Epoch)) + }) + return _c +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Return(_a0 common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) RunAndReturn(run func(common.DomainType, math.Epoch) common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: _a0, _a1 +func (_m *ForkData[ForkDataT]) New(_a0 common.Version, _a1 common.Root) ForkDataT { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 ForkDataT + if rf, ok := ret.Get(0).(func(common.Version, common.Root) ForkDataT); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Get(0).(ForkDataT) + } + + return r0 +} + +// ForkData_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type ForkData_New_Call[ForkDataT any] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - _a0 common.Version +// - _a1 common.Root +func (_e *ForkData_Expecter[ForkDataT]) New(_a0 interface{}, _a1 interface{}) *ForkData_New_Call[ForkDataT] { + return &ForkData_New_Call[ForkDataT]{Call: _e.mock.On("New", _a0, _a1)} +} + +func (_c *ForkData_New_Call[ForkDataT]) Run(run func(_a0 common.Version, _a1 common.Root)) *ForkData_New_Call[ForkDataT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Version), args[1].(common.Root)) + }) + return _c +} + +func (_c *ForkData_New_Call[ForkDataT]) Return(_a0 ForkDataT) *ForkData_New_Call[ForkDataT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForkData_New_Call[ForkDataT]) RunAndReturn(run func(common.Version, common.Root) ForkDataT) *ForkData_New_Call[ForkDataT] { + _c.Call.Return(run) + return _c +} + +// NewForkData creates a new instance of ForkData. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewForkData[ForkDataT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ForkData[ForkDataT] { + mock := &ForkData[ForkDataT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go new file mode 100644 index 0000000000..d008b496f2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go @@ -0,0 +1,1326 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyBeaconState is an autogenerated mock type for the ReadOnlyBeaconState type +type ReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock.Mock +} + +type ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBalance provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBalance") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBlockRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBlockRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' +type ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1Data provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetFork provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFork") + } + + var r0 ForkT + var r1 error + if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ForkT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ForkT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' +type ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetFork is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetGenesisValidatorsRoot provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGenesisValidatorsRoot") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' +type ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetGenesisValidatorsRoot is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestBlockHeader provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestBlockHeader") + } + + var r0 BeaconBlockHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' +type ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestBlockHeader is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' +type ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalValidatorIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalValidatorIndex") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' +type ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlashingAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetSlashingAtIndex") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' +type ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + var r1 error + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalActiveBalances provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetTotalActiveBalances") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' +type ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalActiveBalances is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalSlashing provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalSlashing") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' +type ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalSlashing is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalValidators provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalValidators") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' +type ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalValidators is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidators provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidators") + } + + var r0 ValidatorsT + var r1 error + if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ValidatorsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ValidatorsT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' +type ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidators is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorsByEffectiveBalance provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorsByEffectiveBalance") + } + + var r0 []ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []ValidatorT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ValidatorT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' +type ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorsByEffectiveBalance is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { + ret := _m.Called(cometBFTAddress) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByCometBFTAddress") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + return rf(cometBFTAddress) + } + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + r0 = rf(cometBFTAddress) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(cometBFTAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' +type ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call +// - cometBFTAddress []byte +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyBeaconState creates a new instance of ReadOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + mock := &ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go new file mode 100644 index 0000000000..1956f9c88f --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go @@ -0,0 +1,197 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// ReadOnlyEth1Data is an autogenerated mock type for the ReadOnlyEth1Data type +type ReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock.Mock +} + +type ReadOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} +} + +// GetEth1Data provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 uint64, _a1 error) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyEth1Data creates a new instance of ReadOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { + mock := &ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go new file mode 100644 index 0000000000..099e28e5d2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go @@ -0,0 +1,94 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyRandaoMixes is an autogenerated mock type for the ReadOnlyRandaoMixes type +type ReadOnlyRandaoMixes struct { + mock.Mock +} + +type ReadOnlyRandaoMixes_Expecter struct { + mock *mock.Mock +} + +func (_m *ReadOnlyRandaoMixes) EXPECT() *ReadOnlyRandaoMixes_Expecter { + return &ReadOnlyRandaoMixes_Expecter{mock: &_m.Mock} +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyRandaoMixes) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyRandaoMixes_Expecter) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + return &ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyRandaoMixes creates a new instance of ReadOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyRandaoMixes(t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyRandaoMixes { + mock := &ReadOnlyRandaoMixes{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go new file mode 100644 index 0000000000..be45aad8a2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go @@ -0,0 +1,94 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyStateRoots is an autogenerated mock type for the ReadOnlyStateRoots type +type ReadOnlyStateRoots struct { + mock.Mock +} + +type ReadOnlyStateRoots_Expecter struct { + mock *mock.Mock +} + +func (_m *ReadOnlyStateRoots) EXPECT() *ReadOnlyStateRoots_Expecter { + return &ReadOnlyStateRoots_Expecter{mock: &_m.Mock} +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyStateRoots) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyStateRoots_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type ReadOnlyStateRoots_StateRootAtIndex_Call struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyStateRoots_Expecter) StateRootAtIndex(_a0 interface{}) *ReadOnlyStateRoots_StateRootAtIndex_Call { + return &ReadOnlyStateRoots_StateRootAtIndex_Call{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Return(_a0 common.Root, _a1 error) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyStateRoots creates a new instance of ReadOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyStateRoots(t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyStateRoots { + mock := &ReadOnlyStateRoots{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go new file mode 100644 index 0000000000..935e713699 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go @@ -0,0 +1,149 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyValidators is an autogenerated mock type for the ReadOnlyValidators type +type ReadOnlyValidators[ValidatorT any] struct { + mock.Mock +} + +type ReadOnlyValidators_Expecter[ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyValidators[ValidatorT]) EXPECT() *ReadOnlyValidators_Expecter[ValidatorT] { + return &ReadOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyValidators[ValidatorT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyValidators_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + return &ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *ReadOnlyValidators[ValidatorT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyValidators_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + return &ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyValidators creates a new instance of ReadOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyValidators[ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyValidators[ValidatorT] { + mock := &ReadOnlyValidators[ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go new file mode 100644 index 0000000000..82b8b930d6 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go @@ -0,0 +1,89 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// ReadOnlyWithdrawals is an autogenerated mock type for the ReadOnlyWithdrawals type +type ReadOnlyWithdrawals[WithdrawalT any] struct { + mock.Mock +} + +type ReadOnlyWithdrawals_Expecter[WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyWithdrawals[WithdrawalT]) EXPECT() *ReadOnlyWithdrawals_Expecter[WithdrawalT] { + return &ReadOnlyWithdrawals_Expecter[WithdrawalT]{mock: &_m.Mock} +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *ReadOnlyWithdrawals[WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyWithdrawals_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *ReadOnlyWithdrawals_Expecter[WithdrawalT]) ExpectedWithdrawals() *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + return &ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Run(run func()) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyWithdrawals creates a new instance of ReadOnlyWithdrawals. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyWithdrawals[WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyWithdrawals[WithdrawalT] { + mock := &ReadOnlyWithdrawals[WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/validator.mock.go b/mod/state-transition/pkg/core/mocks/validator.mock.go new file mode 100644 index 0000000000..9245a3de7a --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/validator.mock.go @@ -0,0 +1,500 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Validator is an autogenerated mock type for the Validator type +type Validator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + mock.Mock +} + +type Validator_Expecter[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + mock *mock.Mock +} + +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) EXPECT() *Validator_Expecter[ValidatorT, WithdrawalCredentialsT] { + return &Validator_Expecter[ValidatorT, WithdrawalCredentialsT]{mock: &_m.Mock} +} + +// GetEffectiveBalance provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEffectiveBalance") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Validator_GetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEffectiveBalance' +type Validator_GetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetEffectiveBalance is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetEffectiveBalance")} +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetPubkey provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetPubkey() crypto.BLSPubkey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPubkey") + } + + var r0 crypto.BLSPubkey + if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSPubkey) + } + } + + return r0 +} + +// Validator_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' +type Validator_GetPubkey_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetPubkey is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetPubkey() *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetPubkey")} +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawableEpoch provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() math.Epoch { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawableEpoch") + } + + var r0 math.Epoch + if rf, ok := ret.Get(0).(func() math.Epoch); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Epoch) + } + + return r0 +} + +// Validator_GetWithdrawableEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawableEpoch' +type Validator_GetWithdrawableEpoch_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetWithdrawableEpoch is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetWithdrawableEpoch")} +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// Validator_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type Validator_HashTreeRoot_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// IsSlashed provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) IsSlashed() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsSlashed") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Validator_IsSlashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSlashed' +type Validator_IsSlashed_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// IsSlashed is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) IsSlashed() *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("IsSlashed")} +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// MarshalSSZ provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() ([]byte, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MarshalSSZ") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Validator_MarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalSSZ' +type Validator_MarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// MarshalSSZ is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("MarshalSSZ")} +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 []byte, _a1 error) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() ([]byte, error)) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) New(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei) ValidatorT { + ret := _m.Called(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 ValidatorT + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT); ok { + r0 = rf(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + return r0 +} + +// Validator_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type Validator_New_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - pubkey crypto.BLSPubkey +// - withdrawalCredentials WithdrawalCredentialsT +// - amount math.Gwei +// - effectiveBalanceIncrement math.Gwei +// - maxEffectiveBalance math.Gwei +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) New(pubkey interface{}, withdrawalCredentials interface{}, amount interface{}, effectiveBalanceIncrement interface{}, maxEffectiveBalance interface{}) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_New_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("New", pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance)} +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei)) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey), args[1].(WithdrawalCredentialsT), args[2].(math.Gwei), args[3].(math.Gwei), args[4].(math.Gwei)) + }) + return _c +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// SetEffectiveBalance provides a mock function with given fields: _a0 +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 math.Gwei) { + _m.Called(_a0) +} + +// Validator_SetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEffectiveBalance' +type Validator_SetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// SetEffectiveBalance is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 interface{}) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SetEffectiveBalance", _a0)} +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return() *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return() + return _c +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// SizeSSZ provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SizeSSZ") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// Validator_SizeSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SizeSSZ' +type Validator_SizeSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// SizeSSZ is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SizeSSZ")} +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// UnmarshalSSZ provides a mock function with given fields: _a0 +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 []byte) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for UnmarshalSSZ") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]byte) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Validator_UnmarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalSSZ' +type Validator_UnmarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// UnmarshalSSZ is a helper method to define mock.On call +// - _a0 []byte +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 interface{}) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("UnmarshalSSZ", _a0)} +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 []byte)) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func([]byte) error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewValidator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }](t interface { + mock.TestingT + Cleanup(func()) +}) *Validator[ValidatorT, WithdrawalCredentialsT] { + mock := &Validator[ValidatorT, WithdrawalCredentialsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/validators.mock.go b/mod/state-transition/pkg/core/mocks/validators.mock.go new file mode 100644 index 0000000000..15a4fb46bc --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/validators.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// Validators is an autogenerated mock type for the Validators type +type Validators struct { + mock.Mock +} + +type Validators_Expecter struct { + mock *mock.Mock +} + +func (_m *Validators) EXPECT() *Validators_Expecter { + return &Validators_Expecter{mock: &_m.Mock} +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *Validators) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// Validators_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type Validators_HashTreeRoot_Call struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *Validators_Expecter) HashTreeRoot() *Validators_HashTreeRoot_Call { + return &Validators_HashTreeRoot_Call{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *Validators_HashTreeRoot_Call) Run(run func()) *Validators_HashTreeRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validators_HashTreeRoot_Call) Return(_a0 common.Root) *Validators_HashTreeRoot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validators_HashTreeRoot_Call) RunAndReturn(run func() common.Root) *Validators_HashTreeRoot_Call { + _c.Call.Return(run) + return _c +} + +// NewValidators creates a new instance of Validators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewValidators(t interface { + mock.TestingT + Cleanup(func()) +}) *Validators { + mock := &Validators{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go new file mode 100644 index 0000000000..e76e91136f --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go @@ -0,0 +1,266 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Withdrawal is an autogenerated mock type for the Withdrawal type +type Withdrawal[WithdrawalT any] struct { + mock.Mock +} + +type Withdrawal_Expecter[WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *Withdrawal[WithdrawalT]) EXPECT() *Withdrawal_Expecter[WithdrawalT] { + return &Withdrawal_Expecter[WithdrawalT]{mock: &_m.Mock} +} + +// Equals provides a mock function with given fields: _a0 +func (_m *Withdrawal[WithdrawalT]) Equals(_a0 WithdrawalT) bool { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Equals") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(WithdrawalT) bool); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Withdrawal_Equals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equals' +type Withdrawal_Equals_Call[WithdrawalT any] struct { + *mock.Call +} + +// Equals is a helper method to define mock.On call +// - _a0 WithdrawalT +func (_e *Withdrawal_Expecter[WithdrawalT]) Equals(_a0 interface{}) *Withdrawal_Equals_Call[WithdrawalT] { + return &Withdrawal_Equals_Call[WithdrawalT]{Call: _e.mock.On("Equals", _a0)} +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) Run(run func(_a0 WithdrawalT)) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(WithdrawalT)) + }) + return _c +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) Return(_a0 bool) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) RunAndReturn(run func(WithdrawalT) bool) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetAddress provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetAddress() common.ExecutionAddress { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAddress") + } + + var r0 common.ExecutionAddress + if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionAddress) + } + } + + return r0 +} + +// Withdrawal_GetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAddress' +type Withdrawal_GetAddress_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetAddress is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetAddress() *Withdrawal_GetAddress_Call[WithdrawalT] { + return &Withdrawal_GetAddress_Call[WithdrawalT]{Call: _e.mock.On("GetAddress")} +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Return(_a0 common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) RunAndReturn(run func() common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetAmount provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetAmount() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAmount") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Withdrawal_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' +type Withdrawal_GetAmount_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetAmount is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetAmount() *Withdrawal_GetAmount_Call[WithdrawalT] { + return &Withdrawal_GetAmount_Call[WithdrawalT]{Call: _e.mock.On("GetAmount")} +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Return(_a0 math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) RunAndReturn(run func() math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetIndex provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetIndex() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetIndex") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// Withdrawal_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex' +type Withdrawal_GetIndex_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetIndex is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetIndex() *Withdrawal_GetIndex_Call[WithdrawalT] { + return &Withdrawal_GetIndex_Call[WithdrawalT]{Call: _e.mock.On("GetIndex")} +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Return(_a0 math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) RunAndReturn(run func() math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorIndex provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetValidatorIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// Withdrawal_GetValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorIndex' +type Withdrawal_GetValidatorIndex_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorIndex is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetValidatorIndex() *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + return &Withdrawal_GetValidatorIndex_Call[WithdrawalT]{Call: _e.mock.On("GetValidatorIndex")} +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Return(_a0 math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) RunAndReturn(run func() math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewWithdrawal creates a new instance of Withdrawal. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWithdrawal[WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *Withdrawal[WithdrawalT] { + mock := &Withdrawal[WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go new file mode 100644 index 0000000000..291d70a837 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go @@ -0,0 +1,115 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + bytes "bytes" + + mock "github.com/stretchr/testify/mock" +) + +// WithdrawalsConstraint is an autogenerated mock type for the WithdrawalsConstraint type +type WithdrawalsConstraint struct { + mock.Mock +} + +type WithdrawalsConstraint_Expecter struct { + mock *mock.Mock +} + +func (_m *WithdrawalsConstraint) EXPECT() *WithdrawalsConstraint_Expecter { + return &WithdrawalsConstraint_Expecter{mock: &_m.Mock} +} + +// EncodeIndex provides a mock function with given fields: _a0, _a1 +func (_m *WithdrawalsConstraint) EncodeIndex(_a0 int, _a1 *bytes.Buffer) { + _m.Called(_a0, _a1) +} + +// WithdrawalsConstraint_EncodeIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeIndex' +type WithdrawalsConstraint_EncodeIndex_Call struct { + *mock.Call +} + +// EncodeIndex is a helper method to define mock.On call +// - _a0 int +// - _a1 *bytes.Buffer +func (_e *WithdrawalsConstraint_Expecter) EncodeIndex(_a0 interface{}, _a1 interface{}) *WithdrawalsConstraint_EncodeIndex_Call { + return &WithdrawalsConstraint_EncodeIndex_Call{Call: _e.mock.On("EncodeIndex", _a0, _a1)} +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) Run(run func(_a0 int, _a1 *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(*bytes.Buffer)) + }) + return _c +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) Return() *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Return() + return _c +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) RunAndReturn(run func(int, *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Return(run) + return _c +} + +// Len provides a mock function with given fields: +func (_m *WithdrawalsConstraint) Len() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Len") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// WithdrawalsConstraint_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' +type WithdrawalsConstraint_Len_Call struct { + *mock.Call +} + +// Len is a helper method to define mock.On call +func (_e *WithdrawalsConstraint_Expecter) Len() *WithdrawalsConstraint_Len_Call { + return &WithdrawalsConstraint_Len_Call{Call: _e.mock.On("Len")} +} + +func (_c *WithdrawalsConstraint_Len_Call) Run(run func()) *WithdrawalsConstraint_Len_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *WithdrawalsConstraint_Len_Call) Return(_a0 int) *WithdrawalsConstraint_Len_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WithdrawalsConstraint_Len_Call) RunAndReturn(run func() int) *WithdrawalsConstraint_Len_Call { + _c.Call.Return(run) + return _c +} + +// NewWithdrawalsConstraint creates a new instance of WithdrawalsConstraint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWithdrawalsConstraint(t interface { + mock.TestingT + Cleanup(func()) +}) *WithdrawalsConstraint { + mock := &WithdrawalsConstraint{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go new file mode 100644 index 0000000000..677433b90c --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go @@ -0,0 +1,919 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyBeaconState is an autogenerated mock type for the WriteOnlyBeaconState type +type WriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + mock.Mock +} + +type WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) EXPECT() *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// DecreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for DecreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' +type WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// DecreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// IncreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IncreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' +type WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// IncreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 interface{}) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetFork provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 ForkT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetFork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' +type WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetFork is a helper method to define mock.On call +// - _a0 ForkT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 interface{}) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetFork", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ForkT)) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ForkT) error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetGenesisValidatorsRoot provides a mock function with given fields: root +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root common.Root) error { + ret := _m.Called(root) + + if len(ret) == 0 { + panic("no return value specified for SetGenesisValidatorsRoot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(common.Root) error); ok { + r0 = rf(root) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' +type WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetGenesisValidatorsRoot is a helper method to define mock.On call +// - root common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root interface{}) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(root common.Root)) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(common.Root) error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetLatestBlockHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestBlockHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' +type WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetLatestBlockHeader is a helper method to define mock.On call +// - _a0 BeaconBlockHeaderT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 BeaconBlockHeaderT)) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(BeaconBlockHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' +type WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetNextWithdrawalIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalValidatorIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' +type WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetSlot provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 math.Slot) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetSlot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' +type WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetSlot is a helper method to define mock.On call +// - _a0 math.Slot +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 interface{}) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetSlot", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Slot)) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Slot) error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetTotalSlashing provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 math.Gwei) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetTotalSlashing") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' +type WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetTotalSlashing is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 interface{}) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetTotalSlashing", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Gwei)) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Gwei) error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateBlockRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' +type WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateSlashingAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' +type WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, math.Gwei) error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyBeaconState creates a new instance of WriteOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + mock := &WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go new file mode 100644 index 0000000000..a6020ec38b --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go @@ -0,0 +1,170 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// WriteOnlyEth1Data is an autogenerated mock type for the WriteOnlyEth1Data type +type WriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock.Mock +} + +type WriteOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 interface{}) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 uint64)) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(uint64) error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyEth1Data creates a new instance of WriteOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { + mock := &WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go new file mode 100644 index 0000000000..6cd16f7b52 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyRandaoMixes is an autogenerated mock type for the WriteOnlyRandaoMixes type +type WriteOnlyRandaoMixes struct { + mock.Mock +} + +type WriteOnlyRandaoMixes_Expecter struct { + mock *mock.Mock +} + +func (_m *WriteOnlyRandaoMixes) EXPECT() *WriteOnlyRandaoMixes_Expecter { + return &WriteOnlyRandaoMixes_Expecter{mock: &_m.Mock} +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyRandaoMixes) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *WriteOnlyRandaoMixes_Expecter) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + return &WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Return(_a0 error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyRandaoMixes creates a new instance of WriteOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyRandaoMixes(t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyRandaoMixes { + mock := &WriteOnlyRandaoMixes{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go new file mode 100644 index 0000000000..7349015317 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyStateRoots is an autogenerated mock type for the WriteOnlyStateRoots type +type WriteOnlyStateRoots struct { + mock.Mock +} + +type WriteOnlyStateRoots_Expecter struct { + mock *mock.Mock +} + +func (_m *WriteOnlyStateRoots) EXPECT() *WriteOnlyStateRoots_Expecter { + return &WriteOnlyStateRoots_Expecter{mock: &_m.Mock} +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyStateRoots) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyStateRoots_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type WriteOnlyStateRoots_UpdateStateRootAtIndex_Call struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyStateRoots_Expecter) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + return &WriteOnlyStateRoots_UpdateStateRootAtIndex_Call{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Return(_a0 error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyStateRoots creates a new instance of WriteOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyStateRoots(t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyStateRoots { + mock := &WriteOnlyStateRoots{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go new file mode 100644 index 0000000000..3f4d7bfcac --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go @@ -0,0 +1,174 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyValidators is an autogenerated mock type for the WriteOnlyValidators type +type WriteOnlyValidators[ValidatorT any] struct { + mock.Mock +} + +type WriteOnlyValidators_Expecter[ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyValidators[ValidatorT]) EXPECT() *WriteOnlyValidators_Expecter[ValidatorT] { + return &WriteOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *WriteOnlyValidators[ValidatorT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type WriteOnlyValidators_AddValidator_Call[ValidatorT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + return &WriteOnlyValidators_AddValidator_Call[ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *WriteOnlyValidators[ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + return &WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyValidators[ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + return &WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyValidators creates a new instance of WriteOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyValidators[ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyValidators[ValidatorT] { + mock := &WriteOnlyValidators[ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index a37cca2a1e..354f0c723a 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,11 +28,12 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -79,8 +80,13 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := &testExecutionEngine{} - mocksSigner := &mocks.BLSSigner{} + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + + mocksSigner := &cryptomocks.Blssigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 5a359344d3..6edcb5a71b 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -173,15 +173,18 @@ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } +// WithdrawalsConstraint is the interface for withdrawals constraint. +type WithdrawalsConstraint interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) +} + // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) - }, + WithdrawalsT WithdrawalsConstraint, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. diff --git a/mod/storage/pkg/filedb/range_db_test.go b/mod/storage/pkg/filedb/range_db_test.go index 51334ce806..b0e33eddf2 100644 --- a/mod/storage/pkg/filedb/range_db_test.go +++ b/mod/storage/pkg/filedb/range_db_test.go @@ -197,11 +197,11 @@ func TestExtractIndex(t *testing.T) { func TestRangeDB_DeleteRange_NotSupported(t *testing.T) { tests := []struct { name string - db *mocks.DB + db *mocks.Db }{ { name: "DeleteRangeNotSupported", - db: new(mocks.DB), + db: new(mocks.Db), }, } diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index 97c0431b20..e076d6ed35 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -4,21 +4,21 @@ package mocks import mock "github.com/stretchr/testify/mock" -// DB is an autogenerated mock type for the DB type -type DB struct { +// Db is an autogenerated mock type for the DB type +type Db struct { mock.Mock } -type DB_Expecter struct { +type Db_Expecter struct { mock *mock.Mock } -func (_m *DB) EXPECT() *DB_Expecter { - return &DB_Expecter{mock: &_m.Mock} +func (_m *Db) EXPECT() *Db_Expecter { + return &Db_Expecter{mock: &_m.Mock} } // Delete provides a mock function with given fields: key -func (_m *DB) Delete(key []byte) error { +func (_m *Db) Delete(key []byte) error { ret := _m.Called(key) if len(ret) == 0 { @@ -35,36 +35,36 @@ func (_m *DB) Delete(key []byte) error { return r0 } -// DB_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type DB_Delete_Call struct { +// Db_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Db_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Delete(key interface{}) *DB_Delete_Call { - return &DB_Delete_Call{Call: _e.mock.On("Delete", key)} +func (_e *Db_Expecter) Delete(key interface{}) *Db_Delete_Call { + return &Db_Delete_Call{Call: _e.mock.On("Delete", key)} } -func (_c *DB_Delete_Call) Run(run func(key []byte)) *DB_Delete_Call { +func (_c *Db_Delete_Call) Run(run func(key []byte)) *Db_Delete_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Delete_Call) Return(_a0 error) *DB_Delete_Call { +func (_c *Db_Delete_Call) Return(_a0 error) *Db_Delete_Call { _c.Call.Return(_a0) return _c } -func (_c *DB_Delete_Call) RunAndReturn(run func([]byte) error) *DB_Delete_Call { +func (_c *Db_Delete_Call) RunAndReturn(run func([]byte) error) *Db_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function with given fields: key -func (_m *DB) Get(key []byte) ([]byte, error) { +func (_m *Db) Get(key []byte) ([]byte, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -93,36 +93,36 @@ func (_m *DB) Get(key []byte) ([]byte, error) { return r0, r1 } -// DB_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type DB_Get_Call struct { +// Db_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Db_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Get(key interface{}) *DB_Get_Call { - return &DB_Get_Call{Call: _e.mock.On("Get", key)} +func (_e *Db_Expecter) Get(key interface{}) *Db_Get_Call { + return &Db_Get_Call{Call: _e.mock.On("Get", key)} } -func (_c *DB_Get_Call) Run(run func(key []byte)) *DB_Get_Call { +func (_c *Db_Get_Call) Run(run func(key []byte)) *Db_Get_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Get_Call) Return(_a0 []byte, _a1 error) *DB_Get_Call { +func (_c *Db_Get_Call) Return(_a0 []byte, _a1 error) *Db_Get_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *DB_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *DB_Get_Call { +func (_c *Db_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *Db_Get_Call { _c.Call.Return(run) return _c } // Has provides a mock function with given fields: key -func (_m *DB) Has(key []byte) (bool, error) { +func (_m *Db) Has(key []byte) (bool, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -149,36 +149,36 @@ func (_m *DB) Has(key []byte) (bool, error) { return r0, r1 } -// DB_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' -type DB_Has_Call struct { +// Db_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Db_Has_Call struct { *mock.Call } // Has is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Has(key interface{}) *DB_Has_Call { - return &DB_Has_Call{Call: _e.mock.On("Has", key)} +func (_e *Db_Expecter) Has(key interface{}) *Db_Has_Call { + return &Db_Has_Call{Call: _e.mock.On("Has", key)} } -func (_c *DB_Has_Call) Run(run func(key []byte)) *DB_Has_Call { +func (_c *Db_Has_Call) Run(run func(key []byte)) *Db_Has_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Has_Call) Return(_a0 bool, _a1 error) *DB_Has_Call { +func (_c *Db_Has_Call) Return(_a0 bool, _a1 error) *Db_Has_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *DB_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *DB_Has_Call { +func (_c *Db_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *Db_Has_Call { _c.Call.Return(run) return _c } // Set provides a mock function with given fields: key, value -func (_m *DB) Set(key []byte, value []byte) error { +func (_m *Db) Set(key []byte, value []byte) error { ret := _m.Called(key, value) if len(ret) == 0 { @@ -195,42 +195,42 @@ func (_m *DB) Set(key []byte, value []byte) error { return r0 } -// DB_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' -type DB_Set_Call struct { +// Db_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' +type Db_Set_Call struct { *mock.Call } // Set is a helper method to define mock.On call // - key []byte // - value []byte -func (_e *DB_Expecter) Set(key interface{}, value interface{}) *DB_Set_Call { - return &DB_Set_Call{Call: _e.mock.On("Set", key, value)} +func (_e *Db_Expecter) Set(key interface{}, value interface{}) *Db_Set_Call { + return &Db_Set_Call{Call: _e.mock.On("Set", key, value)} } -func (_c *DB_Set_Call) Run(run func(key []byte, value []byte)) *DB_Set_Call { +func (_c *Db_Set_Call) Run(run func(key []byte, value []byte)) *Db_Set_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte), args[1].([]byte)) }) return _c } -func (_c *DB_Set_Call) Return(_a0 error) *DB_Set_Call { +func (_c *Db_Set_Call) Return(_a0 error) *Db_Set_Call { _c.Call.Return(_a0) return _c } -func (_c *DB_Set_Call) RunAndReturn(run func([]byte, []byte) error) *DB_Set_Call { +func (_c *Db_Set_Call) RunAndReturn(run func([]byte, []byte) error) *Db_Set_Call { _c.Call.Return(run) return _c } -// NewDB creates a new instance of DB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewDb creates a new instance of Db. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewDB(t interface { +func NewDb(t interface { mock.TestingT Cleanup(func()) -}) *DB { - mock := &DB{} +}) *Db { + mock := &Db{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) From 151a53399057b7146a64c11c8709a199c04ee87e Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 13:21:08 +0530 Subject: [PATCH 39/51] Revert "tests for helpers in state transition using mock" This reverts commit 099716dbbf3b190b5622493a85a3279fd3b27821. --- .mockery.yaml | 5 - .../pkg/types/deposit_message_test.go | 2 +- .../mocks/blobs_bundle.mock.go | 13 +- .../mocks/built_execution_payload_env.mock.go | 16 +- .../backend/mocks/availability_store.mock.go | 24 +- .../backend/mocks/beacon_block_header.mock.go | 38 +- .../backend/mocks/beacon_state.mock.go | 164 +- .../backend/mocks/block_store.mock.go | 42 +- .../backend/mocks/state_processor.mock.go | 16 +- mod/node-api/backend/mocks/validator.mock.go | 28 +- mod/node-api/backend/mocks/withdrawal.mock.go | 14 +- .../pkg/crypto/mocks/bls_signer.mock.go | 66 +- mod/state-transition/pkg/core/helpers_test.go | 43 +- .../pkg/core/mocks/beacon_block.mock.go | 313 --- .../pkg/core/mocks/beacon_block_body.mock.go | 320 --- .../core/mocks/beacon_block_header.mock.go | 399 --- .../pkg/core/mocks/beacon_state.mock.go | 2395 ----------------- .../pkg/core/mocks/context.mock.go | 411 --- .../pkg/core/mocks/deposit.mock.go | 225 -- .../pkg/core/mocks/execution_engine.mock.go | 86 - .../pkg/core/mocks/execution_payload.mock.go | 1122 -------- .../mocks/execution_payload_header.mock.go | 83 - .../pkg/core/mocks/fork_data.mock.go | 134 - .../core/mocks/read_only_beacon_state.mock.go | 1326 --------- .../core/mocks/read_only_eth_1_data.mock.go | 197 -- .../core/mocks/read_only_randao_mixes.mock.go | 94 - .../core/mocks/read_only_state_roots.mock.go | 94 - .../core/mocks/read_only_validators.mock.go | 149 - .../core/mocks/read_only_withdrawals.mock.go | 89 - .../pkg/core/mocks/validator.mock.go | 500 ---- .../pkg/core/mocks/validators.mock.go | 83 - .../pkg/core/mocks/withdrawal.mock.go | 266 -- .../core/mocks/withdrawals_constraint.mock.go | 115 - .../mocks/write_only_beacon_state.mock.go | 919 ------- .../core/mocks/write_only_eth_1_data.mock.go | 170 -- .../mocks/write_only_randao_mixes.mock.go | 83 - .../core/mocks/write_only_state_roots.mock.go | 83 - .../core/mocks/write_only_validators.mock.go | 174 -- .../pkg/core/state_processor_genesis_test.go | 12 +- mod/state-transition/pkg/core/types.go | 11 +- mod/storage/pkg/filedb/range_db_test.go | 4 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 82 +- 42 files changed, 272 insertions(+), 10138 deletions(-) delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/context.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/deposit.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_payload.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/fork_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_validators.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/validator.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/validators.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/withdrawal.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_validators.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index dbbc916112..6062236306 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,8 +68,3 @@ packages: recursive: False with-expecter: true all: True - github.com/berachain/beacon-kit/mod/state-transition/pkg/core: - config: - recursive: False - with-expecter: true - all: True diff --git a/mod/consensus-types/pkg/types/deposit_message_test.go b/mod/consensus-types/pkg/types/deposit_message_test.go index 02cd17ab7b..66e4f89a3d 100644 --- a/mod/consensus-types/pkg/types/deposit_message_test.go +++ b/mod/consensus-types/pkg/types/deposit_message_test.go @@ -44,7 +44,7 @@ func TestCreateAndSignDepositMessage(t *testing.T) { 0x01, 0x00, 0x00, 0x00, } - mocksSigner := &mocks.Blssigner{} + mocksSigner := &mocks.BLSSigner{} mocksSigner.On("PublicKey").Return(crypto.BLSPubkey{}) mocksSigner.On("Sign", mock.Anything).Return(crypto.BLSSignature{}, nil) diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go index 688aad3a39..94ad0fad6e 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go @@ -3,6 +3,7 @@ package mocks import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" mock "github.com/stretchr/testify/mock" @@ -116,19 +117,19 @@ func (_c *BlobsBundle_GetCommitments_Call) RunAndReturn(run func() []eip4844.KZG } // GetProofs provides a mock function with given fields: -func (_m *BlobsBundle) GetProofs() []eip4844.KZGProof { +func (_m *BlobsBundle) GetProofs() []bytes.B48 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProofs") } - var r0 []eip4844.KZGProof - if rf, ok := ret.Get(0).(func() []eip4844.KZGProof); ok { + var r0 []bytes.B48 + if rf, ok := ret.Get(0).(func() []bytes.B48); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]eip4844.KZGProof) + r0 = ret.Get(0).([]bytes.B48) } } @@ -152,12 +153,12 @@ func (_c *BlobsBundle_GetProofs_Call) Run(run func()) *BlobsBundle_GetProofs_Cal return _c } -func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []bytes.B48) *BlobsBundle_GetProofs_Call { _c.Call.Return(_a0) return _c } -func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []bytes.B48) *BlobsBundle_GetProofs_Call { _c.Call.Return(run) return _c } diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go index 01235c4ba2..0ec103484e 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go @@ -4,9 +4,9 @@ package mocks import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - mock "github.com/stretchr/testify/mock" + + uint256 "github.com/holiman/uint256" ) // BuiltExecutionPayloadEnv is an autogenerated mock type for the BuiltExecutionPayloadEnv type @@ -115,19 +115,19 @@ func (_c *BuiltExecutionPayloadEnv_GetExecutionPayload_Call[ExecutionPayloadT]) } // GetValue provides a mock function with given fields: -func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *math.U256 { +func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *uint256.Int { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetValue") } - var r0 *math.U256 - if rf, ok := ret.Get(0).(func() *math.U256); ok { + var r0 *uint256.Int + if rf, ok := ret.Get(0).(func() *uint256.Int); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*math.U256) + r0 = ret.Get(0).(*uint256.Int) } } @@ -151,12 +151,12 @@ func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Run(run fun return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(_a0) return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 784cdda804..17d2d80e87 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -23,7 +23,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) EXPECT() *Availabi } // IsDataAvailable provides a mock function with given fields: _a0, _a1, _a2 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT) bool { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT) bool { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a } var r0 bool - if rf, ok := ret.Get(0).(func(context.Context, math.Slot, BeaconBlockBodyT) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, math.U64, BeaconBlockBodyT) bool); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(bool) @@ -47,15 +47,15 @@ type AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT any, BlobSidecarsT // IsDataAvailable is a helper method to define mock.On call // - _a0 context.Context -// - _a1 math.Slot +// - _a1 math.U64 // - _a2 BeaconBlockBodyT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("IsDataAvailable", _a0, _a1, _a2)} } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(math.Slot), args[2].(BeaconBlockBodyT)) + run(args[0].(context.Context), args[1].(math.U64), args[2].(BeaconBlockBodyT)) }) return _c } @@ -65,13 +65,13 @@ func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT return _c } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.Slot, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.U64, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } // Persist provides a mock function with given fields: _a0, _a1 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.Slot, _a1 BlobSidecarsT) error { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U64, _a1 BlobSidecarsT) error { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -79,7 +79,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.S } var r0 error - if rf, ok := ret.Get(0).(func(math.Slot, BlobSidecarsT) error); ok { + if rf, ok := ret.Get(0).(func(math.U64, BlobSidecarsT) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -94,15 +94,15 @@ type AvailabilityStore_Persist_Call[BeaconBlockBodyT any, BlobSidecarsT any] str } // Persist is a helper method to define mock.On call -// - _a0 math.Slot +// - _a0 math.U64 // - _a1 BlobSidecarsT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 interface{}, _a1 interface{}) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("Persist", _a0, _a1)} } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.Slot, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.U64, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(BlobSidecarsT)) + run(args[0].(math.U64), args[1].(BlobSidecarsT)) }) return _c } @@ -112,7 +112,7 @@ func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Retur return _c } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.Slot, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.U64, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_block_header.mock.go b/mod/node-api/backend/mocks/beacon_block_header.mock.go index 5e019b5821..c9d0cd0b6d 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -117,18 +117,18 @@ func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndR } // GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.U64 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProposerIndex") } - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } return r0 @@ -151,29 +151,29 @@ func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run f return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.U64 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } return r0 @@ -196,12 +196,12 @@ func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *B return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } @@ -358,7 +358,7 @@ func (_c *BeaconBlockHeader_MarshalSSZ_Call[BeaconBlockHeaderT]) RunAndReturn(ru } // New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) if len(ret) == 0 { @@ -366,7 +366,7 @@ func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerInd } var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) } else { r0 = ret.Get(0).(BeaconBlockHeaderT) @@ -381,8 +381,8 @@ type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { } // New is a helper method to define mock.On call -// - slot math.Slot -// - proposerIndex math.ValidatorIndex +// - slot math.U64 +// - proposerIndex math.U64 // - parentBlockRoot common.Root // - stateRoot common.Root // - bodyRoot common.Root @@ -390,9 +390,9 @@ func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + run(args[0].(math.U64), args[1].(math.U64), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) }) return _c } @@ -402,7 +402,7 @@ func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlock return _c } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 1f9fdf1302..184d2d7024 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -3,7 +3,9 @@ package mocks import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -82,25 +84,25 @@ func (_c *BeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, Ex } // GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.U64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetBalance") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + if rf, ok := ret.Get(1).(func(math.U64) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -115,24 +117,24 @@ type BeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, Executio } // GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) + run(args[0].(math.U64)) }) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -583,22 +585,22 @@ func (_c *BeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, } // GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetNextWithdrawalValidatorIndex") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -627,34 +629,34 @@ func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (bytes.B32, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetRandaoMixAtIndex") } - var r0 common.Bytes32 + var r0 bytes.B32 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (bytes.B32, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + if rf, ok := ret.Get(0).(func(uint64) bytes.B32); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) + r0 = ret.Get(0).(bytes.B32) } } @@ -685,33 +687,33 @@ func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Ex return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 bytes.B32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (bytes.B32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetSlashingAtIndex") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -741,33 +743,33 @@ func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Exe return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.Slot); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -796,33 +798,33 @@ func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetTotalActiveBalances") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -852,33 +854,33 @@ func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetTotalSlashing") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -907,12 +909,12 @@ func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1085,7 +1087,7 @@ func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, E } // SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.U64) error { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1093,7 +1095,7 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo } var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + if rf, ok := ret.Get(0).(func(math.U64) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -1108,14 +1110,14 @@ type BeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPa } // SetSlot is a helper method to define mock.On call -// - _a0 math.Slot +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) + run(args[0].(math.U64)) }) return _c } @@ -1125,7 +1127,7 @@ func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1189,7 +1191,7 @@ func (_c *BeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu } // ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.U64) (ValidatorT, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1198,16 +1200,16 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo var r0 ValidatorT var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (ValidatorT, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + if rf, ok := ret.Get(0).(func(math.U64) ValidatorT); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ValidatorT) } - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + if rf, ok := ret.Get(1).(func(math.U64) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -1222,14 +1224,14 @@ type BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, Ex } // ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) + run(args[0].(math.U64)) }) return _c } @@ -1239,28 +1241,28 @@ func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.U64, error) { ret := _m.Called(cometBFTAddress) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByCometBFTAddress") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func([]byte) (math.U64, error)); ok { return rf(cometBFTAddress) } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func([]byte) math.U64); ok { r0 = rf(cometBFTAddress) } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func([]byte) error); ok { @@ -1290,33 +1292,33 @@ func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.U64, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByPubkey") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { @@ -1346,12 +1348,12 @@ func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.U64, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 74f3b716a2..4e532a619f 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -23,22 +23,22 @@ func (_m *BlockStore[BeaconBlockT]) EXPECT() *BlockStore_Expecter[BeaconBlockT] } // GetParentSlotByTimestamp provides a mock function with given fields: timestamp -func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.U64, error) { ret := _m.Called(timestamp) if len(ret) == 0 { panic("no return value specified for GetParentSlotByTimestamp") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { return rf(timestamp) } - if rf, ok := ret.Get(0).(func(math.U64) math.Slot); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { r0 = rf(timestamp) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(math.U64) error); ok { @@ -68,33 +68,33 @@ func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Run(run func(t return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.Slot, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByBlockRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.U64, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByBlockRoot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -124,33 +124,33 @@ func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByStateRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.U64, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByStateRoot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -180,12 +180,12 @@ func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index 7dcf5f3002..a7103536ed 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -23,7 +23,7 @@ func (_m *StateProcessor[BeaconStateT]) EXPECT() *StateProcessor_Expecter[Beacon } // ProcessSlots provides a mock function with given fields: _a0, _a1 -func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.Slot) (transition.ValidatorUpdates, error) { +func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.U64) (transition.ValidatorUpdates, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -32,10 +32,10 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. var r0 transition.ValidatorUpdates var r1 error - if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) transition.ValidatorUpdates); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) transition.ValidatorUpdates); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -43,7 +43,7 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. } } - if rf, ok := ret.Get(1).(func(BeaconStateT, math.Slot) error); ok { + if rf, ok := ret.Get(1).(func(BeaconStateT, math.U64) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -59,14 +59,14 @@ type StateProcessor_ProcessSlots_Call[BeaconStateT any] struct { // ProcessSlots is a helper method to define mock.On call // - _a0 BeaconStateT -// - _a1 math.Slot +// - _a1 math.U64 func (_e *StateProcessor_Expecter[BeaconStateT]) ProcessSlots(_a0 interface{}, _a1 interface{}) *StateProcessor_ProcessSlots_Call[BeaconStateT] { return &StateProcessor_ProcessSlots_Call[BeaconStateT]{Call: _e.mock.On("ProcessSlots", _a0, _a1)} } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.Slot)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.U64)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconStateT), args[1].(math.Slot)) + run(args[0].(BeaconStateT), args[1].(math.U64)) }) return _c } @@ -76,7 +76,7 @@ func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Return(_a0 transition. return _c } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 655e2123b2..73404aa0d7 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -68,7 +68,7 @@ func (_c *Validator_GetWithdrawalCredentials_Call[WithdrawalCredentialsT]) RunAn } // IsFullyWithdrawable provides a mock function with given fields: amount, epoch -func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwei, epoch math.Epoch) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64, epoch math.U64) bool { ret := _m.Called(amount, epoch) if len(ret) == 0 { @@ -76,7 +76,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwe } var r0 bool - if rf, ok := ret.Get(0).(func(math.Gwei, math.Epoch) bool); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { r0 = rf(amount, epoch) } else { r0 = ret.Get(0).(bool) @@ -91,15 +91,15 @@ type Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT backend.Withdrawa } // IsFullyWithdrawable is a helper method to define mock.On call -// - amount math.Gwei -// - epoch math.Epoch +// - amount math.U64 +// - epoch math.U64 func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsFullyWithdrawable(amount interface{}, epoch interface{}) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsFullyWithdrawable", amount, epoch)} } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.Gwei, epoch math.Epoch)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.U64, epoch math.U64)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei), args[1].(math.Epoch)) + run(args[0].(math.U64), args[1].(math.U64)) }) return _c } @@ -109,13 +109,13 @@ func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Return(_a0 return _c } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Epoch) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } // IsPartiallyWithdrawable provides a mock function with given fields: amount1, amount2 -func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.Gwei, amount2 math.Gwei) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.U64, amount2 math.U64) bool { ret := _m.Called(amount1, amount2) if len(ret) == 0 { @@ -123,7 +123,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 mat } var r0 bool - if rf, ok := ret.Get(0).(func(math.Gwei, math.Gwei) bool); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { r0 = rf(amount1, amount2) } else { r0 = ret.Get(0).(bool) @@ -138,15 +138,15 @@ type Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT backend.Withd } // IsPartiallyWithdrawable is a helper method to define mock.On call -// - amount1 math.Gwei -// - amount2 math.Gwei +// - amount1 math.U64 +// - amount2 math.U64 func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 interface{}, amount2 interface{}) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsPartiallyWithdrawable", amount1, amount2)} } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.Gwei, amount2 math.Gwei)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.U64, amount2 math.U64)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei), args[1].(math.Gwei)) + run(args[0].(math.U64), args[1].(math.U64)) }) return _c } @@ -156,7 +156,7 @@ func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Return return _c } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Gwei) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index 72fd41fa44..d7dbcb6747 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -23,7 +23,7 @@ func (_m *Withdrawal[T]) EXPECT() *Withdrawal_Expecter[T] { } // New provides a mock function with given fields: index, validator, address, amount -func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei) T { +func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64) T { ret := _m.Called(index, validator, address, amount) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, addr } var r0 T - if rf, ok := ret.Get(0).(func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.ExecutionAddress, math.U64) T); ok { r0 = rf(index, validator, address, amount) } else { r0 = ret.Get(0).(T) @@ -47,16 +47,16 @@ type Withdrawal_New_Call[T any] struct { // New is a helper method to define mock.On call // - index math.U64 -// - validator math.ValidatorIndex +// - validator math.U64 // - address common.ExecutionAddress -// - amount math.Gwei +// - amount math.U64 func (_e *Withdrawal_Expecter[T]) New(index interface{}, validator interface{}, address interface{}, amount interface{}) *Withdrawal_New_Call[T] { return &Withdrawal_New_Call[T]{Call: _e.mock.On("New", index, validator, address, amount)} } -func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei)) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64)) *Withdrawal_New_Call[T] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.ValidatorIndex), args[2].(common.ExecutionAddress), args[3].(math.Gwei)) + run(args[0].(math.U64), args[1].(math.U64), args[2].(common.ExecutionAddress), args[3].(math.U64)) }) return _c } @@ -66,7 +66,7 @@ func (_c *Withdrawal_New_Call[T]) Return(_a0 T) *Withdrawal_New_Call[T] { return _c } -func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.U64, common.ExecutionAddress, math.U64) T) *Withdrawal_New_Call[T] { _c.Call.Return(run) return _c } diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index a9e52cb133..4ea1d83c10 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -7,21 +7,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// Blssigner is an autogenerated mock type for the BLSSigner type -type Blssigner struct { +// BLSSigner is an autogenerated mock type for the BLSSigner type +type BLSSigner struct { mock.Mock } -type Blssigner_Expecter struct { +type BLSSigner_Expecter struct { mock *mock.Mock } -func (_m *Blssigner) EXPECT() *Blssigner_Expecter { - return &Blssigner_Expecter{mock: &_m.Mock} +func (_m *BLSSigner) EXPECT() *BLSSigner_Expecter { + return &BLSSigner_Expecter{mock: &_m.Mock} } // PublicKey provides a mock function with given fields: -func (_m *Blssigner) PublicKey() crypto.BLSPubkey { +func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { ret := _m.Called() if len(ret) == 0 { @@ -40,35 +40,35 @@ func (_m *Blssigner) PublicKey() crypto.BLSPubkey { return r0 } -// Blssigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' -type Blssigner_PublicKey_Call struct { +// BLSSigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' +type BLSSigner_PublicKey_Call struct { *mock.Call } // PublicKey is a helper method to define mock.On call -func (_e *Blssigner_Expecter) PublicKey() *Blssigner_PublicKey_Call { - return &Blssigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} +func (_e *BLSSigner_Expecter) PublicKey() *BLSSigner_PublicKey_Call { + return &BLSSigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} } -func (_c *Blssigner_PublicKey_Call) Run(run func()) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) Run(run func()) *BLSSigner_PublicKey_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } -func (_c *Blssigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *BLSSigner_PublicKey_Call { _c.Call.Return(_a0) return _c } -func (_c *Blssigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *BLSSigner_PublicKey_Call { _c.Call.Return(run) return _c } // Sign provides a mock function with given fields: _a0 -func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { +func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -97,36 +97,36 @@ func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { return r0, r1 } -// Blssigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' -type Blssigner_Sign_Call struct { +// BLSSigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type BLSSigner_Sign_Call struct { *mock.Call } // Sign is a helper method to define mock.On call // - _a0 []byte -func (_e *Blssigner_Expecter) Sign(_a0 interface{}) *Blssigner_Sign_Call { - return &Blssigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} +func (_e *BLSSigner_Expecter) Sign(_a0 interface{}) *BLSSigner_Sign_Call { + return &BLSSigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} } -func (_c *Blssigner_Sign_Call) Run(run func(_a0 []byte)) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) Run(run func(_a0 []byte)) *BLSSigner_Sign_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Blssigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *BLSSigner_Sign_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Blssigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *BLSSigner_Sign_Call { _c.Call.Return(run) return _c } // VerifySignature provides a mock function with given fields: pubKey, msg, signature -func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { +func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { ret := _m.Called(pubKey, msg, signature) if len(ret) == 0 { @@ -143,8 +143,8 @@ func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signat return r0 } -// Blssigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type Blssigner_VerifySignature_Call struct { +// BLSSigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type BLSSigner_VerifySignature_Call struct { *mock.Call } @@ -152,34 +152,34 @@ type Blssigner_VerifySignature_Call struct { // - pubKey crypto.BLSPubkey // - msg []byte // - signature crypto.BLSSignature -func (_e *Blssigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *Blssigner_VerifySignature_Call { - return &Blssigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} +func (_e *BLSSigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *BLSSigner_VerifySignature_Call { + return &BLSSigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} } -func (_c *Blssigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *BLSSigner_VerifySignature_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(crypto.BLSPubkey), args[1].([]byte), args[2].(crypto.BLSSignature)) }) return _c } -func (_c *Blssigner_VerifySignature_Call) Return(_a0 error) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) Return(_a0 error) *BLSSigner_VerifySignature_Call { _c.Call.Return(_a0) return _c } -func (_c *Blssigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *BLSSigner_VerifySignature_Call { _c.Call.Return(run) return _c } -// NewBlssigner creates a new instance of Blssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewBLSSigner creates a new instance of BLSSigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewBlssigner(t interface { +func NewBLSSigner(t interface { mock.TestingT Cleanup(func()) -}) *Blssigner { - mock := &Blssigner{} +}) *BLSSigner { + mock := &BLSSigner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index b982800a67..1631830784 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,7 +23,6 @@ package core_test import ( "context" "fmt" - "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -33,48 +32,24 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) -func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { - mockEngine := mocks.NewExecutionEngine[ +// TODO: replace with proper mock +type testExecutionEngine struct{} + +func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( + _ context.Context, + _ *engineprimitives.NewPayloadRequest[ *types.ExecutionPayload, - *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ](t) - - t.Run("successful verification with complete payload", func(t *testing.T) { - req := &engineprimitives.NewPayloadRequest[ - *types.ExecutionPayload, - engineprimitives.Withdrawals, - ]{ - ExecutionPayload: &types.ExecutionPayload{}, - VersionedHashes: []common.ExecutionHash{ - {0x1}, - {0x2}, - }, - ParentBeaconBlockRoot: &common.Root{0x3}, - Optimistic: false, - } - - // Set up expectation for successful verification - mockEngine.EXPECT(). - VerifyAndNotifyNewPayload( - context.Background(), - req, - ). - Return(nil) - - err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) - require.NoError(t, err) - }) + ], +) error { + return nil } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go deleted file mode 100644 index 9b7182a9b9..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlock is an autogenerated mock type for the BeaconBlock type -type BeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock.Mock -} - -type BeaconBlock_Expecter[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// GetBody provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() BeaconBlockBodyT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBody") - } - - var r0 BeaconBlockBodyT - if rf, ok := ret.Get(0).(func() BeaconBlockBodyT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockBodyT) - } - - return r0 -} - -// BeaconBlock_GetBody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBody' -type BeaconBlock_GetBody_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetBody is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBody")} -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetParentBlockRoot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentBlockRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlock_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' -type BeaconBlock_GetParentBlockRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetParentBlockRoot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentBlockRoot")} -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetProposerIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// BeaconBlock_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' -type BeaconBlock_GetProposerIndex_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetProposerIndex is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetProposerIndex")} -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() math.Slot { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - return r0 -} - -// BeaconBlock_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconBlock_GetSlot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlock_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type BeaconBlock_GetStateRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// IsNil provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsNil") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// BeaconBlock_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' -type BeaconBlock_IsNil_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// IsNil is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlock creates a new instance of BeaconBlock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go deleted file mode 100644 index cc750bf211..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go +++ /dev/null @@ -1,320 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlockBody is an autogenerated mock type for the BeaconBlockBody type -type BeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock.Mock -} - -type BeaconBlockBody_Expecter[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// Empty provides a mock function with given fields: _a0 -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) BeaconBlockBodyT { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Empty") - } - - var r0 BeaconBlockBodyT - if rf, ok := ret.Get(0).(func(uint32) BeaconBlockBodyT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(BeaconBlockBodyT) - } - - return r0 -} - -// BeaconBlockBody_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' -type BeaconBlockBody_Empty_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// Empty is a helper method to define mock.On call -// - _a0 uint32 -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) - }) - return _c -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlobKzgCommitments provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() eip4844.KZGCommitments[common.ExecutionHash] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlobKzgCommitments") - } - - var r0 eip4844.KZGCommitments[common.ExecutionHash] - if rf, ok := ret.Get(0).(func() eip4844.KZGCommitments[common.ExecutionHash]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(eip4844.KZGCommitments[common.ExecutionHash]) - } - } - - return r0 -} - -// BeaconBlockBody_GetBlobKzgCommitments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobKzgCommitments' -type BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlobKzgCommitments is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobKzgCommitments")} -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetDeposits provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() []DepositT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDeposits") - } - - var r0 []DepositT - if rf, ok := ret.Get(0).(func() []DepositT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]DepositT) - } - } - - return r0 -} - -// BeaconBlockBody_GetDeposits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeposits' -type BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetDeposits is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetDeposits")} -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExecutionPayload provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() ExecutionPayloadT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExecutionPayload") - } - - var r0 ExecutionPayloadT - if rf, ok := ret.Get(0).(func() ExecutionPayloadT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadT) - } - - return r0 -} - -// BeaconBlockBody_GetExecutionPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionPayload' -type BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetExecutionPayload is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExecutionPayload")} -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoReveal provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() crypto.BLSSignature { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetRandaoReveal") - } - - var r0 crypto.BLSSignature - if rf, ok := ret.Get(0).(func() crypto.BLSSignature); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSSignature) - } - } - - return r0 -} - -// BeaconBlockBody_GetRandaoReveal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoReveal' -type BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetRandaoReveal is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetRandaoReveal")} -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockBody_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlockBody creates a new instance of BeaconBlockBody. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go deleted file mode 100644 index e8353c6e6d..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlockHeader is an autogenerated mock type for the BeaconBlockHeader type -type BeaconBlockHeader[BeaconBlockHeaderT any] struct { - mock.Mock -} - -type BeaconBlockHeader_Expecter[BeaconBlockHeaderT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) EXPECT() *BeaconBlockHeader_Expecter[BeaconBlockHeaderT] { - return &BeaconBlockHeader_Expecter[BeaconBlockHeaderT]{mock: &_m.Mock} -} - -// GetBodyRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetBodyRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBodyRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetBodyRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBodyRoot' -type BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetBodyRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetBodyRoot() *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetBodyRoot")} -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetParentBlockRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetParentBlockRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentBlockRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' -type BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetParentBlockRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetParentBlockRoot() *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetParentBlockRoot")} -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetProposerIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// BeaconBlockHeader_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' -type BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetProposerIndex is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetProposerIndex() *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetProposerIndex")} -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - return r0 -} - -// BeaconBlockHeader_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetSlot() *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetStateRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetStateRoot() *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) HashTreeRoot() *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { - ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { - r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - return r0 -} - -// BeaconBlockHeader_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - slot math.Slot -// - proposerIndex math.ValidatorIndex -// - parentBlockRoot common.Root -// - stateRoot common.Root -// - bodyRoot common.Root -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, proposerIndex interface{}, parentBlockRoot interface{}, stateRoot interface{}, bodyRoot interface{}) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) - }) - return _c -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetStateRoot provides a mock function with given fields: _a0 -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) SetStateRoot(_a0 common.Root) { - _m.Called(_a0) -} - -// BeaconBlockHeader_SetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStateRoot' -type BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// SetStateRoot is a helper method to define mock.On call -// - _a0 common.Root -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) SetStateRoot(_a0 interface{}) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("SetStateRoot", _a0)} -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Run(run func(_a0 common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Return() *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return() - return _c -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func(common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlockHeader creates a new instance of BeaconBlockHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlockHeader[BeaconBlockHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlockHeader[BeaconBlockHeaderT] { - mock := &BeaconBlockHeader[BeaconBlockHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go deleted file mode 100644 index c857192228..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go +++ /dev/null @@ -1,2395 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconState is an autogenerated mock type for the BeaconState type -type BeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock.Mock -} - -type BeaconState_Expecter[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type BeaconState_AddValidator_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 interface{}) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type BeaconState_AddValidatorBartio_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 interface{}) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// Context provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() context.Context { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Context") - } - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// BeaconState_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' -type BeaconState_Context_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// Context is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Context")} -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// Copy provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() T { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Copy") - } - - var r0 T - if rf, ok := ret.Get(0).(func() T); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(T) - } - - return r0 -} - -// BeaconState_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' -type BeaconState_Copy_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// Copy is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Copy")} -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// DecreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for DecreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' -type BeaconState_DecreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// DecreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type BeaconState_ExpectedWithdrawals_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBalance") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' -type BeaconState_GetBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBlockRootAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBlockRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' -type BeaconState_GetBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1Data provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type BeaconState_GetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type BeaconState_GetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetFork provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFork") - } - - var r0 ForkT - var r1 error - if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ForkT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ForkT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' -type BeaconState_GetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetFork is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetGenesisValidatorsRoot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGenesisValidatorsRoot") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' -type BeaconState_GetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetGenesisValidatorsRoot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestBlockHeader provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestBlockHeader") - } - - var r0 BeaconBlockHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' -type BeaconState_GetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestBlockHeader is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type BeaconState_GetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' -type BeaconState_GetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalValidatorIndex") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' -type BeaconState_GetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type BeaconState_GetRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetSlashingAtIndex") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' -type BeaconState_GetSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconState_GetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetTotalActiveBalances") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' -type BeaconState_GetTotalActiveBalances_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalActiveBalances is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalSlashing") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' -type BeaconState_GetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalSlashing is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalValidators provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalValidators") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' -type BeaconState_GetTotalValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalValidators is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidators provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidators") - } - - var r0 ValidatorsT - var r1 error - if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ValidatorsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ValidatorsT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' -type BeaconState_GetValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidators is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorsByEffectiveBalance provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorsByEffectiveBalance") - } - - var r0 []ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []ValidatorT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]ValidatorT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' -type BeaconState_GetValidatorsByEffectiveBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorsByEffectiveBalance is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconState_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconState_HashTreeRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// IncreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for IncreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' -type BeaconState_IncreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// IncreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewFromDB provides a mock function with given fields: bdb, cs -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb KVStoreT, cs common.ChainSpec) T { - ret := _m.Called(bdb, cs) - - if len(ret) == 0 { - panic("no return value specified for NewFromDB") - } - - var r0 T - if rf, ok := ret.Get(0).(func(KVStoreT, common.ChainSpec) T); ok { - r0 = rf(bdb, cs) - } else { - r0 = ret.Get(0).(T) - } - - return r0 -} - -// BeaconState_NewFromDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewFromDB' -type BeaconState_NewFromDB_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// NewFromDB is a helper method to define mock.On call -// - bdb KVStoreT -// - cs common.ChainSpec -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb interface{}, cs interface{}) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("NewFromDB", bdb, cs)} -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(bdb KVStoreT, cs common.ChainSpec)) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(KVStoreT), args[1].(common.ChainSpec)) - }) - return _c -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(KVStoreT, common.ChainSpec) T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type BeaconState_SetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 interface{}) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 Eth1DataT)) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(Eth1DataT) error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type BeaconState_SetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 interface{}) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetFork provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 ForkT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetFork") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' -type BeaconState_SetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetFork is a helper method to define mock.On call -// - _a0 ForkT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 interface{}) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetFork", _a0)} -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ForkT)) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkT)) - }) - return _c -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ForkT) error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetGenesisValidatorsRoot provides a mock function with given fields: root -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root common.Root) error { - ret := _m.Called(root) - - if len(ret) == 0 { - panic("no return value specified for SetGenesisValidatorsRoot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(common.Root) error); ok { - r0 = rf(root) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' -type BeaconState_SetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetGenesisValidatorsRoot is a helper method to define mock.On call -// - root common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root interface{}) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(root common.Root)) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(common.Root) error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetLatestBlockHeader provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestBlockHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' -type BeaconState_SetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetLatestBlockHeader is a helper method to define mock.On call -// - _a0 BeaconBlockHeaderT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 interface{}) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 BeaconBlockHeaderT)) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconBlockHeaderT)) - }) - return _c -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type BeaconState_SetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' -type BeaconState_SetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetNextWithdrawalIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalValidatorIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' -type BeaconState_SetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetSlot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' -type BeaconState_SetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetSlot is a helper method to define mock.On call -// - _a0 math.Slot -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) - }) - return _c -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetTotalSlashing provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 math.Gwei) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetTotalSlashing") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' -type BeaconState_SetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetTotalSlashing is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 interface{}) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetTotalSlashing", _a0)} -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Gwei)) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Gwei) error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type BeaconState_StateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateBlockRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' -type BeaconState_UpdateBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type BeaconState_UpdateRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Bytes32) error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateSlashingAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' -type BeaconState_UpdateSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, math.Gwei) error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type BeaconState_UpdateStateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type BeaconState_UpdateValidatorAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type BeaconState_ValidatorByIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { - ret := _m.Called(cometBFTAddress) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByCometBFTAddress") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { - return rf(cometBFTAddress) - } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { - r0 = rf(cometBFTAddress) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(cometBFTAddress) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' -type BeaconState_ValidatorIndexByCometBFTAddress_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call -// - cometBFTAddress []byte -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type BeaconState_ValidatorIndexByPubkey_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconState creates a new instance of BeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - mock := &BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/context.mock.go b/mod/state-transition/pkg/core/mocks/context.mock.go deleted file mode 100644 index 580f0c7713..0000000000 --- a/mod/state-transition/pkg/core/mocks/context.mock.go +++ /dev/null @@ -1,411 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - time "time" - - mock "github.com/stretchr/testify/mock" -) - -// Context is an autogenerated mock type for the Context type -type Context struct { - mock.Mock -} - -type Context_Expecter struct { - mock *mock.Mock -} - -func (_m *Context) EXPECT() *Context_Expecter { - return &Context_Expecter{mock: &_m.Mock} -} - -// Deadline provides a mock function with given fields: -func (_m *Context) Deadline() (time.Time, bool) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Deadline") - } - - var r0 time.Time - var r1 bool - if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() time.Time); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Time) - } - - if rf, ok := ret.Get(1).(func() bool); ok { - r1 = rf() - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// Context_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline' -type Context_Deadline_Call struct { - *mock.Call -} - -// Deadline is a helper method to define mock.On call -func (_e *Context_Expecter) Deadline() *Context_Deadline_Call { - return &Context_Deadline_Call{Call: _e.mock.On("Deadline")} -} - -func (_c *Context_Deadline_Call) Run(run func()) *Context_Deadline_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Deadline_Call) Return(deadline time.Time, ok bool) *Context_Deadline_Call { - _c.Call.Return(deadline, ok) - return _c -} - -func (_c *Context_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *Context_Deadline_Call { - _c.Call.Return(run) - return _c -} - -// Done provides a mock function with given fields: -func (_m *Context) Done() <-chan struct{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Done") - } - - var r0 <-chan struct{} - if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan struct{}) - } - } - - return r0 -} - -// Context_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' -type Context_Done_Call struct { - *mock.Call -} - -// Done is a helper method to define mock.On call -func (_e *Context_Expecter) Done() *Context_Done_Call { - return &Context_Done_Call{Call: _e.mock.On("Done")} -} - -func (_c *Context_Done_Call) Run(run func()) *Context_Done_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Done_Call) Return(_a0 <-chan struct{}) *Context_Done_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Done_Call) RunAndReturn(run func() <-chan struct{}) *Context_Done_Call { - _c.Call.Return(run) - return _c -} - -// Err provides a mock function with given fields: -func (_m *Context) Err() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Err") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Context_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' -type Context_Err_Call struct { - *mock.Call -} - -// Err is a helper method to define mock.On call -func (_e *Context_Expecter) Err() *Context_Err_Call { - return &Context_Err_Call{Call: _e.mock.On("Err")} -} - -func (_c *Context_Err_Call) Run(run func()) *Context_Err_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Err_Call) Return(_a0 error) *Context_Err_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Err_Call) RunAndReturn(run func() error) *Context_Err_Call { - _c.Call.Return(run) - return _c -} - -// GetOptimisticEngine provides a mock function with given fields: -func (_m *Context) GetOptimisticEngine() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetOptimisticEngine") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetOptimisticEngine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOptimisticEngine' -type Context_GetOptimisticEngine_Call struct { - *mock.Call -} - -// GetOptimisticEngine is a helper method to define mock.On call -func (_e *Context_Expecter) GetOptimisticEngine() *Context_GetOptimisticEngine_Call { - return &Context_GetOptimisticEngine_Call{Call: _e.mock.On("GetOptimisticEngine")} -} - -func (_c *Context_GetOptimisticEngine_Call) Run(run func()) *Context_GetOptimisticEngine_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetOptimisticEngine_Call) Return(_a0 bool) *Context_GetOptimisticEngine_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetOptimisticEngine_Call) RunAndReturn(run func() bool) *Context_GetOptimisticEngine_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipPayloadVerification provides a mock function with given fields: -func (_m *Context) GetSkipPayloadVerification() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipPayloadVerification") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipPayloadVerification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipPayloadVerification' -type Context_GetSkipPayloadVerification_Call struct { - *mock.Call -} - -// GetSkipPayloadVerification is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipPayloadVerification() *Context_GetSkipPayloadVerification_Call { - return &Context_GetSkipPayloadVerification_Call{Call: _e.mock.On("GetSkipPayloadVerification")} -} - -func (_c *Context_GetSkipPayloadVerification_Call) Run(run func()) *Context_GetSkipPayloadVerification_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipPayloadVerification_Call) Return(_a0 bool) *Context_GetSkipPayloadVerification_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipPayloadVerification_Call) RunAndReturn(run func() bool) *Context_GetSkipPayloadVerification_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipValidateRandao provides a mock function with given fields: -func (_m *Context) GetSkipValidateRandao() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipValidateRandao") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipValidateRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateRandao' -type Context_GetSkipValidateRandao_Call struct { - *mock.Call -} - -// GetSkipValidateRandao is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipValidateRandao() *Context_GetSkipValidateRandao_Call { - return &Context_GetSkipValidateRandao_Call{Call: _e.mock.On("GetSkipValidateRandao")} -} - -func (_c *Context_GetSkipValidateRandao_Call) Run(run func()) *Context_GetSkipValidateRandao_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipValidateRandao_Call) Return(_a0 bool) *Context_GetSkipValidateRandao_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipValidateRandao_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateRandao_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipValidateResult provides a mock function with given fields: -func (_m *Context) GetSkipValidateResult() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipValidateResult") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipValidateResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateResult' -type Context_GetSkipValidateResult_Call struct { - *mock.Call -} - -// GetSkipValidateResult is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipValidateResult() *Context_GetSkipValidateResult_Call { - return &Context_GetSkipValidateResult_Call{Call: _e.mock.On("GetSkipValidateResult")} -} - -func (_c *Context_GetSkipValidateResult_Call) Run(run func()) *Context_GetSkipValidateResult_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipValidateResult_Call) Return(_a0 bool) *Context_GetSkipValidateResult_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipValidateResult_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateResult_Call { - _c.Call.Return(run) - return _c -} - -// Value provides a mock function with given fields: key -func (_m *Context) Value(key any) any { - ret := _m.Called(key) - - if len(ret) == 0 { - panic("no return value specified for Value") - } - - var r0 any - if rf, ok := ret.Get(0).(func(any) any); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(any) - } - } - - return r0 -} - -// Context_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' -type Context_Value_Call struct { - *mock.Call -} - -// Value is a helper method to define mock.On call -// - key any -func (_e *Context_Expecter) Value(key interface{}) *Context_Value_Call { - return &Context_Value_Call{Call: _e.mock.On("Value", key)} -} - -func (_c *Context_Value_Call) Run(run func(key any)) *Context_Value_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(any)) - }) - return _c -} - -func (_c *Context_Value_Call) Return(_a0 any) *Context_Value_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Value_Call) RunAndReturn(run func(any) any) *Context_Value_Call { - _c.Call.Return(run) - return _c -} - -// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContext(t interface { - mock.TestingT - Cleanup(func()) -}) *Context { - mock := &Context{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/deposit.mock.go b/mod/state-transition/pkg/core/mocks/deposit.mock.go deleted file mode 100644 index d424fc8c1d..0000000000 --- a/mod/state-transition/pkg/core/mocks/deposit.mock.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Deposit is an autogenerated mock type for the Deposit type -type Deposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - mock.Mock -} - -type Deposit_Expecter[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - mock *mock.Mock -} - -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) EXPECT() *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]{mock: &_m.Mock} -} - -// GetAmount provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetAmount() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAmount") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Deposit_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' -type Deposit_GetAmount_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetAmount is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetAmount() *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetAmount")} -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetPubkey provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetPubkey() crypto.BLSPubkey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPubkey") - } - - var r0 crypto.BLSPubkey - if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSPubkey) - } - } - - return r0 -} - -// Deposit_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' -type Deposit_GetPubkey_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetPubkey is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetPubkey() *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetPubkey")} -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawalCredentials provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() WithdrawlCredentialsT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawalCredentials") - } - - var r0 WithdrawlCredentialsT - if rf, ok := ret.Get(0).(func() WithdrawlCredentialsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(WithdrawlCredentialsT) - } - - return r0 -} - -// Deposit_GetWithdrawalCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawalCredentials' -type Deposit_GetWithdrawalCredentials_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetWithdrawalCredentials is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetWithdrawalCredentials")} -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// VerifySignature provides a mock function with given fields: forkData, domainType, signatureVerificationFn -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error { - ret := _m.Called(forkData, domainType, signatureVerificationFn) - - if len(ret) == 0 { - panic("no return value specified for VerifySignature") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error); ok { - r0 = rf(forkData, domainType, signatureVerificationFn) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Deposit_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type Deposit_VerifySignature_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// VerifySignature is a helper method to define mock.On call -// - forkData ForkDataT -// - domainType common.DomainType -// - signatureVerificationFn func(crypto.BLSPubkey , []byte , crypto.BLSSignature) error -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData interface{}, domainType interface{}, signatureVerificationFn interface{}) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("VerifySignature", forkData, domainType, signatureVerificationFn)} -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkDataT), args[1].(common.DomainType), args[2].(func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) - }) - return _c -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// NewDeposit creates a new instance of Deposit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDeposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }](t interface { - mock.TestingT - Cleanup(func()) -}) *Deposit[ForkDataT, WithdrawlCredentialsT] { - mock := &Deposit[ForkDataT, WithdrawlCredentialsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go deleted file mode 100644 index 77baa04080..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type -type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - mock.Mock -} - -type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - mock *mock.Mock -} - -func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req -func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for VerifyAndNotifyNewPayload") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' -type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - *mock.Call -} - -// VerifyAndNotifyNewPayload is a helper method to define mock.On call -// - ctx context.Context -// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] -func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) - }) - return _c -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint](t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go deleted file mode 100644 index 9f22de5ead..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go +++ /dev/null @@ -1,1122 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionPayload is an autogenerated mock type for the ExecutionPayload type -type ExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - mock.Mock -} - -type ExecutionPayload_Expecter[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// Empty provides a mock function with given fields: _a0 -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) ExecutionPayloadT { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Empty") - } - - var r0 ExecutionPayloadT - if rf, ok := ret.Get(0).(func(uint32) ExecutionPayloadT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ExecutionPayloadT) - } - - return r0 -} - -// ExecutionPayload_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' -type ExecutionPayload_Empty_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// Empty is a helper method to define mock.On call -// - _a0 uint32 -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) - }) - return _c -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBaseFeePerGas provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *math.U256 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBaseFeePerGas") - } - - var r0 *math.U256 - if rf, ok := ret.Get(0).(func() *math.U256); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*math.U256) - } - } - - return r0 -} - -// ExecutionPayload_GetBaseFeePerGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBaseFeePerGas' -type ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBaseFeePerGas is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBaseFeePerGas")} -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlobGasUsed provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlobGasUsed") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetBlobGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobGasUsed' -type ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlobGasUsed is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobGasUsed")} -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlockHash provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlockHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayload_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' -type ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlockHash is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlockHash")} -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExcessBlobGas provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExcessBlobGas") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetExcessBlobGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExcessBlobGas' -type ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetExcessBlobGas is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExcessBlobGas")} -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExtraData provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() []byte { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExtraData") - } - - var r0 []byte - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - return r0 -} - -// ExecutionPayload_GetExtraData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExtraData' -type ExecutionPayload_GetExtraData_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetExtraData is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExtraData")} -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetFeeRecipient provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() common.ExecutionAddress { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFeeRecipient") - } - - var r0 common.ExecutionAddress - if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionAddress) - } - } - - return r0 -} - -// ExecutionPayload_GetFeeRecipient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeRecipient' -type ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetFeeRecipient is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetFeeRecipient")} -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetGasLimit provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGasLimit") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetGasLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasLimit' -type ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetGasLimit is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasLimit")} -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetGasUsed provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGasUsed") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasUsed' -type ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetGasUsed is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasUsed")} -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetLogsBloom provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() bytes.B256 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLogsBloom") - } - - var r0 bytes.B256 - if rf, ok := ret.Get(0).(func() bytes.B256); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(bytes.B256) - } - } - - return r0 -} - -// ExecutionPayload_GetLogsBloom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogsBloom' -type ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetLogsBloom is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetLogsBloom")} -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetNumber provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNumber") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNumber' -type ExecutionPayload_GetNumber_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetNumber is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetNumber")} -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetParentHash provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayload_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' -type ExecutionPayload_GetParentHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetParentHash is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentHash")} -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetPrevRandao provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPrevRandao") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetPrevRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrevRandao' -type ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetPrevRandao is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetPrevRandao")} -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetReceiptsRoot provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetReceiptsRoot") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetReceiptsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReceiptsRoot' -type ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetReceiptsRoot is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetReceiptsRoot")} -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetTimestamp provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTimestamp") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' -type ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetTimestamp is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTimestamp")} -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetTransactions provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() engineprimitives.Transactions { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTransactions") - } - - var r0 engineprimitives.Transactions - if rf, ok := ret.Get(0).(func() engineprimitives.Transactions); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(engineprimitives.Transactions) - } - } - - return r0 -} - -// ExecutionPayload_GetTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactions' -type ExecutionPayload_GetTransactions_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetTransactions is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTransactions")} -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawals provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() WithdrawalsT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawals") - } - - var r0 WithdrawalsT - if rf, ok := ret.Get(0).(func() WithdrawalsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(WithdrawalsT) - } - - return r0 -} - -// ExecutionPayload_GetWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawals' -type ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetWithdrawals is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetWithdrawals")} -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// IsNil provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsNil") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// ExecutionPayload_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' -type ExecutionPayload_IsNil_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// IsNil is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// MarshalJSON provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() ([]byte, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MarshalJSON") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ExecutionPayload_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' -type ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// MarshalJSON is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("MarshalJSON")} -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte, _a1 error) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ([]byte, error)) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// ToHeader provides a mock function with given fields: maxWithdrawalsPerPayload, eth1ChainID -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload uint64, eth1ChainID uint64) (ExecutionPayloadHeaderT, error) { - ret := _m.Called(maxWithdrawalsPerPayload, eth1ChainID) - - if len(ret) == 0 { - panic("no return value specified for ToHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func(uint64, uint64) (ExecutionPayloadHeaderT, error)); ok { - return rf(maxWithdrawalsPerPayload, eth1ChainID) - } - if rf, ok := ret.Get(0).(func(uint64, uint64) ExecutionPayloadHeaderT); ok { - r0 = rf(maxWithdrawalsPerPayload, eth1ChainID) - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func(uint64, uint64) error); ok { - r1 = rf(maxWithdrawalsPerPayload, eth1ChainID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ExecutionPayload_ToHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToHeader' -type ExecutionPayload_ToHeader_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// ToHeader is a helper method to define mock.On call -// - maxWithdrawalsPerPayload uint64 -// - eth1ChainID uint64 -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload interface{}, eth1ChainID interface{}) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("ToHeader", maxWithdrawalsPerPayload, eth1ChainID)} -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(maxWithdrawalsPerPayload uint64, eth1ChainID uint64)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(uint64)) - }) - return _c -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint64, uint64) (ExecutionPayloadHeaderT, error)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// UnmarshalJSON provides a mock function with given fields: _a0 -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 []byte) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UnmarshalJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ExecutionPayload_UnmarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalJSON' -type ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// UnmarshalJSON is a helper method to define mock.On call -// - _a0 []byte -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 interface{}) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("UnmarshalJSON", _a0)} -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 []byte)) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func([]byte) error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// Version provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Version") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// ExecutionPayload_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' -type ExecutionPayload_Version_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// Version is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Version")} -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewExecutionPayload creates a new instance of ExecutionPayload. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go deleted file mode 100644 index eda051f23d..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionPayloadHeader is an autogenerated mock type for the ExecutionPayloadHeader type -type ExecutionPayloadHeader struct { - mock.Mock -} - -type ExecutionPayloadHeader_Expecter struct { - mock *mock.Mock -} - -func (_m *ExecutionPayloadHeader) EXPECT() *ExecutionPayloadHeader_Expecter { - return &ExecutionPayloadHeader_Expecter{mock: &_m.Mock} -} - -// GetBlockHash provides a mock function with given fields: -func (_m *ExecutionPayloadHeader) GetBlockHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlockHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayloadHeader_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' -type ExecutionPayloadHeader_GetBlockHash_Call struct { - *mock.Call -} - -// GetBlockHash is a helper method to define mock.On call -func (_e *ExecutionPayloadHeader_Expecter) GetBlockHash() *ExecutionPayloadHeader_GetBlockHash_Call { - return &ExecutionPayloadHeader_GetBlockHash_Call{Call: _e.mock.On("GetBlockHash")} -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Run(run func()) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Return(_a0 common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Return(run) - return _c -} - -// NewExecutionPayloadHeader creates a new instance of ExecutionPayloadHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionPayloadHeader(t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionPayloadHeader { - mock := &ExecutionPayloadHeader{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/fork_data.mock.go b/mod/state-transition/pkg/core/mocks/fork_data.mock.go deleted file mode 100644 index 5b0d48628a..0000000000 --- a/mod/state-transition/pkg/core/mocks/fork_data.mock.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ForkData is an autogenerated mock type for the ForkData type -type ForkData[ForkDataT any] struct { - mock.Mock -} - -type ForkData_Expecter[ForkDataT any] struct { - mock *mock.Mock -} - -func (_m *ForkData[ForkDataT]) EXPECT() *ForkData_Expecter[ForkDataT] { - return &ForkData_Expecter[ForkDataT]{mock: &_m.Mock} -} - -// ComputeRandaoSigningRoot provides a mock function with given fields: domainType, epoch -func (_m *ForkData[ForkDataT]) ComputeRandaoSigningRoot(domainType common.DomainType, epoch math.Epoch) common.Root { - ret := _m.Called(domainType, epoch) - - if len(ret) == 0 { - panic("no return value specified for ComputeRandaoSigningRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func(common.DomainType, math.Epoch) common.Root); ok { - r0 = rf(domainType, epoch) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// ForkData_ComputeRandaoSigningRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputeRandaoSigningRoot' -type ForkData_ComputeRandaoSigningRoot_Call[ForkDataT any] struct { - *mock.Call -} - -// ComputeRandaoSigningRoot is a helper method to define mock.On call -// - domainType common.DomainType -// - epoch math.Epoch -func (_e *ForkData_Expecter[ForkDataT]) ComputeRandaoSigningRoot(domainType interface{}, epoch interface{}) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - return &ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]{Call: _e.mock.On("ComputeRandaoSigningRoot", domainType, epoch)} -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Run(run func(domainType common.DomainType, epoch math.Epoch)) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.DomainType), args[1].(math.Epoch)) - }) - return _c -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Return(_a0 common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) RunAndReturn(run func(common.DomainType, math.Epoch) common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: _a0, _a1 -func (_m *ForkData[ForkDataT]) New(_a0 common.Version, _a1 common.Root) ForkDataT { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 ForkDataT - if rf, ok := ret.Get(0).(func(common.Version, common.Root) ForkDataT); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(ForkDataT) - } - - return r0 -} - -// ForkData_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type ForkData_New_Call[ForkDataT any] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - _a0 common.Version -// - _a1 common.Root -func (_e *ForkData_Expecter[ForkDataT]) New(_a0 interface{}, _a1 interface{}) *ForkData_New_Call[ForkDataT] { - return &ForkData_New_Call[ForkDataT]{Call: _e.mock.On("New", _a0, _a1)} -} - -func (_c *ForkData_New_Call[ForkDataT]) Run(run func(_a0 common.Version, _a1 common.Root)) *ForkData_New_Call[ForkDataT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Version), args[1].(common.Root)) - }) - return _c -} - -func (_c *ForkData_New_Call[ForkDataT]) Return(_a0 ForkDataT) *ForkData_New_Call[ForkDataT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ForkData_New_Call[ForkDataT]) RunAndReturn(run func(common.Version, common.Root) ForkDataT) *ForkData_New_Call[ForkDataT] { - _c.Call.Return(run) - return _c -} - -// NewForkData creates a new instance of ForkData. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewForkData[ForkDataT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ForkData[ForkDataT] { - mock := &ForkData[ForkDataT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go deleted file mode 100644 index d008b496f2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go +++ /dev/null @@ -1,1326 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyBeaconState is an autogenerated mock type for the ReadOnlyBeaconState type -type ReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock.Mock -} - -type ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBalance provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBalance") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' -type ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBlockRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBlockRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' -type ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1Data provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetFork provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFork") - } - - var r0 ForkT - var r1 error - if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ForkT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ForkT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' -type ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetFork is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetGenesisValidatorsRoot provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGenesisValidatorsRoot") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' -type ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetGenesisValidatorsRoot is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestBlockHeader provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestBlockHeader") - } - - var r0 BeaconBlockHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' -type ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestBlockHeader is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' -type ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalValidatorIndex") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' -type ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetSlashingAtIndex") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' -type ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetTotalActiveBalances") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' -type ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalActiveBalances is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalSlashing provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalSlashing") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' -type ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalSlashing is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalValidators provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalValidators") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' -type ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalValidators is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidators provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidators") - } - - var r0 ValidatorsT - var r1 error - if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ValidatorsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ValidatorsT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' -type ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidators is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorsByEffectiveBalance provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorsByEffectiveBalance") - } - - var r0 []ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []ValidatorT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]ValidatorT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' -type ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorsByEffectiveBalance is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { - ret := _m.Called(cometBFTAddress) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByCometBFTAddress") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { - return rf(cometBFTAddress) - } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { - r0 = rf(cometBFTAddress) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(cometBFTAddress) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' -type ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call -// - cometBFTAddress []byte -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyBeaconState creates a new instance of ReadOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - mock := &ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go deleted file mode 100644 index 1956f9c88f..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ReadOnlyEth1Data is an autogenerated mock type for the ReadOnlyEth1Data type -type ReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock.Mock -} - -type ReadOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} -} - -// GetEth1Data provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 uint64, _a1 error) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyEth1Data creates a new instance of ReadOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { - mock := &ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go deleted file mode 100644 index 099e28e5d2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyRandaoMixes is an autogenerated mock type for the ReadOnlyRandaoMixes type -type ReadOnlyRandaoMixes struct { - mock.Mock -} - -type ReadOnlyRandaoMixes_Expecter struct { - mock *mock.Mock -} - -func (_m *ReadOnlyRandaoMixes) EXPECT() *ReadOnlyRandaoMixes_Expecter { - return &ReadOnlyRandaoMixes_Expecter{mock: &_m.Mock} -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyRandaoMixes) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyRandaoMixes_Expecter) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - return &ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyRandaoMixes creates a new instance of ReadOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyRandaoMixes(t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyRandaoMixes { - mock := &ReadOnlyRandaoMixes{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go deleted file mode 100644 index be45aad8a2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyStateRoots is an autogenerated mock type for the ReadOnlyStateRoots type -type ReadOnlyStateRoots struct { - mock.Mock -} - -type ReadOnlyStateRoots_Expecter struct { - mock *mock.Mock -} - -func (_m *ReadOnlyStateRoots) EXPECT() *ReadOnlyStateRoots_Expecter { - return &ReadOnlyStateRoots_Expecter{mock: &_m.Mock} -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyStateRoots) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyStateRoots_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type ReadOnlyStateRoots_StateRootAtIndex_Call struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyStateRoots_Expecter) StateRootAtIndex(_a0 interface{}) *ReadOnlyStateRoots_StateRootAtIndex_Call { - return &ReadOnlyStateRoots_StateRootAtIndex_Call{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Return(_a0 common.Root, _a1 error) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyStateRoots creates a new instance of ReadOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyStateRoots(t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyStateRoots { - mock := &ReadOnlyStateRoots{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go deleted file mode 100644 index 935e713699..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyValidators is an autogenerated mock type for the ReadOnlyValidators type -type ReadOnlyValidators[ValidatorT any] struct { - mock.Mock -} - -type ReadOnlyValidators_Expecter[ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyValidators[ValidatorT]) EXPECT() *ReadOnlyValidators_Expecter[ValidatorT] { - return &ReadOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyValidators[ValidatorT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyValidators_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - return &ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *ReadOnlyValidators[ValidatorT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyValidators_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - return &ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyValidators creates a new instance of ReadOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyValidators[ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyValidators[ValidatorT] { - mock := &ReadOnlyValidators[ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go deleted file mode 100644 index 82b8b930d6..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ReadOnlyWithdrawals is an autogenerated mock type for the ReadOnlyWithdrawals type -type ReadOnlyWithdrawals[WithdrawalT any] struct { - mock.Mock -} - -type ReadOnlyWithdrawals_Expecter[WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyWithdrawals[WithdrawalT]) EXPECT() *ReadOnlyWithdrawals_Expecter[WithdrawalT] { - return &ReadOnlyWithdrawals_Expecter[WithdrawalT]{mock: &_m.Mock} -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *ReadOnlyWithdrawals[WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyWithdrawals_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *ReadOnlyWithdrawals_Expecter[WithdrawalT]) ExpectedWithdrawals() *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - return &ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Run(run func()) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyWithdrawals creates a new instance of ReadOnlyWithdrawals. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyWithdrawals[WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyWithdrawals[WithdrawalT] { - mock := &ReadOnlyWithdrawals[WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/validator.mock.go b/mod/state-transition/pkg/core/mocks/validator.mock.go deleted file mode 100644 index 9245a3de7a..0000000000 --- a/mod/state-transition/pkg/core/mocks/validator.mock.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Validator is an autogenerated mock type for the Validator type -type Validator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - mock.Mock -} - -type Validator_Expecter[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - mock *mock.Mock -} - -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) EXPECT() *Validator_Expecter[ValidatorT, WithdrawalCredentialsT] { - return &Validator_Expecter[ValidatorT, WithdrawalCredentialsT]{mock: &_m.Mock} -} - -// GetEffectiveBalance provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEffectiveBalance") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Validator_GetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEffectiveBalance' -type Validator_GetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetEffectiveBalance is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetEffectiveBalance")} -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetPubkey provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetPubkey() crypto.BLSPubkey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPubkey") - } - - var r0 crypto.BLSPubkey - if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSPubkey) - } - } - - return r0 -} - -// Validator_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' -type Validator_GetPubkey_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetPubkey is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetPubkey() *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetPubkey")} -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawableEpoch provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() math.Epoch { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawableEpoch") - } - - var r0 math.Epoch - if rf, ok := ret.Get(0).(func() math.Epoch); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Epoch) - } - - return r0 -} - -// Validator_GetWithdrawableEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawableEpoch' -type Validator_GetWithdrawableEpoch_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetWithdrawableEpoch is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetWithdrawableEpoch")} -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// Validator_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type Validator_HashTreeRoot_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// IsSlashed provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) IsSlashed() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsSlashed") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Validator_IsSlashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSlashed' -type Validator_IsSlashed_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// IsSlashed is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) IsSlashed() *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("IsSlashed")} -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// MarshalSSZ provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() ([]byte, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MarshalSSZ") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Validator_MarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalSSZ' -type Validator_MarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// MarshalSSZ is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("MarshalSSZ")} -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 []byte, _a1 error) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() ([]byte, error)) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) New(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei) ValidatorT { - ret := _m.Called(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 ValidatorT - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT); ok { - r0 = rf(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - return r0 -} - -// Validator_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type Validator_New_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - pubkey crypto.BLSPubkey -// - withdrawalCredentials WithdrawalCredentialsT -// - amount math.Gwei -// - effectiveBalanceIncrement math.Gwei -// - maxEffectiveBalance math.Gwei -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) New(pubkey interface{}, withdrawalCredentials interface{}, amount interface{}, effectiveBalanceIncrement interface{}, maxEffectiveBalance interface{}) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_New_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("New", pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance)} -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei)) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey), args[1].(WithdrawalCredentialsT), args[2].(math.Gwei), args[3].(math.Gwei), args[4].(math.Gwei)) - }) - return _c -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// SetEffectiveBalance provides a mock function with given fields: _a0 -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 math.Gwei) { - _m.Called(_a0) -} - -// Validator_SetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEffectiveBalance' -type Validator_SetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// SetEffectiveBalance is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 interface{}) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SetEffectiveBalance", _a0)} -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return() *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return() - return _c -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// SizeSSZ provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SizeSSZ") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// Validator_SizeSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SizeSSZ' -type Validator_SizeSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// SizeSSZ is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SizeSSZ")} -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// UnmarshalSSZ provides a mock function with given fields: _a0 -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 []byte) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UnmarshalSSZ") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Validator_UnmarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalSSZ' -type Validator_UnmarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// UnmarshalSSZ is a helper method to define mock.On call -// - _a0 []byte -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 interface{}) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("UnmarshalSSZ", _a0)} -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 []byte)) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func([]byte) error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }](t interface { - mock.TestingT - Cleanup(func()) -}) *Validator[ValidatorT, WithdrawalCredentialsT] { - mock := &Validator[ValidatorT, WithdrawalCredentialsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/validators.mock.go b/mod/state-transition/pkg/core/mocks/validators.mock.go deleted file mode 100644 index 15a4fb46bc..0000000000 --- a/mod/state-transition/pkg/core/mocks/validators.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// Validators is an autogenerated mock type for the Validators type -type Validators struct { - mock.Mock -} - -type Validators_Expecter struct { - mock *mock.Mock -} - -func (_m *Validators) EXPECT() *Validators_Expecter { - return &Validators_Expecter{mock: &_m.Mock} -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *Validators) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// Validators_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type Validators_HashTreeRoot_Call struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *Validators_Expecter) HashTreeRoot() *Validators_HashTreeRoot_Call { - return &Validators_HashTreeRoot_Call{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *Validators_HashTreeRoot_Call) Run(run func()) *Validators_HashTreeRoot_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validators_HashTreeRoot_Call) Return(_a0 common.Root) *Validators_HashTreeRoot_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validators_HashTreeRoot_Call) RunAndReturn(run func() common.Root) *Validators_HashTreeRoot_Call { - _c.Call.Return(run) - return _c -} - -// NewValidators creates a new instance of Validators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidators(t interface { - mock.TestingT - Cleanup(func()) -}) *Validators { - mock := &Validators{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go deleted file mode 100644 index e76e91136f..0000000000 --- a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Withdrawal is an autogenerated mock type for the Withdrawal type -type Withdrawal[WithdrawalT any] struct { - mock.Mock -} - -type Withdrawal_Expecter[WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *Withdrawal[WithdrawalT]) EXPECT() *Withdrawal_Expecter[WithdrawalT] { - return &Withdrawal_Expecter[WithdrawalT]{mock: &_m.Mock} -} - -// Equals provides a mock function with given fields: _a0 -func (_m *Withdrawal[WithdrawalT]) Equals(_a0 WithdrawalT) bool { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Equals") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(WithdrawalT) bool); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Withdrawal_Equals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equals' -type Withdrawal_Equals_Call[WithdrawalT any] struct { - *mock.Call -} - -// Equals is a helper method to define mock.On call -// - _a0 WithdrawalT -func (_e *Withdrawal_Expecter[WithdrawalT]) Equals(_a0 interface{}) *Withdrawal_Equals_Call[WithdrawalT] { - return &Withdrawal_Equals_Call[WithdrawalT]{Call: _e.mock.On("Equals", _a0)} -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) Run(run func(_a0 WithdrawalT)) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(WithdrawalT)) - }) - return _c -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) Return(_a0 bool) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) RunAndReturn(run func(WithdrawalT) bool) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetAddress provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetAddress() common.ExecutionAddress { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAddress") - } - - var r0 common.ExecutionAddress - if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionAddress) - } - } - - return r0 -} - -// Withdrawal_GetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAddress' -type Withdrawal_GetAddress_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetAddress is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetAddress() *Withdrawal_GetAddress_Call[WithdrawalT] { - return &Withdrawal_GetAddress_Call[WithdrawalT]{Call: _e.mock.On("GetAddress")} -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Return(_a0 common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) RunAndReturn(run func() common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetAmount provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetAmount() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAmount") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Withdrawal_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' -type Withdrawal_GetAmount_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetAmount is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetAmount() *Withdrawal_GetAmount_Call[WithdrawalT] { - return &Withdrawal_GetAmount_Call[WithdrawalT]{Call: _e.mock.On("GetAmount")} -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Return(_a0 math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) RunAndReturn(run func() math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetIndex provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetIndex() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetIndex") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// Withdrawal_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex' -type Withdrawal_GetIndex_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetIndex is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetIndex() *Withdrawal_GetIndex_Call[WithdrawalT] { - return &Withdrawal_GetIndex_Call[WithdrawalT]{Call: _e.mock.On("GetIndex")} -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Return(_a0 math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) RunAndReturn(run func() math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorIndex provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetValidatorIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// Withdrawal_GetValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorIndex' -type Withdrawal_GetValidatorIndex_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorIndex is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetValidatorIndex() *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - return &Withdrawal_GetValidatorIndex_Call[WithdrawalT]{Call: _e.mock.On("GetValidatorIndex")} -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Return(_a0 math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) RunAndReturn(run func() math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewWithdrawal creates a new instance of Withdrawal. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWithdrawal[WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *Withdrawal[WithdrawalT] { - mock := &Withdrawal[WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go deleted file mode 100644 index 291d70a837..0000000000 --- a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - bytes "bytes" - - mock "github.com/stretchr/testify/mock" -) - -// WithdrawalsConstraint is an autogenerated mock type for the WithdrawalsConstraint type -type WithdrawalsConstraint struct { - mock.Mock -} - -type WithdrawalsConstraint_Expecter struct { - mock *mock.Mock -} - -func (_m *WithdrawalsConstraint) EXPECT() *WithdrawalsConstraint_Expecter { - return &WithdrawalsConstraint_Expecter{mock: &_m.Mock} -} - -// EncodeIndex provides a mock function with given fields: _a0, _a1 -func (_m *WithdrawalsConstraint) EncodeIndex(_a0 int, _a1 *bytes.Buffer) { - _m.Called(_a0, _a1) -} - -// WithdrawalsConstraint_EncodeIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeIndex' -type WithdrawalsConstraint_EncodeIndex_Call struct { - *mock.Call -} - -// EncodeIndex is a helper method to define mock.On call -// - _a0 int -// - _a1 *bytes.Buffer -func (_e *WithdrawalsConstraint_Expecter) EncodeIndex(_a0 interface{}, _a1 interface{}) *WithdrawalsConstraint_EncodeIndex_Call { - return &WithdrawalsConstraint_EncodeIndex_Call{Call: _e.mock.On("EncodeIndex", _a0, _a1)} -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) Run(run func(_a0 int, _a1 *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int), args[1].(*bytes.Buffer)) - }) - return _c -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) Return() *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Return() - return _c -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) RunAndReturn(run func(int, *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Return(run) - return _c -} - -// Len provides a mock function with given fields: -func (_m *WithdrawalsConstraint) Len() int { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Len") - } - - var r0 int - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int) - } - - return r0 -} - -// WithdrawalsConstraint_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' -type WithdrawalsConstraint_Len_Call struct { - *mock.Call -} - -// Len is a helper method to define mock.On call -func (_e *WithdrawalsConstraint_Expecter) Len() *WithdrawalsConstraint_Len_Call { - return &WithdrawalsConstraint_Len_Call{Call: _e.mock.On("Len")} -} - -func (_c *WithdrawalsConstraint_Len_Call) Run(run func()) *WithdrawalsConstraint_Len_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *WithdrawalsConstraint_Len_Call) Return(_a0 int) *WithdrawalsConstraint_Len_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WithdrawalsConstraint_Len_Call) RunAndReturn(run func() int) *WithdrawalsConstraint_Len_Call { - _c.Call.Return(run) - return _c -} - -// NewWithdrawalsConstraint creates a new instance of WithdrawalsConstraint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWithdrawalsConstraint(t interface { - mock.TestingT - Cleanup(func()) -}) *WithdrawalsConstraint { - mock := &WithdrawalsConstraint{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go deleted file mode 100644 index 677433b90c..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go +++ /dev/null @@ -1,919 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyBeaconState is an autogenerated mock type for the WriteOnlyBeaconState type -type WriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - mock.Mock -} - -type WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) EXPECT() *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// DecreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for DecreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' -type WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// DecreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// IncreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for IncreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' -type WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// IncreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 interface{}) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetFork provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 ForkT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetFork") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' -type WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetFork is a helper method to define mock.On call -// - _a0 ForkT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 interface{}) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetFork", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ForkT)) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ForkT) error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetGenesisValidatorsRoot provides a mock function with given fields: root -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root common.Root) error { - ret := _m.Called(root) - - if len(ret) == 0 { - panic("no return value specified for SetGenesisValidatorsRoot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(common.Root) error); ok { - r0 = rf(root) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' -type WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetGenesisValidatorsRoot is a helper method to define mock.On call -// - root common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root interface{}) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(root common.Root)) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(common.Root) error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetLatestBlockHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestBlockHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' -type WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetLatestBlockHeader is a helper method to define mock.On call -// - _a0 BeaconBlockHeaderT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 BeaconBlockHeaderT)) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconBlockHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' -type WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetNextWithdrawalIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalValidatorIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' -type WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetSlot provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 math.Slot) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetSlot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' -type WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetSlot is a helper method to define mock.On call -// - _a0 math.Slot -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 interface{}) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetSlot", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Slot)) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Slot) error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetTotalSlashing provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 math.Gwei) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetTotalSlashing") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' -type WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetTotalSlashing is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 interface{}) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetTotalSlashing", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Gwei)) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Gwei) error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateBlockRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' -type WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateSlashingAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' -type WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, math.Gwei) error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyBeaconState creates a new instance of WriteOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - mock := &WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go deleted file mode 100644 index a6020ec38b..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// WriteOnlyEth1Data is an autogenerated mock type for the WriteOnlyEth1Data type -type WriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock.Mock -} - -type WriteOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 interface{}) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 uint64)) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(uint64) error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyEth1Data creates a new instance of WriteOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { - mock := &WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go deleted file mode 100644 index 6cd16f7b52..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyRandaoMixes is an autogenerated mock type for the WriteOnlyRandaoMixes type -type WriteOnlyRandaoMixes struct { - mock.Mock -} - -type WriteOnlyRandaoMixes_Expecter struct { - mock *mock.Mock -} - -func (_m *WriteOnlyRandaoMixes) EXPECT() *WriteOnlyRandaoMixes_Expecter { - return &WriteOnlyRandaoMixes_Expecter{mock: &_m.Mock} -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyRandaoMixes) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *WriteOnlyRandaoMixes_Expecter) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - return &WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Return(_a0 error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyRandaoMixes creates a new instance of WriteOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyRandaoMixes(t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyRandaoMixes { - mock := &WriteOnlyRandaoMixes{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go deleted file mode 100644 index 7349015317..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyStateRoots is an autogenerated mock type for the WriteOnlyStateRoots type -type WriteOnlyStateRoots struct { - mock.Mock -} - -type WriteOnlyStateRoots_Expecter struct { - mock *mock.Mock -} - -func (_m *WriteOnlyStateRoots) EXPECT() *WriteOnlyStateRoots_Expecter { - return &WriteOnlyStateRoots_Expecter{mock: &_m.Mock} -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyStateRoots) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyStateRoots_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type WriteOnlyStateRoots_UpdateStateRootAtIndex_Call struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyStateRoots_Expecter) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - return &WriteOnlyStateRoots_UpdateStateRootAtIndex_Call{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Return(_a0 error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyStateRoots creates a new instance of WriteOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyStateRoots(t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyStateRoots { - mock := &WriteOnlyStateRoots{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go deleted file mode 100644 index 3f4d7bfcac..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyValidators is an autogenerated mock type for the WriteOnlyValidators type -type WriteOnlyValidators[ValidatorT any] struct { - mock.Mock -} - -type WriteOnlyValidators_Expecter[ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyValidators[ValidatorT]) EXPECT() *WriteOnlyValidators_Expecter[ValidatorT] { - return &WriteOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *WriteOnlyValidators[ValidatorT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type WriteOnlyValidators_AddValidator_Call[ValidatorT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - return &WriteOnlyValidators_AddValidator_Call[ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *WriteOnlyValidators[ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - return &WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyValidators[ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - return &WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyValidators creates a new instance of WriteOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyValidators[ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyValidators[ValidatorT] { - mock := &WriteOnlyValidators[ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 354f0c723a..a37cca2a1e 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,12 +28,11 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -80,13 +79,8 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := mocks.NewExecutionEngine[ - *types.ExecutionPayload, - *types.ExecutionPayloadHeader, - engineprimitives.Withdrawals, - ](t) - - mocksSigner := &cryptomocks.Blssigner{} + execEngine := &testExecutionEngine{} + mocksSigner := &mocks.BLSSigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 6edcb5a71b..5a359344d3 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -173,18 +173,15 @@ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } -// WithdrawalsConstraint is the interface for withdrawals constraint. -type WithdrawalsConstraint interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) -} - // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT WithdrawalsConstraint, + WithdrawalsT interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) + }, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. diff --git a/mod/storage/pkg/filedb/range_db_test.go b/mod/storage/pkg/filedb/range_db_test.go index b0e33eddf2..51334ce806 100644 --- a/mod/storage/pkg/filedb/range_db_test.go +++ b/mod/storage/pkg/filedb/range_db_test.go @@ -197,11 +197,11 @@ func TestExtractIndex(t *testing.T) { func TestRangeDB_DeleteRange_NotSupported(t *testing.T) { tests := []struct { name string - db *mocks.Db + db *mocks.DB }{ { name: "DeleteRangeNotSupported", - db: new(mocks.Db), + db: new(mocks.DB), }, } diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index e076d6ed35..97c0431b20 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -4,21 +4,21 @@ package mocks import mock "github.com/stretchr/testify/mock" -// Db is an autogenerated mock type for the DB type -type Db struct { +// DB is an autogenerated mock type for the DB type +type DB struct { mock.Mock } -type Db_Expecter struct { +type DB_Expecter struct { mock *mock.Mock } -func (_m *Db) EXPECT() *Db_Expecter { - return &Db_Expecter{mock: &_m.Mock} +func (_m *DB) EXPECT() *DB_Expecter { + return &DB_Expecter{mock: &_m.Mock} } // Delete provides a mock function with given fields: key -func (_m *Db) Delete(key []byte) error { +func (_m *DB) Delete(key []byte) error { ret := _m.Called(key) if len(ret) == 0 { @@ -35,36 +35,36 @@ func (_m *Db) Delete(key []byte) error { return r0 } -// Db_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type Db_Delete_Call struct { +// DB_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type DB_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Delete(key interface{}) *Db_Delete_Call { - return &Db_Delete_Call{Call: _e.mock.On("Delete", key)} +func (_e *DB_Expecter) Delete(key interface{}) *DB_Delete_Call { + return &DB_Delete_Call{Call: _e.mock.On("Delete", key)} } -func (_c *Db_Delete_Call) Run(run func(key []byte)) *Db_Delete_Call { +func (_c *DB_Delete_Call) Run(run func(key []byte)) *DB_Delete_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Delete_Call) Return(_a0 error) *Db_Delete_Call { +func (_c *DB_Delete_Call) Return(_a0 error) *DB_Delete_Call { _c.Call.Return(_a0) return _c } -func (_c *Db_Delete_Call) RunAndReturn(run func([]byte) error) *Db_Delete_Call { +func (_c *DB_Delete_Call) RunAndReturn(run func([]byte) error) *DB_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function with given fields: key -func (_m *Db) Get(key []byte) ([]byte, error) { +func (_m *DB) Get(key []byte) ([]byte, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -93,36 +93,36 @@ func (_m *Db) Get(key []byte) ([]byte, error) { return r0, r1 } -// Db_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type Db_Get_Call struct { +// DB_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type DB_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Get(key interface{}) *Db_Get_Call { - return &Db_Get_Call{Call: _e.mock.On("Get", key)} +func (_e *DB_Expecter) Get(key interface{}) *DB_Get_Call { + return &DB_Get_Call{Call: _e.mock.On("Get", key)} } -func (_c *Db_Get_Call) Run(run func(key []byte)) *Db_Get_Call { +func (_c *DB_Get_Call) Run(run func(key []byte)) *DB_Get_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Get_Call) Return(_a0 []byte, _a1 error) *Db_Get_Call { +func (_c *DB_Get_Call) Return(_a0 []byte, _a1 error) *DB_Get_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Db_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *Db_Get_Call { +func (_c *DB_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *DB_Get_Call { _c.Call.Return(run) return _c } // Has provides a mock function with given fields: key -func (_m *Db) Has(key []byte) (bool, error) { +func (_m *DB) Has(key []byte) (bool, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -149,36 +149,36 @@ func (_m *Db) Has(key []byte) (bool, error) { return r0, r1 } -// Db_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' -type Db_Has_Call struct { +// DB_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type DB_Has_Call struct { *mock.Call } // Has is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Has(key interface{}) *Db_Has_Call { - return &Db_Has_Call{Call: _e.mock.On("Has", key)} +func (_e *DB_Expecter) Has(key interface{}) *DB_Has_Call { + return &DB_Has_Call{Call: _e.mock.On("Has", key)} } -func (_c *Db_Has_Call) Run(run func(key []byte)) *Db_Has_Call { +func (_c *DB_Has_Call) Run(run func(key []byte)) *DB_Has_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Has_Call) Return(_a0 bool, _a1 error) *Db_Has_Call { +func (_c *DB_Has_Call) Return(_a0 bool, _a1 error) *DB_Has_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Db_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *Db_Has_Call { +func (_c *DB_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *DB_Has_Call { _c.Call.Return(run) return _c } // Set provides a mock function with given fields: key, value -func (_m *Db) Set(key []byte, value []byte) error { +func (_m *DB) Set(key []byte, value []byte) error { ret := _m.Called(key, value) if len(ret) == 0 { @@ -195,42 +195,42 @@ func (_m *Db) Set(key []byte, value []byte) error { return r0 } -// Db_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' -type Db_Set_Call struct { +// DB_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' +type DB_Set_Call struct { *mock.Call } // Set is a helper method to define mock.On call // - key []byte // - value []byte -func (_e *Db_Expecter) Set(key interface{}, value interface{}) *Db_Set_Call { - return &Db_Set_Call{Call: _e.mock.On("Set", key, value)} +func (_e *DB_Expecter) Set(key interface{}, value interface{}) *DB_Set_Call { + return &DB_Set_Call{Call: _e.mock.On("Set", key, value)} } -func (_c *Db_Set_Call) Run(run func(key []byte, value []byte)) *Db_Set_Call { +func (_c *DB_Set_Call) Run(run func(key []byte, value []byte)) *DB_Set_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte), args[1].([]byte)) }) return _c } -func (_c *Db_Set_Call) Return(_a0 error) *Db_Set_Call { +func (_c *DB_Set_Call) Return(_a0 error) *DB_Set_Call { _c.Call.Return(_a0) return _c } -func (_c *Db_Set_Call) RunAndReturn(run func([]byte, []byte) error) *Db_Set_Call { +func (_c *DB_Set_Call) RunAndReturn(run func([]byte, []byte) error) *DB_Set_Call { _c.Call.Return(run) return _c } -// NewDb creates a new instance of Db. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewDB creates a new instance of DB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewDb(t interface { +func NewDB(t interface { mock.TestingT Cleanup(func()) -}) *Db { - mock := &Db{} +}) *DB { + mock := &DB{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) From 9818c7e0830cd3685d1a8640bcb7feb8bb9bca9f Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 13:49:34 +0530 Subject: [PATCH 40/51] tests with only mock for execution engine Signed-off-by: nidhi-singh02 --- .mockery.yaml | 5 ++ mod/state-transition/pkg/core/helpers_test.go | 43 ++++++++-- .../pkg/core/mocks/execution_engine.mock.go | 86 +++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 11 ++- mod/state-transition/pkg/core/types.go | 9 +- 5 files changed, 138 insertions(+), 16 deletions(-) create mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index 6062236306..d1b168a550 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,3 +68,8 @@ packages: recursive: False with-expecter: true all: True + github.com/berachain/beacon-kit/mod/state-transition/pkg/core: + config: + recursive: False + with-expecter: true + include-regex: ExecutionEngine \ No newline at end of file diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 1631830784..b982800a67 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,6 +23,7 @@ package core_test import ( "context" "fmt" + "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -32,24 +33,48 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" ) -// TODO: replace with proper mock -type testExecutionEngine struct{} - -func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( - _ context.Context, - _ *engineprimitives.NewPayloadRequest[ +func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { + mockEngine := mocks.NewExecutionEngine[ *types.ExecutionPayload, + *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ], -) error { - return nil + ](t) + + t.Run("successful verification with complete payload", func(t *testing.T) { + req := &engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ]{ + ExecutionPayload: &types.ExecutionPayload{}, + VersionedHashes: []common.ExecutionHash{ + {0x1}, + {0x2}, + }, + ParentBeaconBlockRoot: &common.Root{0x3}, + Optimistic: false, + } + + // Set up expectation for successful verification + mockEngine.EXPECT(). + VerifyAndNotifyNewPayload( + context.Background(), + req, + ). + Return(nil) + + err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) + require.NoError(t, err) + }) } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go new file mode 100644 index 0000000000..18e35998eb --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -0,0 +1,86 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type +type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + mock.Mock +} + +type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + mock *mock.Mock +} + +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for VerifyAndNotifyNewPayload") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { + r0 = rf(ctx, req) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' +type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + *mock.Call +} + +// VerifyAndNotifyNewPayload is a helper method to define mock.On call +// - ctx context.Context +// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] +func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) + }) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index a37cca2a1e..20996901ea 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,11 +28,12 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -79,8 +80,12 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := &testExecutionEngine{} - mocksSigner := &mocks.BLSSigner{} + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 5a359344d3..ab05bd3c0c 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -172,16 +172,17 @@ type ExecutionPayload[ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } +type Withdrawals interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) +} // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) - }, + WithdrawalsT Withdrawals, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. From 160cc8865cc7be4202713db2ccaafa819137ec36 Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 14:16:11 +0530 Subject: [PATCH 41/51] removed test for VerifyAndNotifyNewPayload Signed-off-by: nidhi-singh02 --- .mockery.yaml | 2 +- mod/state-transition/pkg/core/helpers_test.go | 39 ------------------- mod/state-transition/pkg/core/types.go | 2 + 3 files changed, 3 insertions(+), 40 deletions(-) diff --git a/.mockery.yaml b/.mockery.yaml index d1b168a550..e4efc43af5 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -72,4 +72,4 @@ packages: config: recursive: False with-expecter: true - include-regex: ExecutionEngine \ No newline at end of file + include-regex: ExecutionEngine diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index b982800a67..ceba3b6432 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,7 +23,6 @@ package core_test import ( "context" "fmt" - "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -31,52 +30,14 @@ import ( "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) -func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { - mockEngine := mocks.NewExecutionEngine[ - *types.ExecutionPayload, - *types.ExecutionPayloadHeader, - engineprimitives.Withdrawals, - ](t) - - t.Run("successful verification with complete payload", func(t *testing.T) { - req := &engineprimitives.NewPayloadRequest[ - *types.ExecutionPayload, - engineprimitives.Withdrawals, - ]{ - ExecutionPayload: &types.ExecutionPayload{}, - VersionedHashes: []common.ExecutionHash{ - {0x1}, - {0x2}, - }, - ParentBeaconBlockRoot: &common.Root{0x3}, - Optimistic: false, - } - - // Set up expectation for successful verification - mockEngine.EXPECT(). - VerifyAndNotifyNewPayload( - context.Background(), - req, - ). - Return(nil) - - err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) - require.NoError(t, err) - }) -} - type testKVStoreService struct { ctx sdk.Context } diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index ab05bd3c0c..26ef877923 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -172,6 +172,8 @@ type ExecutionPayload[ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } + +// Withdrawals defines the interface for managing withdrawal operations. type Withdrawals interface { Len() int EncodeIndex(int, *stdbytes.Buffer) From 4a9fe1c8453740555f9b52d310c28f23ac282eb4 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 12:36:49 +0100 Subject: [PATCH 42/51] nit --- mod/state-transition/pkg/core/helpers_test.go | 39 +++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 39 ------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index ceba3b6432..25b71c2035 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -30,7 +30,9 @@ import ( "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" @@ -38,6 +40,43 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type ( + TestBeaconStateMarshallableT = types.BeaconState[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.BeaconBlockHeader, + types.Eth1Data, + types.ExecutionPayloadHeader, + types.Fork, + types.Validator, + ] + + TestKVStoreT = beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ] + + TestBeaconStateT = statedb.StateDB[ + *types.BeaconBlockHeader, + *TestBeaconStateMarshallableT, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + types.WithdrawalCredentials, + ] +) + type testKVStoreService struct { ctx sdk.Context } diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 20996901ea..9177f7d300 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -34,49 +34,10 @@ import ( "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" - statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" - "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) -type ( - TestBeaconStateMarshallableT = types.BeaconState[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.BeaconBlockHeader, - types.Eth1Data, - types.ExecutionPayloadHeader, - types.Fork, - types.Validator, - ] - - TestKVStoreT = beacondb.KVStore[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ] - - TestBeaconStateT = statedb.StateDB[ - *types.BeaconBlockHeader, - *TestBeaconStateMarshallableT, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *TestKVStoreT, - *types.Validator, - types.Validators, - *engineprimitives.Withdrawal, - types.WithdrawalCredentials, - ] -) - func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() From e048be4dce1b0caa6dbc559e4ad4f134369b2730 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 13:49:56 +0100 Subject: [PATCH 43/51] improved unit tests asserts --- .../pkg/core/state_processor_genesis_test.go | 76 ++++++++++++++----- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 9177f7d300..d528c849fd 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -23,6 +23,7 @@ package core_test import ( "testing" + "github.com/berachain/beacon-kit/mod/chain-spec/pkg/chain" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" @@ -94,9 +95,23 @@ func TestInitialize(t *testing.T) { Amount: math.Gwei(cs.EffectiveBalanceIncrement()), Index: uint64(2), }, + { + Pubkey: [48]byte{0x04}, + Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Index: uint64(3), + }, + { + Pubkey: [48]byte{0x05}, + Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Index: uint64(4), + }, } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() - genesisVersion = version.FromUint32[common.Version](version.Deneb) + fork = &types.Fork{ + PreviousVersion: version.FromUint32[common.Version](version.Deneb), + CurrentVersion: version.FromUint32[common.Version](version.Deneb), + Epoch: math.Epoch(constants.GenesisEpoch), + } ) // define mocks expectations @@ -110,7 +125,7 @@ func TestInitialize(t *testing.T) { beaconState, deposits, executionPayloadHeader, - genesisVersion, + fork.CurrentVersion, ) // check outputs @@ -124,24 +139,49 @@ func TestInitialize(t *testing.T) { resFork, err := beaconState.GetFork() require.NoError(t, err) - require.Equal(t, - &types.Fork{ - PreviousVersion: genesisVersion, - CurrentVersion: genesisVersion, - Epoch: math.Epoch(constants.GenesisEpoch), - }, - resFork) + require.Equal(t, fork, resFork) for _, dep := range deposits { - var idx math.U64 - idx, err = beaconState.ValidatorIndexByPubkey(dep.Pubkey) - require.NoError(t, err) - require.Equal(t, math.U64(dep.Index), idx) - - var val *types.Validator - val, err = beaconState.ValidatorByIndex(idx) - require.NoError(t, err) - require.Equal(t, dep.Pubkey, val.Pubkey) + checkValidator(t, cs, beaconState, dep) + } +} + +func checkValidator( + t *testing.T, + cs chain.Spec[ + common.DomainType, + math.Epoch, + common.ExecutionAddress, + math.Slot, + any, + ], + bs *TestBeaconStateT, + dep *types.Deposit, +) { + t.Helper() + + idx, err := bs.ValidatorIndexByPubkey(dep.Pubkey) + require.NoError(t, err) + require.Equal(t, math.U64(dep.Index), idx) + + var val *types.Validator + val, err = bs.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, dep.Pubkey, val.Pubkey) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + ) + switch { + case dep.Amount >= maxBalance: + require.Equal(t, maxBalance, val.EffectiveBalance) + case dep.Amount >= minBalance && dep.Amount < maxBalance: require.Equal(t, dep.Amount, val.EffectiveBalance) + + // validator balance must be multiple of EffectiveBalanceIncrement + require.True(t, val.EffectiveBalance%minBalance == 0) + case dep.Amount < minBalance: + require.Equal(t, math.Gwei(0), val.EffectiveBalance) } } From 8bf34dbf6093bbde3a5b9ab82888f51b63557df8 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 14:57:30 +0100 Subject: [PATCH 44/51] appease linter --- .../pkg/core/state_processor_genesis_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index d528c849fd..8bc42db628 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -164,8 +164,7 @@ func checkValidator( require.NoError(t, err) require.Equal(t, math.U64(dep.Index), idx) - var val *types.Validator - val, err = bs.ValidatorByIndex(idx) + val, err := bs.ValidatorByIndex(idx) require.NoError(t, err) require.Equal(t, dep.Pubkey, val.Pubkey) @@ -180,7 +179,7 @@ func checkValidator( require.Equal(t, dep.Amount, val.EffectiveBalance) // validator balance must be multiple of EffectiveBalanceIncrement - require.True(t, val.EffectiveBalance%minBalance == 0) + require.Equal(t, math.U64(0), val.EffectiveBalance%minBalance) case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } From d90a95a7fffafdd8bfe28bac7a2acc8e3ee3c48c Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Thu, 31 Oct 2024 15:48:23 +0100 Subject: [PATCH 45/51] fix(state-transition): fix deposit index upon genesis processing (#2116) --- .../pkg/core/state_processor.go | 4 +++ .../pkg/core/state_processor_genesis.go | 34 ++++++++++++------- .../pkg/core/state_processor_genesis_test.go | 5 +++ .../pkg/core/state_processor_staking.go | 19 +++++++---- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 439cf3895f..df473e6ebc 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -85,6 +85,10 @@ type StateProcessor[ executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ] + + // processingGenesis allows initializing correctly + // eth1 deposit index upon genesis + processingGenesis bool } // NewStateProcessor creates a new state processor. diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index a142950598..9e7502b0df 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -47,6 +47,11 @@ func (sp *StateProcessor[ executionPayloadHeader ExecutionPayloadHeaderT, genesisVersion common.Version, ) (transition.ValidatorUpdates, error) { + sp.processingGenesis = true + defer func() { + sp.processingGenesis = false + }() + var ( blkHeader BeaconBlockHeaderT blkBody BeaconBlockBodyT @@ -67,25 +72,28 @@ func (sp *StateProcessor[ return nil, err } - if err := st.SetEth1DepositIndex(0); err != nil { - return nil, err - } + // Eth1DepositIndex will be set in processDeposit - if err := st.SetEth1Data(eth1Data.New( - common.Root{}, - 0, - executionPayloadHeader.GetBlockHash(), - )); err != nil { + if err := st.SetEth1Data( + eth1Data.New( + common.Root{}, + 0, + executionPayloadHeader.GetBlockHash(), + )); err != nil { return nil, err } // TODO: we need to handle common.Version vs // uint32 better. - bodyRoot := blkBody.Empty( - version.ToUint32(genesisVersion)).HashTreeRoot() - if err := st.SetLatestBlockHeader(blkHeader.New( - 0, 0, common.Root{}, common.Root{}, bodyRoot, - )); err != nil { + bodyRoot := blkBody.Empty(version.ToUint32(genesisVersion)).HashTreeRoot() + if err := st.SetLatestBlockHeader( + blkHeader.New( + 0, // slot + 0, // proposer index + common.Root{}, // parent block root + common.Root{}, // state root + bodyRoot, + )); err != nil { return nil, err } diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 8bc42db628..f784add974 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -183,4 +183,9 @@ func checkValidator( case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } + + // check that validator index is duly set + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(deposits)-1), latestValIdx) } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index fc336908da..a798b1fcfc 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -21,6 +21,8 @@ package core import ( + "fmt" + "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -83,14 +85,19 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - depositIndex, err := st.GetEth1DepositIndex() - if err != nil { - return err + var nextDepositIndex uint64 + switch depositIndex, err := st.GetEth1DepositIndex(); { + case err == nil: + nextDepositIndex = depositIndex + 1 + case sp.processingGenesis && err != nil: + // Eth1DepositIndex may have not been set yet + nextDepositIndex = 0 + default: + // Failed retrieving Eth1DepositIndex outside genesis is an error + return fmt.Errorf("failed retrieving eth1 deposit index: %w", err) } - if err = st.SetEth1DepositIndex( - depositIndex + 1, - ); err != nil { + if err := st.SetEth1DepositIndex(nextDepositIndex); err != nil { return err } From e17d29c20402fb9ec127517ba5182b45b65530a9 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 17:47:36 +0100 Subject: [PATCH 46/51] fixed bad merge --- .../pkg/core/state_processor_genesis_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index f784add974..1c4994747c 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -144,6 +144,11 @@ func TestInitialize(t *testing.T) { for _, dep := range deposits { checkValidator(t, cs, beaconState, dep) } + + // check that validator index is duly set + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(deposits)-1), latestValIdx) } func checkValidator( @@ -183,9 +188,4 @@ func checkValidator( case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } - - // check that validator index is duly set - latestValIdx, err := beaconState.GetEth1DepositIndex() - require.NoError(t, err) - require.Equal(t, uint64(len(deposits)-1), latestValIdx) } From 11df8e54be153e276549668d7ee23e20a4789c09 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 23:35:59 +0100 Subject: [PATCH 47/51] fixed comment --- mod/state-transition/pkg/core/state_processor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 244464a05c..cb7e622d98 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -378,7 +378,7 @@ func (sp *StateProcessor[ ) } - // Check to make sure the proposer isn't slashed. + // Verify that proposer matches with what consensus declares as proposer proposer, err := st.ValidatorByIndex(blk.GetProposerIndex()) if err != nil { return err @@ -394,6 +394,7 @@ func (sp *StateProcessor[ ) } + // Check to make sure the proposer isn't slashed. if proposer.IsSlashed() { return errors.Wrapf( ErrSlashedProposer, From af8c5e0cda68b29d22de20d9a3c26dd692f5b6ab Mon Sep 17 00:00:00 2001 From: gummy Date: Fri, 1 Nov 2024 11:16:26 -0400 Subject: [PATCH 48/51] fix(build): erigon repo --- build/scripts/testing.mk | 4 ++-- kurtosis/beaconkit-all.yaml | 2 +- kurtosis/beaconkit-base-gcp.yaml | 2 +- kurtosis/src/nodes/nodes.star | 2 +- testing/e2e/config/config.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/scripts/testing.mk b/build/scripts/testing.mk index 4606bcb27e..63aa559979 100644 --- a/build/scripts/testing.mk +++ b/build/scripts/testing.mk @@ -202,7 +202,7 @@ start-erigon: ## start an ephemeral `erigon` node docker run \ --rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \ -v $(PWD)/.tmp:/.tmp \ - thorax/erigon:latest init \ + erigontech/erigon:latest init \ --datadir .tmp/erigon \ ${ETH_GENESIS_PATH} @@ -212,7 +212,7 @@ start-erigon: ## start an ephemeral `erigon` node -p 8551:8551 \ --rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \ -v $(PWD)/.tmp:/.tmp \ - thorax/erigon:latest \ + erigontech/erigon:latest \ --http \ --http.addr 0.0.0.0 \ --http.api eth,net \ diff --git a/kurtosis/beaconkit-all.yaml b/kurtosis/beaconkit-all.yaml index 51ec2c25b8..ca38639165 100644 --- a/kurtosis/beaconkit-all.yaml +++ b/kurtosis/beaconkit-all.yaml @@ -93,7 +93,7 @@ node_settings: max_memory: 2048 images: besu: hyperledger/besu:24.5.4 - erigon: thorax/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.1 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/beaconkit-base-gcp.yaml b/kurtosis/beaconkit-base-gcp.yaml index 8fe056d0ee..a2229d4971 100644 --- a/kurtosis/beaconkit-base-gcp.yaml +++ b/kurtosis/beaconkit-base-gcp.yaml @@ -88,7 +88,7 @@ node_settings: max_memory: 32768 images: besu: hyperledger/besu:latest - erigon: thorax/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.1 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/src/nodes/nodes.star b/kurtosis/src/nodes/nodes.star index 705f0b2339..cae4d7233c 100644 --- a/kurtosis/src/nodes/nodes.star +++ b/kurtosis/src/nodes/nodes.star @@ -33,7 +33,7 @@ EXECUTION_DEFAULT_SETTINGS = { }, "images": { "besu": "hyperledger/besu:latest", - "erigon": "thorax/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.1", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:latest", "nethermind": "nethermind/nethermind:latest", diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index ae93473c43..9af5cc858f 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -272,7 +272,7 @@ func defaultExecutionSettings() ExecutionSettings { }, Images: map[string]string{ "besu": "hyperledger/besu:24.5.4", - "erigon": "thorax/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.1", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:stable", "nethermind": "nethermind/nethermind:latest", From 023ebfdf3f1be0ce53129ed5cc88c66961c20f97 Mon Sep 17 00:00:00 2001 From: gummy Date: Fri, 1 Nov 2024 11:49:56 -0400 Subject: [PATCH 49/51] fix(build): bump erigon to recent version --- kurtosis/beaconkit-all.yaml | 2 +- kurtosis/beaconkit-base-gcp.yaml | 2 +- kurtosis/src/nodes/nodes.star | 2 +- testing/e2e/config/config.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kurtosis/beaconkit-all.yaml b/kurtosis/beaconkit-all.yaml index ca38639165..83ce38a2a4 100644 --- a/kurtosis/beaconkit-all.yaml +++ b/kurtosis/beaconkit-all.yaml @@ -93,7 +93,7 @@ node_settings: max_memory: 2048 images: besu: hyperledger/besu:24.5.4 - erigon: erigontech/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.9 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/beaconkit-base-gcp.yaml b/kurtosis/beaconkit-base-gcp.yaml index a2229d4971..5692730acd 100644 --- a/kurtosis/beaconkit-base-gcp.yaml +++ b/kurtosis/beaconkit-base-gcp.yaml @@ -88,7 +88,7 @@ node_settings: max_memory: 32768 images: besu: hyperledger/besu:latest - erigon: erigontech/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.9 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/src/nodes/nodes.star b/kurtosis/src/nodes/nodes.star index cae4d7233c..cd2d7a07a3 100644 --- a/kurtosis/src/nodes/nodes.star +++ b/kurtosis/src/nodes/nodes.star @@ -33,7 +33,7 @@ EXECUTION_DEFAULT_SETTINGS = { }, "images": { "besu": "hyperledger/besu:latest", - "erigon": "erigontech/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.9", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:latest", "nethermind": "nethermind/nethermind:latest", diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index 9af5cc858f..00b99de235 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -272,7 +272,7 @@ func defaultExecutionSettings() ExecutionSettings { }, Images: map[string]string{ "besu": "hyperledger/besu:24.5.4", - "erigon": "erigontech/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.9", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:stable", "nethermind": "nethermind/nethermind:latest", From d66b2983bdc6ff91ebe11dabbf74bbc00caab64f Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 18:32:21 +0100 Subject: [PATCH 50/51] nits from code review --- mod/state-transition/pkg/core/state_processor_staking.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a798b1fcfc..3f5b044f31 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -88,13 +88,18 @@ func (sp *StateProcessor[ var nextDepositIndex uint64 switch depositIndex, err := st.GetEth1DepositIndex(); { case err == nil: + // just increment the deposit index if no error nextDepositIndex = depositIndex + 1 case sp.processingGenesis && err != nil: - // Eth1DepositIndex may have not been set yet + // If errored and still processing genesis, + // Eth1DepositIndex may have not been set yet. nextDepositIndex = 0 default: // Failed retrieving Eth1DepositIndex outside genesis is an error - return fmt.Errorf("failed retrieving eth1 deposit index: %w", err) + return fmt.Errorf( + "failed retrieving eth1 deposit index outside of processing genesis: %w", + err, + ) } if err := st.SetEth1DepositIndex(nextDepositIndex); err != nil { From 2811de8219b6b5a1a0c412ae246f4efeb4b01d5c Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 21:20:34 +0100 Subject: [PATCH 51/51] inject validator address verification function from ctor to ease up testing --- mod/node-core/pkg/components/state_processor.go | 1 + mod/state-transition/pkg/core/state_processor.go | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mod/node-core/pkg/components/state_processor.go b/mod/node-core/pkg/components/state_processor.go index 269154b8e5..5a0e156ec4 100644 --- a/mod/node-core/pkg/components/state_processor.go +++ b/mod/node-core/pkg/components/state_processor.go @@ -108,5 +108,6 @@ func ProvideStateProcessor[ in.ChainSpec, in.ExecutionEngine, in.Signer, + crypto.GetAddressFromPubKey, ) } diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index cb7e622d98..393dd67950 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -81,6 +81,10 @@ type StateProcessor[ cs common.ChainSpec // signer is the BLS signer used for cryptographic operations. signer crypto.BLSSigner + // fGetAddressFromPubKey verifies that a validator public key + // matches with the proposer address passed by the consensus + // Injected via ctor to simplify testing. + fGetAddressFromPubKey func(crypto.BLSPubkey) ([]byte, error) // executionEngine is the engine responsible for executing transactions. executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, @@ -137,6 +141,7 @@ func NewStateProcessor[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], signer crypto.BLSSigner, + fGetAddressFromPubKey func(crypto.BLSPubkey) ([]byte, error), ) *StateProcessor[ BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, BeaconStateT, ContextT, DepositT, Eth1DataT, ExecutionPayloadT, @@ -149,9 +154,10 @@ func NewStateProcessor[ ExecutionPayloadHeaderT, ForkT, ForkDataT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT, WithdrawalsT, WithdrawalCredentialsT, ]{ - cs: cs, - executionEngine: executionEngine, - signer: signer, + cs: cs, + executionEngine: executionEngine, + signer: signer, + fGetAddressFromPubKey: fGetAddressFromPubKey, } } @@ -383,7 +389,7 @@ func (sp *StateProcessor[ if err != nil { return err } - stateProposerAddress, err := crypto.GetAddressFromPubKey(proposer.GetPubkey()) + stateProposerAddress, err := sp.fGetAddressFromPubKey(proposer.GetPubkey()) if err != nil { return err }