From f4a7d795e9d0c005617fc8a4fc6f31c12de3ed4e Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 15:45:26 +0100 Subject: [PATCH 01/52] 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 000000000..cc3020581 --- /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 02/52] 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 cc3020581..4184c762e 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 03/52] 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 000000000..163183078 --- /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 4184c762e..d27efca6a 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 04/52] 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 d27efca6a..88450c897 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 05/52] 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 88450c897..a37cca2a1 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 06/52] 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 a98def71a..fc336908d 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 07/52] 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 606223630..dbbc91611 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 66e4f89a3..02cd17ab7 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 94ad0fad6..688aad3a3 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 0ec103484..01235c4ba 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 17d2d80e8..784cdda80 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 c9d0cd0b6..5e019b582 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 184d2d702..1f9fdf130 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 4e532a619..74f3b716a 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 a7103536e..7dcf5f300 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 73404aa0d..655e2123b 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 d7dbcb674..72fd41fa4 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 4ea1d83c1..a9e52cb13 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 163183078..b982800a6 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 000000000..9b7182a9b --- /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 000000000..cc750bf21 --- /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 000000000..e8353c6e6 --- /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 000000000..c85719222 --- /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 000000000..580f0c771 --- /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 000000000..d424fc8c1 --- /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 000000000..77baa0408 --- /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 000000000..9f22de5ea --- /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 000000000..eda051f23 --- /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 000000000..5b0d48628 --- /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 000000000..d008b496f --- /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 000000000..1956f9c88 --- /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 000000000..099e28e5d --- /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 000000000..be45aad8a --- /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 000000000..935e71369 --- /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 000000000..82b8b930d --- /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 000000000..9245a3de7 --- /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 000000000..15a4fb46b --- /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 000000000..e76e91136 --- /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 000000000..291d70a83 --- /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 000000000..677433b90 --- /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 000000000..a6020ec38 --- /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 000000000..6cd16f7b5 --- /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 000000000..734901531 --- /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 000000000..3f4d7bfca --- /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 a37cca2a1..354f0c723 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 5a359344d..6edcb5a71 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 51334ce80..b0e33eddf 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 97c0431b2..e076d6ed3 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 08/52] 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 dbbc91611..606223630 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 02cd17ab7..66e4f89a3 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 688aad3a3..94ad0fad6 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 01235c4ba..0ec103484 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 784cdda80..17d2d80e8 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 5e019b582..c9d0cd0b6 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 1f9fdf130..184d2d702 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 74f3b716a..4e532a619 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 7dcf5f300..a7103536e 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 655e2123b..73404aa0d 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 72fd41fa4..d7dbcb674 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 a9e52cb13..4ea1d83c1 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 b982800a6..163183078 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 9b7182a9b..000000000 --- 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 cc750bf21..000000000 --- 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 e8353c6e6..000000000 --- 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 c85719222..000000000 --- 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 580f0c771..000000000 --- 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 d424fc8c1..000000000 --- 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 77baa0408..000000000 --- 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 9f22de5ea..000000000 --- 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 eda051f23..000000000 --- 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 5b0d48628..000000000 --- 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 d008b496f..000000000 --- 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 1956f9c88..000000000 --- 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 099e28e5d..000000000 --- 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 be45aad8a..000000000 --- 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 935e71369..000000000 --- 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 82b8b930d..000000000 --- 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 9245a3de7..000000000 --- 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 15a4fb46b..000000000 --- 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 e76e91136..000000000 --- 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 291d70a83..000000000 --- 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 677433b90..000000000 --- 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 a6020ec38..000000000 --- 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 6cd16f7b5..000000000 --- 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 734901531..000000000 --- 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 3f4d7bfca..000000000 --- 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 354f0c723..a37cca2a1 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 6edcb5a71..5a359344d 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 b0e33eddf..51334ce80 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 e076d6ed3..97c0431b2 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 09/52] 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 606223630..d1b168a55 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 163183078..b982800a6 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 000000000..18e35998e --- /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 a37cca2a1..20996901e 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 5a359344d..ab05bd3c0 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 10/52] 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 d1b168a55..e4efc43af 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 b982800a6..ceba3b643 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 ab05bd3c0..26ef87792 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 6a191d193b23bd82d0f89571432424ccb001c432 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 30 Oct 2024 17:02:50 +0100 Subject: [PATCH 11/52] validate deposits against deposit store ones --- beacond/cmd/defaults.go | 4 +- mod/beacon/validator/block_builder.go | 3 +- .../pkg/components/state_processor.go | 9 +++- .../pkg/core/state_processor.go | 3 ++ .../pkg/core/state_processor_genesis_test.go | 1 + .../pkg/core/state_processor_staking.go | 41 ++++++++++++------- mod/state-transition/pkg/core/types.go | 9 ++++ 7 files changed, 51 insertions(+), 19 deletions(-) diff --git a/beacond/cmd/defaults.go b/beacond/cmd/defaults.go index e4ede16b8..3cc2294f4 100644 --- a/beacond/cmd/defaults.go +++ b/beacond/cmd/defaults.go @@ -119,8 +119,8 @@ func DefaultComponents() []any { ], components.ProvideStateProcessor[ *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, - *BeaconState, *BeaconStateMarshallable, *Deposit, *ExecutionPayload, - *ExecutionPayloadHeader, *KVStore, + *BeaconState, *BeaconStateMarshallable, *Deposit, *DepositStore, + *ExecutionPayload, *ExecutionPayloadHeader, *KVStore, ], components.ProvideKVStore[*BeaconBlockHeader, *ExecutionPayloadHeader], components.ProvideStorageBackend[ diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 7e82b18f8..dbe23a28d 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -87,7 +87,8 @@ func (s *Service[ envelope, err := s.retrieveExecutionPayload(ctx, st, blk) if err != nil { return blk, sidecars, err - } else if envelope == nil { + } + if envelope == nil { return blk, sidecars, ErrNilPayload } diff --git a/mod/node-core/pkg/components/state_processor.go b/mod/node-core/pkg/components/state_processor.go index 269154b8e..0035efecc 100644 --- a/mod/node-core/pkg/components/state_processor.go +++ b/mod/node-core/pkg/components/state_processor.go @@ -36,6 +36,7 @@ type StateProcessorInput[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], ExecutionPayloadHeaderT ExecutionPayloadHeader[ExecutionPayloadHeaderT], + DepositT Deposit[DepositT, *ForkData, WithdrawalCredentials], WithdrawalT Withdrawal[WithdrawalT], WithdrawalsT Withdrawals[WithdrawalT], ] struct { @@ -47,7 +48,8 @@ type StateProcessorInput[ PayloadID, WithdrawalsT, ] - Signer crypto.BLSSigner + DepositStore DepositStore[DepositT] + Signer crypto.BLSSigner } // ProvideStateProcessor provides the state processor to the depinject @@ -66,6 +68,7 @@ func ProvideStateProcessor[ ], BeaconStateMarshallableT any, DepositT Deposit[DepositT, *ForkData, WithdrawalCredentials], + DepositStoreT DepositStore[DepositT], ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], @@ -78,7 +81,8 @@ func ProvideStateProcessor[ WithdrawalT Withdrawal[WithdrawalT], ]( in StateProcessorInput[ - ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalT, WithdrawalsT, + ExecutionPayloadT, ExecutionPayloadHeaderT, + DepositT, WithdrawalT, WithdrawalsT, ], ) *core.StateProcessor[ BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, @@ -107,6 +111,7 @@ func ProvideStateProcessor[ ]( in.ChainSpec, in.ExecutionEngine, + in.DepositStore, in.Signer, ) } diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 439cf3895..6edbba605 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -85,6 +85,7 @@ type StateProcessor[ executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ] + ds DepositStore[DepositT] } // NewStateProcessor creates a new state processor. @@ -136,6 +137,7 @@ func NewStateProcessor[ executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], + ds DepositStore[DepositT], signer crypto.BLSSigner, ) *StateProcessor[ BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT, @@ -152,6 +154,7 @@ func NewStateProcessor[ cs: cs, executionEngine: executionEngine, signer: signer, + ds: ds, } } 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 20996901e..2f853a922 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -108,6 +108,7 @@ func TestInitialize(t *testing.T) { ]( cs, execEngine, + nil, // TODO: add deposit store mocksSigner, ) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index fc336908d..565f779cb 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -21,6 +21,9 @@ package core import ( + "fmt" + "reflect" + "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" @@ -36,26 +39,36 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { - // Verify that outstanding deposits are processed up to the maximum number - // of deposits. - deposits := blk.GetBody().GetDeposits() - index, err := st.GetEth1DepositIndex() + // Verify that outstanding deposits matches those listed by contract + depositIndex, err := st.GetEth1DepositIndex() if err != nil { return err } - eth1Data, err := st.GetEth1Data() + + stateDeposits, err := sp.ds.GetDepositsByIndex( + depositIndex, + sp.cs.MaxDepositsPerBlock(), + ) if err != nil { return err } - depositCount := min( - sp.cs.MaxDepositsPerBlock(), - eth1Data.GetDepositCount().Unwrap()-index, - ) - _ = depositCount - // TODO: Update eth1data count and check this. - // if uint64(len(deposits)) != depositCount { - // return errors.New("deposit count mismatch") - // } + + deposits := blk.GetBody().GetDeposits() + if len(stateDeposits) != len(deposits) { + return fmt.Errorf("deposits mismatched lengths, state: %d, payload: %d", + len(stateDeposits), + len(deposits), + ) + } + + for i, sd := range stateDeposits { + if !reflect.DeepEqual(sd, deposits[i]) { + return fmt.Errorf("deposits mismatched, idx %d state: %v, payload: %v", + i, sd, deposits[i], + ) + } + } + return sp.processDeposits(st, deposits) } diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 26ef87792..f01ac60f9 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -142,6 +142,15 @@ type Deposit[ ) error } +// DepositStore defines the interface for deposit storage. +type DepositStore[DepositT any] interface { + // GetDepositsByIndex returns `numView` expected deposits. + GetDepositsByIndex( + startIndex uint64, + numView uint64, + ) ([]DepositT, error) +} + type ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT any, ] interface { From 64d19e59c0ff97f57b2fb4f246e1717e042dca17 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 30 Oct 2024 20:43:46 +0100 Subject: [PATCH 12/52] cleaned up UTs --- mod/state-transition/pkg/core/helpers_test.go | 33 +++++++++++-------- .../pkg/core/state_processor_genesis_test.go | 8 ++--- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index ceba3b643..35a78625c 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -33,6 +33,7 @@ import ( "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" + depositstore "github.com/berachain/beacon-kit/mod/storage/pkg/deposit" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" @@ -54,7 +55,7 @@ var ( testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} ) -func initTestStore() ( +func initTestStores() ( *beacondb.KVStore[ *types.BeaconBlockHeader, *types.Eth1Data, @@ -62,10 +63,12 @@ func initTestStore() ( *types.Fork, *types.Validator, types.Validators, - ], error) { + ], + *depositstore.KVStore[*types.Deposit], + error) { db, err := db.OpenDB("", dbm.MemDBBackend) if err != nil { - return nil, fmt.Errorf("failed opening mem db: %w", err) + return nil, nil, fmt.Errorf("failed opening mem db: %w", err) } var ( nopLog = log.NewNopLogger() @@ -81,19 +84,21 @@ func initTestStore() ( 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) + return nil, 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 + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ]( + testStoreService, + testCodec, + ), + depositstore.NewStore[*types.Deposit](testStoreService), + 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 2f853a922..d02ed22ed 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -87,6 +87,9 @@ func TestInitialize(t *testing.T) { ](t) mocksSigner := &cryptomocks.BLSSigner{} + kvStore, depositStore, err := initTestStores() + require.NoError(t, err) + sp := core.NewStateProcessor[ *types.BeaconBlock, *types.BeaconBlockBody, @@ -108,14 +111,11 @@ func TestInitialize(t *testing.T) { ]( cs, execEngine, - nil, // TODO: add deposit store + depositStore, mocksSigner, ) // create test inputs - kvStore, err := initTestStore() - require.NoError(t, err) - var ( beaconState = new(TestBeaconStateT).NewFromDB(kvStore, cs) deposits = []*types.Deposit{ From d94bf977757482b079f507509ee6dcb8e2666aac Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 30 Oct 2024 23:10:13 +0100 Subject: [PATCH 13/52] nits --- 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 35a78625c..df52cc51d 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" depositstore "github.com/berachain/beacon-kit/mod/storage/pkg/deposit" @@ -39,6 +41,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 d02ed22ed..0d0e99901 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 4a9fe1c8453740555f9b52d310c28f23ac282eb4 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 12:36:49 +0100 Subject: [PATCH 14/52] 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 ceba3b643..25b71c203 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 20996901e..9177f7d30 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 15/52] 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 9177f7d30..d528c849f 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 16/52] 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 d528c849f..8bc42db62 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 17/52] 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 439cf3895..df473e6eb 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 a14295059..9e7502b0d 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 8bc42db62..f784add97 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 fc336908d..a798b1fcf 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 18/52] 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 f784add97..1c4994747 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 af8c5e0cda68b29d22de20d9a3c26dd692f5b6ab Mon Sep 17 00:00:00 2001 From: gummy Date: Fri, 1 Nov 2024 11:16:26 -0400 Subject: [PATCH 19/52] 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 4606bcb27..63aa55997 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 51ec2c25b..ca3863916 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 8fe056d0e..a2229d497 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 705f0b233..cae4d7233 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 ae93473c4..9af5cc858 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 20/52] 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 ca3863916..83ce38a2a 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 a2229d497..5692730ac 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 cae4d7233..cd2d7a07a 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 9af5cc858..00b99de23 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 21/52] 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 a798b1fcf..3f5b044f3 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 e47219a0c6c80a7bff967d6dc0fdd9c3f0ab0f75 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 00:29:08 +0100 Subject: [PATCH 22/52] fixed deposit index use + UTs --- .../pkg/core/state_processor_staking.go | 1 + .../pkg/core/state_processor_staking_test.go | 211 ++++++++++++++++++ 2 files changed, 212 insertions(+) create mode 100644 mod/state-transition/pkg/core/state_processor_staking_test.go diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 0bc6e4954..fe047680b 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -44,6 +44,7 @@ func (sp *StateProcessor[ if err != nil { return err } + depositIndex++ stateDeposits, err := sp.ds.GetDepositsByIndex( depositIndex, diff --git a/mod/state-transition/pkg/core/state_processor_staking_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go new file mode 100644 index 000000000..f7c9a7976 --- /dev/null +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -0,0 +1,211 @@ +// 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/common" + 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" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" +) + +// TestTransitionUpdateValidators shows that when validator is +// updated (increasing amount), corrensponding balance is updated. +func TestTransitionUpdateValidators(t *testing.T) { + // Create state processor to test + cs := spec.BetnetChainSpec() + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} + + kvStore, depositStore, err := initTestStores() + require.NoError(t, err) + beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + sp := 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, + execEngine, + depositStore, + mocksSigner, + ) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + emptyAddress = common.ExecutionAddress{} + emptyCredentials = types.NewCredentialsFromExecutionAddress( + emptyAddress, + ) + ) + + // Setup initial state via genesis + // TODO: consider instead setting state artificially + var ( + genDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x01}, + Credentials: emptyCredentials, + Amount: maxBalance - 3*minBalance, + Index: uint64(0), + }, + { + Pubkey: [48]byte{0x02}, + Credentials: emptyCredentials, + Amount: maxBalance - 6*minBalance, + Index: uint64(1), + }, + } + genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genVersion = version.FromUint32[common.Version](version.Deneb) + ) + + mocksSigner.On( + "VerifySignature", + mock.Anything, mock.Anything, mock.Anything, + ).Return(nil) + + _, err = sp.InitializePreminedBeaconStateFromEth1( + beaconState, + genDeposits, + genPayloadHeader, + genVersion, + ) + require.NoError(t, err) + + // create test inputs + var ( + ctx = &transition.Context{ + SkipPayloadVerification: true, + SkipValidateResult: true, + } + blkDeposits = []*types.Deposit{ + { + Pubkey: genDeposits[0].Pubkey, + Credentials: emptyCredentials, + Amount: minBalance, // avoid breaching maxBalance + Index: uint64(len(genDeposits)), + }, + } + ) + + genBlockHeader := updateStateRootForLatestBlock(t, beaconState) + blk := &types.BeaconBlock{ + Slot: genBlockHeader.GetSlot() + 1, + ProposerIndex: genBlockHeader.GetProposerIndex(), + ParentRoot: genBlockHeader.HashTreeRoot(), + StateRoot: common.Root{}, + Body: &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: 10, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: 0, + Address: emptyAddress, + Amount: 0, + }, + { + Index: 1, + Validator: 1, + Address: emptyAddress, + Amount: 0, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: blkDeposits, + }, + } + + // make sure included deposit is already available in deposit store + require.NoError(t, depositStore.EnqueueDeposits(blkDeposits)) + + // run the test + vals, err := sp.Transition(ctx, beaconState, blk) + + // check outputs + require.NoError(t, err) + require.Zero(t, vals) // just update, no new validators + + // check validator is duly updated + expectedValBalance := genDeposits[0].Amount + blkDeposits[0].Amount + idx, err := beaconState.ValidatorIndexByPubkey(genDeposits[0].Pubkey) + require.NoError(t, err) + require.Equal(t, math.U64(genDeposits[0].Index), idx) + + val, err := beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, genDeposits[0].Pubkey, val.Pubkey) + require.Equal(t, expectedValBalance, val.EffectiveBalance) + + // check that validator index is duly set (1-indexed here, to be fixed) + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(genDeposits)), latestValIdx) +} + +func updateStateRootForLatestBlock( + t *testing.T, + bs *TestBeaconStateT, +) *types.BeaconBlockHeader { + t.Helper() + + // here we duly update state root, similarly to what we do in processSlot + latestBlkHeader, err := bs.GetLatestBlockHeader() + require.NoError(t, err) + root := bs.HashTreeRoot() + latestBlkHeader.SetStateRoot(root) + return latestBlkHeader +} From a3cd2d9292b372c940fee8ced1a5d49107e3fddc Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 01:23:50 +0100 Subject: [PATCH 23/52] replace DeelEqual with Equal method --- mod/consensus-types/pkg/types/deposit.go | 8 ++++++++ mod/node-core/pkg/components/interfaces.go | 1 + mod/state-transition/pkg/core/state_processor.go | 4 ++-- mod/state-transition/pkg/core/state_processor_staking.go | 3 +-- mod/state-transition/pkg/core/types.go | 3 +++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/mod/consensus-types/pkg/types/deposit.go b/mod/consensus-types/pkg/types/deposit.go index a205abdf6..ea54333c7 100644 --- a/mod/consensus-types/pkg/types/deposit.go +++ b/mod/consensus-types/pkg/types/deposit.go @@ -187,6 +187,14 @@ func (d *Deposit) GetTree() (*fastssz.Node, error) { /* Getters and Setters */ /* -------------------------------------------------------------------------- */ +func (d *Deposit) Equals(rhs *Deposit) bool { + return d.Pubkey == rhs.Pubkey && + d.Credentials == rhs.Credentials && + d.Amount == rhs.Amount && + d.Signature == rhs.Signature && + d.Index == rhs.Index +} + // GetAmount returns the deposit amount in gwei. func (d *Deposit) GetAmount() math.Gwei { return d.Amount diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index 370ae20f2..cea7ef13d 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -358,6 +358,7 @@ type ( crypto.BLSSignature, uint64, ) T + Equals(T) bool // GetIndex returns the index of the deposit. GetIndex() math.U64 // GetAmount returns the amount of the deposit. diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 0875813e1..f34b1c793 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -50,7 +50,7 @@ type StateProcessor[ ValidatorT, ValidatorsT, WithdrawalT, ], ContextT Context, - DepositT Deposit[ForkDataT, WithdrawalCredentialsT], + DepositT Deposit[DepositT, ForkDataT, WithdrawalCredentialsT], Eth1DataT interface { New(common.Root, math.U64, common.ExecutionHash) Eth1DataT GetDepositCount() math.U64 @@ -111,7 +111,7 @@ func NewStateProcessor[ KVStoreT, ValidatorT, ValidatorsT, WithdrawalT, ], ContextT Context, - DepositT Deposit[ForkDataT, WithdrawalCredentialsT], + DepositT Deposit[DepositT, ForkDataT, WithdrawalCredentialsT], Eth1DataT interface { New(common.Root, math.U64, common.ExecutionHash) Eth1DataT GetDepositCount() math.U64 diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index fe047680b..378c9fc04 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -22,7 +22,6 @@ package core import ( "fmt" - "reflect" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" @@ -63,7 +62,7 @@ func (sp *StateProcessor[ } for i, sd := range stateDeposits { - if !reflect.DeepEqual(sd, deposits[i]) { + if !sd.Equals(deposits[i]) { return fmt.Errorf("deposits mismatched, idx %d state: %v, payload: %v", i, sd, deposits[i], ) diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index f01ac60f9..afd2455ac 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -122,9 +122,12 @@ type Context interface { // Deposit is the interface for a deposit. type Deposit[ + DepositT any, ForkDataT any, WithdrawlCredentialsT ~[32]byte, ] interface { + // Equals returns true if the withdrawal is equal to the other. + Equals(DepositT) bool // GetAmount returns the amount of the deposit. GetAmount() math.Gwei // GetPubkey returns the public key of the validator. From 3a0923e1d71e78f7530ac5120ddaae1a5cfcfe2e Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 01:33:02 +0100 Subject: [PATCH 24/52] nits --- mod/consensus-types/pkg/types/deposit.go | 2 +- mod/node-core/pkg/components/interfaces.go | 1 + mod/state-transition/pkg/core/types.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/consensus-types/pkg/types/deposit.go b/mod/consensus-types/pkg/types/deposit.go index ea54333c7..96e4f4f23 100644 --- a/mod/consensus-types/pkg/types/deposit.go +++ b/mod/consensus-types/pkg/types/deposit.go @@ -186,7 +186,7 @@ func (d *Deposit) GetTree() (*fastssz.Node, error) { /* -------------------------------------------------------------------------- */ /* Getters and Setters */ /* -------------------------------------------------------------------------- */ - +// Equals returns true if the Deposit is equal to the other. func (d *Deposit) Equals(rhs *Deposit) bool { return d.Pubkey == rhs.Pubkey && d.Credentials == rhs.Credentials && diff --git a/mod/node-core/pkg/components/interfaces.go b/mod/node-core/pkg/components/interfaces.go index cea7ef13d..e4fc6e7e8 100644 --- a/mod/node-core/pkg/components/interfaces.go +++ b/mod/node-core/pkg/components/interfaces.go @@ -358,6 +358,7 @@ type ( crypto.BLSSignature, uint64, ) T + // Equals returns true if the Deposit is equal to the other. Equals(T) bool // GetIndex returns the index of the deposit. GetIndex() math.U64 diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index afd2455ac..bc0fae0b3 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -126,7 +126,7 @@ type Deposit[ ForkDataT any, WithdrawlCredentialsT ~[32]byte, ] interface { - // Equals returns true if the withdrawal is equal to the other. + // Equals returns true if the Deposit is equal to the other. Equals(DepositT) bool // GetAmount returns the amount of the deposit. GetAmount() math.Gwei From 6b90b87fe36b0b756500da56035f40c09fbae79f Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 12:22:43 +0100 Subject: [PATCH 25/52] added logger to state processor --- beacond/cmd/defaults.go | 2 +- mod/node-core/pkg/components/state_processor.go | 7 ++++++- mod/state-transition/pkg/core/state_processor.go | 5 +++++ .../pkg/core/state_processor_genesis_test.go | 3 +++ mod/state-transition/pkg/core/state_processor_staking.go | 2 +- .../pkg/core/state_processor_staking_test.go | 3 +++ mod/storage/pkg/deposit/store.go | 4 ++-- 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/beacond/cmd/defaults.go b/beacond/cmd/defaults.go index 3cc2294f4..7af8d5229 100644 --- a/beacond/cmd/defaults.go +++ b/beacond/cmd/defaults.go @@ -118,7 +118,7 @@ func DefaultComponents() []any { *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, ], components.ProvideStateProcessor[ - *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, + *Logger, *BeaconBlock, *BeaconBlockBody, *BeaconBlockHeader, *BeaconState, *BeaconStateMarshallable, *Deposit, *DepositStore, *ExecutionPayload, *ExecutionPayloadHeader, *KVStore, ], diff --git a/mod/node-core/pkg/components/state_processor.go b/mod/node-core/pkg/components/state_processor.go index 0035efecc..663b645cf 100644 --- a/mod/node-core/pkg/components/state_processor.go +++ b/mod/node-core/pkg/components/state_processor.go @@ -24,6 +24,7 @@ import ( "cosmossdk.io/depinject" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/execution/pkg/engine" + "github.com/berachain/beacon-kit/mod/log" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" @@ -32,6 +33,7 @@ import ( // StateProcessorInput is the input for the state processor for the depinject // framework. type StateProcessorInput[ + LoggerT any, ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ], @@ -41,6 +43,7 @@ type StateProcessorInput[ WithdrawalsT Withdrawals[WithdrawalT], ] struct { depinject.In + Logger LoggerT ChainSpec common.ChainSpec ExecutionEngine *engine.Engine[ ExecutionPayloadT, @@ -55,6 +58,7 @@ type StateProcessorInput[ // ProvideStateProcessor provides the state processor to the depinject // framework. func ProvideStateProcessor[ + LoggerT log.AdvancedLogger[LoggerT], BeaconBlockT BeaconBlock[BeaconBlockT, BeaconBlockBodyT, BeaconBlockHeaderT], BeaconBlockBodyT BeaconBlockBody[ BeaconBlockBodyT, *AttestationData, DepositT, @@ -81,7 +85,7 @@ func ProvideStateProcessor[ WithdrawalT Withdrawal[WithdrawalT], ]( in StateProcessorInput[ - ExecutionPayloadT, ExecutionPayloadHeaderT, + LoggerT, ExecutionPayloadT, ExecutionPayloadHeaderT, DepositT, WithdrawalT, WithdrawalsT, ], ) *core.StateProcessor[ @@ -109,6 +113,7 @@ func ProvideStateProcessor[ WithdrawalsT, WithdrawalCredentials, ]( + in.Logger.With("service", "state-processor"), in.ChainSpec, in.ExecutionEngine, in.DepositStore, diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index f34b1c793..a6ff512a8 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -24,6 +24,7 @@ import ( "bytes" "github.com/berachain/beacon-kit/mod/errors" + "github.com/berachain/beacon-kit/mod/log" "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" @@ -77,6 +78,8 @@ type StateProcessor[ }, WithdrawalCredentialsT ~[32]byte, ] struct { + // logger is used for logging information and errors. + logger log.Logger // cs is the chain specification for the beacon chain. cs common.ChainSpec // signer is the BLS signer used for cryptographic operations. @@ -138,6 +141,7 @@ func NewStateProcessor[ }, WithdrawalCredentialsT ~[32]byte, ]( + logger log.Logger, cs common.ChainSpec, executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, @@ -156,6 +160,7 @@ func NewStateProcessor[ ExecutionPayloadHeaderT, ForkT, ForkDataT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT, WithdrawalsT, WithdrawalCredentialsT, ]{ + logger: logger, cs: cs, executionEngine: executionEngine, signer: signer, 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 b9fe8703b..1685c10ac 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/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/log/pkg/noop" "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" @@ -48,6 +49,7 @@ func TestInitialize(t *testing.T) { engineprimitives.Withdrawals, ](t) mocksSigner := &cryptomocks.BLSSigner{} + noLog := noop.NewLogger[any]() kvStore, depositStore, err := initTestStores() require.NoError(t, err) @@ -71,6 +73,7 @@ func TestInitialize(t *testing.T) { engineprimitives.Withdrawals, types.WithdrawalCredentials, ]( + noLog, cs, execEngine, depositStore, diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 378c9fc04..14ec9d5df 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -63,7 +63,7 @@ func (sp *StateProcessor[ for i, sd := range stateDeposits { if !sd.Equals(deposits[i]) { - return fmt.Errorf("deposits mismatched, idx %d state: %v, payload: %v", + return fmt.Errorf("deposits mismatched, idx %d state: %#v, payload: %#v", i, sd, deposits[i], ) } diff --git a/mod/state-transition/pkg/core/state_processor_staking_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go index f7c9a7976..c49a0af57 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -26,6 +26,7 @@ import ( "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/log/pkg/noop" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -48,6 +49,7 @@ func TestTransitionUpdateValidators(t *testing.T) { engineprimitives.Withdrawals, ](t) mocksSigner := &cryptomocks.BLSSigner{} + noLog := noop.NewLogger[any]() kvStore, depositStore, err := initTestStores() require.NoError(t, err) @@ -72,6 +74,7 @@ func TestTransitionUpdateValidators(t *testing.T) { engineprimitives.Withdrawals, types.WithdrawalCredentials, ]( + noLog, cs, execEngine, depositStore, diff --git a/mod/storage/pkg/deposit/store.go b/mod/storage/pkg/deposit/store.go index a58e9e835..5f19d1734 100644 --- a/mod/storage/pkg/deposit/store.go +++ b/mod/storage/pkg/deposit/store.go @@ -66,8 +66,8 @@ func (kv *KVStore[DepositT]) GetDepositsByIndex( kv.mu.RLock() defer kv.mu.RUnlock() deposits := []DepositT{} - for i := range numView { - deposit, err := kv.store.Get(context.TODO(), startIndex+i) + for i := startIndex; i < startIndex+numView; i++ { + deposit, err := kv.store.Get(context.TODO(), i) if errors.Is(err, sdkcollections.ErrNotFound) { return deposits, nil } From 83ad2fda0307287c876aa179b6c7643db96bdf5b Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 12:36:53 +0100 Subject: [PATCH 26/52] duly incremented build block deposit index --- mod/beacon/validator/block_builder.go | 1 + mod/state-transition/pkg/core/state_processor_staking.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index dbe23a28d..97c2e52a4 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -279,6 +279,7 @@ func (s *Service[ if err != nil { return ErrNilDepositIndexStart } + depositIndex++ // Dequeue deposits from the state. deposits, err := s.sb.DepositStore().GetDepositsByIndex( diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 14ec9d5df..47a9eb31a 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -54,6 +54,11 @@ func (sp *StateProcessor[ } deposits := blk.GetBody().GetDeposits() + sp.logger.Info( + "Expected deposit index from payload", depositIndex, + "deposits withdrawals length", len(deposits), + ) + if len(stateDeposits) != len(deposits) { return fmt.Errorf("deposits mismatched lengths, state: %d, payload: %d", len(stateDeposits), @@ -63,8 +68,8 @@ func (sp *StateProcessor[ for i, sd := range stateDeposits { if !sd.Equals(deposits[i]) { - return fmt.Errorf("deposits mismatched, idx %d state: %#v, payload: %#v", - i, sd, deposits[i], + return fmt.Errorf("deposits mismatched, state: %#v, payload: %#v", + sd, deposits[i], ) } } From 69d568b611fd5f3fced9af9aa119b95f482d9708 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 14:29:33 +0100 Subject: [PATCH 27/52] tmp debugging --- mod/beacon/validator/block_builder.go | 2 +- mod/state-transition/pkg/core/state_processor_staking.go | 1 - mod/state-transition/pkg/core/state_processor_staking_test.go | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 97c2e52a4..30fc7e346 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -279,7 +279,7 @@ func (s *Service[ if err != nil { return ErrNilDepositIndexStart } - depositIndex++ + // depositIndex++ // TMP DEBUGGING // Dequeue deposits from the state. deposits, err := s.sb.DepositStore().GetDepositsByIndex( diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 47a9eb31a..ede3a9985 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -43,7 +43,6 @@ func (sp *StateProcessor[ if err != nil { return err } - depositIndex++ stateDeposits, err := sp.ds.GetDepositsByIndex( depositIndex, diff --git a/mod/state-transition/pkg/core/state_processor_staking_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go index c49a0af57..aa5aa91b3 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -134,8 +134,8 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: genDeposits[0].Pubkey, Credentials: emptyCredentials, - Amount: minBalance, // avoid breaching maxBalance - Index: uint64(len(genDeposits)), + Amount: minBalance, // avoid breaching maxBalance + Index: uint64(len(genDeposits)) - 1, // TODO FIX THIS }, } ) From a7143e8b67345d01fdb15f7021c92b0e59231db9 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 19:18:43 +0100 Subject: [PATCH 28/52] improved error expressivity --- mod/storage/pkg/deposit/store.go | 6 +++++- mod/storage/pkg/filedb/range_db.go | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mod/storage/pkg/deposit/store.go b/mod/storage/pkg/deposit/store.go index 5f19d1734..a8274da11 100644 --- a/mod/storage/pkg/deposit/store.go +++ b/mod/storage/pkg/deposit/store.go @@ -23,6 +23,7 @@ package deposit import ( "context" "errors" + "fmt" "sync" sdkcollections "cosmossdk.io/collections" @@ -106,7 +107,10 @@ func (kv *KVStore[DepositT]) setDeposit(deposit DepositT) error { // Prune removes the [start, end) deposits from the store. func (kv *KVStore[DepositT]) Prune(start, end uint64) error { if start > end { - return pruner.ErrInvalidRange + return fmt.Errorf( + "DepositKVStore Prune start: %d, end: %d: %w", + start, end, pruner.ErrInvalidRange, + ) } var ctx = context.TODO() diff --git a/mod/storage/pkg/filedb/range_db.go b/mod/storage/pkg/filedb/range_db.go index 3ac665f96..a8fe1ea0e 100644 --- a/mod/storage/pkg/filedb/range_db.go +++ b/mod/storage/pkg/filedb/range_db.go @@ -94,7 +94,10 @@ func (db *RangeDB) DeleteRange(from, to uint64) error { return errors.New("rangedb: delete range not supported for this db") } if from > to { - return pruner.ErrInvalidRange + return fmt.Errorf( + "RangeDB DeleteRange start: %d, end: %d: %w", + from, to, pruner.ErrInvalidRange, + ) } for ; from < to; from++ { path := strconv.FormatUint(from, 10) + "/" @@ -109,7 +112,10 @@ func (db *RangeDB) DeleteRange(from, to uint64) error { func (db *RangeDB) Prune(start, end uint64) error { start = max(start, db.firstNonNilIndex) if start > end { - return pruner.ErrInvalidRange + return fmt.Errorf( + "RangeDB Prune start: %d, end: %d: %w", + start, end, pruner.ErrInvalidRange, + ) } if err := db.DeleteRange(start, end); err != nil { From 10bd5978d80bc867e868e41d524ebd2076e7512c Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 12:37:10 +0100 Subject: [PATCH 29/52] improved logging --- mod/state-transition/pkg/core/errors.go | 10 ++++++++++ .../pkg/core/state_processor_staking.go | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index c384c8c19..bda1ff077 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -30,8 +30,18 @@ var ( // match the expected value. ErrSlotMismatch = errors.New("slot mismatch") + // ErrProposerMismatch is returned when proposer referenced in block does + // not match with proposer reported by consensus. ErrProposerMismatch = errors.New("proposer key mismatch") + // ErrDepositsLengthMismatch is returned when length of deposits + // listed in block is different from deposits from store. + ErrDepositsLengthMismatch = errors.New("deposits lengths mismatched") + + // ErrDepositsLengthMismatch is returned when a specific deposit + // listed in block is different from the corrispondent one from store. + ErrDepositMismatch = errors.New("deposit mismatched") + // 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_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a78527082..712342f85 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -61,7 +61,8 @@ func (sp *StateProcessor[ ) if len(stateDeposits) != len(deposits) { - return fmt.Errorf("deposits mismatched lengths, state: %d, payload: %d", + return fmt.Errorf("%w, state: %d, payload: %d", + ErrDepositsLengthMismatch, len(stateDeposits), len(deposits), ) @@ -69,9 +70,11 @@ func (sp *StateProcessor[ for i, sd := range stateDeposits { if !sd.Equals(deposits[i]) { - return fmt.Errorf("deposits mismatched, state: %#v, payload: %#v", - sd, deposits[i], + sp.logger.Error(ErrDepositMismatch.Error(), + "state deposit", sd, + "payload deposit", deposits[i], ) + return ErrDepositMismatch } } From a15eaa3624e16e4d8cf398f17321e911ded9647f Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 13:15:24 +0100 Subject: [PATCH 30/52] added logging to deposit store --- beacond/cmd/defaults.go | 2 +- mod/node-core/pkg/components/deposit_store.go | 13 ++- mod/state-transition/pkg/core/helpers_test.go | 2 +- .../pkg/core/state_processor_staking.go | 4 +- mod/storage/pkg/deposit/store.go | 107 ++++++++++++++---- 5 files changed, 100 insertions(+), 28 deletions(-) diff --git a/beacond/cmd/defaults.go b/beacond/cmd/defaults.go index 5d866ab16..43afbaa3d 100644 --- a/beacond/cmd/defaults.go +++ b/beacond/cmd/defaults.go @@ -87,7 +87,7 @@ func DefaultComponents() []any { *DepositContract, *DepositStore, *ExecutionPayload, *ExecutionPayloadHeader, *Logger, ], - components.ProvideDepositStore[*Deposit], + components.ProvideDepositStore[*Deposit, *Logger], components.ProvideDispatcher[ *ConsensusBlock, *BeaconBlock, *ConsensusSidecars, *BlobSidecars, diff --git a/mod/node-core/pkg/components/deposit_store.go b/mod/node-core/pkg/components/deposit_store.go index ee0012f64..5473bff08 100644 --- a/mod/node-core/pkg/components/deposit_store.go +++ b/mod/node-core/pkg/components/deposit_store.go @@ -37,8 +37,11 @@ import ( ) // DepositStoreInput is the input for the dep inject framework. -type DepositStoreInput struct { +type DepositStoreInput[ + LoggerT log.AdvancedLogger[LoggerT], +] struct { depinject.In + Logger LoggerT AppOpts config.AppOptions } @@ -48,8 +51,9 @@ func ProvideDepositStore[ DepositT Deposit[ DepositT, *ForkData, WithdrawalCredentials, ], + LoggerT log.AdvancedLogger[LoggerT], ]( - in DepositStoreInput, + in DepositStoreInput[LoggerT], ) (*depositstore.KVStore[DepositT], error) { name := "deposits" dir := cast.ToString(in.AppOpts.Get(flags.FlagHome)) + "/data" @@ -58,7 +62,10 @@ func ProvideDepositStore[ return nil, err } - return depositstore.NewStore[DepositT](storage.NewKVStoreProvider(kvp)), nil + return depositstore.NewStore[DepositT]( + storage.NewKVStoreProvider(kvp), + in.Logger.With("service", "deposit-store"), + ), nil } // DepositPrunerInput is the input for the deposit pruner. diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index efbe0ab08..e1527348e 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -202,7 +202,7 @@ func initTestStores() ( testStoreService, testCodec, ), - depositstore.NewStore[*types.Deposit](testStoreService), + depositstore.NewStore[*types.Deposit](testStoreService, nopLog), nil } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 712342f85..f3b47530e 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -56,6 +56,7 @@ func (sp *StateProcessor[ deposits := blk.GetBody().GetDeposits() sp.logger.Info( + "processOperations", "Expected deposit index from payload", depositIndex, "deposits withdrawals length", len(deposits), ) @@ -70,7 +71,8 @@ func (sp *StateProcessor[ for i, sd := range stateDeposits { if !sd.Equals(deposits[i]) { - sp.logger.Error(ErrDepositMismatch.Error(), + sp.logger.Error( + ErrDepositMismatch.Error(), "state deposit", sd, "payload deposit", deposits[i], ) diff --git a/mod/storage/pkg/deposit/store.go b/mod/storage/pkg/deposit/store.go index a8274da11..90abf9732 100644 --- a/mod/storage/pkg/deposit/store.go +++ b/mod/storage/pkg/deposit/store.go @@ -28,6 +28,7 @@ import ( sdkcollections "cosmossdk.io/collections" "cosmossdk.io/core/store" + "github.com/berachain/beacon-kit/mod/log" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" "github.com/berachain/beacon-kit/mod/storage/pkg/pruner" ) @@ -38,12 +39,18 @@ const KeyDepositPrefix = "deposit" // the deposit indexes are tracked outside of the kv store. type KVStore[DepositT Deposit[DepositT]] struct { store sdkcollections.Map[uint64, DepositT] - mu sync.RWMutex + + // mu protects store for concurrent access + mu sync.RWMutex + + // logger is used for logging information and errors. + logger log.Logger } // NewStore creates a new deposit store. func NewStore[DepositT Deposit[DepositT]]( kvsp store.KVStoreService, + logger log.Logger, ) *KVStore[DepositT] { schemaBuilder := sdkcollections.NewSchemaBuilder(kvsp) return &KVStore[DepositT]{ @@ -54,6 +61,7 @@ func NewStore[DepositT Deposit[DepositT]]( sdkcollections.Uint64Key, encoding.SSZValueCodec[DepositT]{}, ), + logger: logger, } } @@ -62,50 +70,93 @@ func NewStore[DepositT Deposit[DepositT]]( // last deposit. func (kv *KVStore[DepositT]) GetDepositsByIndex( startIndex uint64, - numView uint64, + depRange uint64, ) ([]DepositT, error) { kv.mu.RLock() defer kv.mu.RUnlock() - deposits := []DepositT{} - for i := startIndex; i < startIndex+numView; i++ { + var ( + deposits = []DepositT{} + endIdx = startIndex + depRange + ) + + kv.logger.Info( + "GetDepositsByIndex request", + "start", startIndex, + "end", endIdx, + ) + for i := startIndex; i < endIdx; i++ { deposit, err := kv.store.Get(context.TODO(), i) - if errors.Is(err, sdkcollections.ErrNotFound) { + switch { + case err == nil: + deposits = append(deposits, deposit) + case errors.Is(err, sdkcollections.ErrNotFound): + kv.logger.Info( + "GetDepositsByIndex response", + "start", startIndex, + "end", i, + ) return deposits, nil - } - if err != nil { + default: + kv.logger.Error( + "GetDepositsByIndex response", + "start", startIndex, + "end", i, + "error", err, + ) return deposits, err } - deposits = append(deposits, deposit) } - return deposits, nil -} -// EnqueueDeposit pushes the deposit to the queue. -func (kv *KVStore[DepositT]) EnqueueDeposit(deposit DepositT) error { - kv.mu.Lock() - defer kv.mu.Unlock() - return kv.setDeposit(deposit) + kv.logger.Info( + "GetDepositsByIndex response", + "start", startIndex, + "end", endIdx, + ) + return deposits, nil } // EnqueueDeposits pushes multiple deposits to the queue. func (kv *KVStore[DepositT]) EnqueueDeposits(deposits []DepositT) error { kv.mu.Lock() defer kv.mu.Unlock() - for _, deposit := range deposits { - if err := kv.setDeposit(deposit); err != nil { + kv.logger.Info( + "EnqueueDeposits request", + "to enqueue", len(deposits), + ) + for i, deposit := range deposits { + idx := deposit.GetIndex().Unwrap() + kv.logger.Debug( + "EnqueueDeposit response", + "index", idx, + ) + if err := kv.store.Set( + context.TODO(), + idx, + deposit, + ); err != nil { + kv.logger.Error( + "EnqueueDeposit response", + "enqueued", i, + "err", err, + ) return err } } - return nil -} -// setDeposit sets the deposit in the store. -func (kv *KVStore[DepositT]) setDeposit(deposit DepositT) error { - return kv.store.Set(context.TODO(), deposit.GetIndex().Unwrap(), deposit) + kv.logger.Info( + "EnqueueDeposit response", + "enqueued", len(deposits), + ) + return nil } // Prune removes the [start, end) deposits from the store. func (kv *KVStore[DepositT]) Prune(start, end uint64) error { + kv.logger.Info( + "Prune request", + "start", start, + "end", end, + ) if start > end { return fmt.Errorf( "DepositKVStore Prune start: %d, end: %d: %w", @@ -119,8 +170,20 @@ func (kv *KVStore[DepositT]) Prune(start, end uint64) error { for i := range end { // This only errors if the key passed in cannot be encoded. if err := kv.store.Remove(ctx, start+i); err != nil { + kv.logger.Error( + "Prune response", + "start", start, + "end", i, + "err", err, + ) return err } } + + kv.logger.Info( + "Prune response", + "start", start, + "end", end, + ) return nil } From b45654b2edbe1f7e66421ebe16dbba7f6cdcdae6 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 16:31:09 +0100 Subject: [PATCH 31/52] added checks on deposit fetcher --- mod/execution/pkg/deposit/sync.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mod/execution/pkg/deposit/sync.go b/mod/execution/pkg/deposit/sync.go index cedc59636..11397f851 100644 --- a/mod/execution/pkg/deposit/sync.go +++ b/mod/execution/pkg/deposit/sync.go @@ -37,6 +37,15 @@ func (s *Service[ BeaconBlockT, _, _, _, _, ]) depositFetcher(ctx context.Context, event async.Event[BeaconBlockT]) { blockNum := event.Data().GetBody().GetExecutionPayload().GetNumber() + if blockNum < s.eth1FollowDistance { + s.logger.Info( + "depositFetcher, nothing to fetch", + "block num", blockNum, + "eth1FollowDistance", s.eth1FollowDistance, + ) + return + } + s.fetchAndStoreDeposits(ctx, blockNum-s.eth1FollowDistance) } From 463489b65b1b7e51fb2c129572f1c9baa0972e50 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 18:41:02 +0100 Subject: [PATCH 32/52] reset Eth1DepositIndex --- mod/beacon/validator/block_builder.go | 2 +- .../pkg/core/state_processor.go | 4 ---- .../pkg/core/state_processor_genesis.go | 18 ++++++++++----- .../pkg/core/state_processor_staking.go | 21 ++---------------- .../pkg/core/state_processor_staking_test.go | 22 +++++++++---------- mod/state-transition/pkg/core/types.go | 2 ++ 6 files changed, 28 insertions(+), 41 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index adf6a01f8..00912cc9b 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -295,7 +295,7 @@ func (s *Service[ // Dequeue deposits from the state. deposits, err := s.sb.DepositStore().GetDepositsByIndex( - depositIndex, + depositIndex+1, // pick expected next deposit index s.chainSpec.MaxDepositsPerBlock(), ) if err != nil { diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 8723186fe..9632378d6 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -94,10 +94,6 @@ type StateProcessor[ ] // ds allows checking payload deposits against the deposit contract ds DepositStore[DepositT] - - // 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 7633ddfa5..0525f8d1d 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -42,11 +42,6 @@ func (sp *StateProcessor[ executionPayloadHeader ExecutionPayloadHeaderT, genesisVersion common.Version, ) (transition.ValidatorUpdates, error) { - sp.processingGenesis = true - defer func() { - sp.processingGenesis = false - }() - var ( blkHeader BeaconBlockHeaderT blkBody BeaconBlockBodyT @@ -102,7 +97,18 @@ func (sp *StateProcessor[ } for _, deposit := range deposits { - if err := sp.processDeposit(st, deposit); err != nil { + prevDepositIndex, err := st.GetEth1DepositIndex() + if err != nil { + // currently this only happen on the first genesis deposit + if deposit.GetIndex() != 0 { + return nil, ErrDepositMismatch + } + } else { + if deposit.GetIndex() != math.U64(prevDepositIndex+1) { + return nil, ErrDepositMismatch + } + } + if err = sp.processDeposit(st, deposit); err != nil { return nil, err } } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index f3b47530e..0a0e3d324 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -47,7 +47,7 @@ func (sp *StateProcessor[ } stateDeposits, err := sp.ds.GetDepositsByIndex( - depositIndex+1, + depositIndex+1, // pick expected next deposit index sp.cs.MaxDepositsPerBlock(), ) if err != nil { @@ -107,24 +107,7 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - 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: - // 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 outside of processing genesis: %w", - err, - ) - } - - if err := st.SetEth1DepositIndex(nextDepositIndex); err != nil { + if err := st.SetEth1DepositIndex(dep.GetIndex().Unwrap()); err != nil { return err } diff --git a/mod/state-transition/pkg/core/state_processor_staking_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go index dc1dd8830..59a506739 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -114,13 +114,11 @@ func TestTransitionUpdateValidators(t *testing.T) { SkipValidateResult: true, ProposerAddress: dummyProposerAddr, } - blkDeposits = []*types.Deposit{ - { - Pubkey: genDeposits[0].Pubkey, - Credentials: emptyCredentials, - Amount: minBalance, // avoid breaching maxBalance - Index: uint64(len(genDeposits)), - }, + blkDeposit = &types.Deposit{ + Pubkey: genDeposits[0].Pubkey, + Credentials: emptyCredentials, + Amount: minBalance, // avoid breaching maxBalance + Index: uint64(len(genDeposits)), } ) @@ -136,12 +134,14 @@ func TestTransitionUpdateValidators(t *testing.T) { BaseFeePerGas: math.NewU256(0), }, Eth1Data: &types.Eth1Data{}, - Deposits: blkDeposits, + Deposits: []*types.Deposit{blkDeposit}, }, ) // make sure included deposit is already available in deposit store - require.NoError(t, depositStore.EnqueueDeposits(blkDeposits)) + require.NoError(t, depositStore.EnqueueDeposits( + []*types.Deposit{blkDeposit}), + ) // run the test vals, err := sp.Transition(ctx, beaconState, blk) @@ -151,7 +151,7 @@ func TestTransitionUpdateValidators(t *testing.T) { require.Zero(t, vals) // just update, no new validators // check validator is duly updated - expectedValBalance := genDeposits[0].Amount + blkDeposits[0].Amount + expectedValBalance := genDeposits[0].Amount + blkDeposit.Amount idx, err := beaconState.ValidatorIndexByPubkey(genDeposits[0].Pubkey) require.NoError(t, err) require.Equal(t, math.U64(genDeposits[0].Index), idx) @@ -166,7 +166,7 @@ func TestTransitionUpdateValidators(t *testing.T) { require.NoError(t, err) require.Equal(t, expectedValBalance, valBal) - // check that validator index is duly set (1-indexed here, to be fixed) + // check that validator index is duly set latestValIdx, err := beaconState.GetEth1DepositIndex() require.NoError(t, err) require.Equal(t, uint64(len(genDeposits)), latestValIdx) diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 42cf46e12..b01bf38d8 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -141,6 +141,8 @@ type Deposit[ GetPubkey() crypto.BLSPubkey // GetWithdrawalCredentials returns the withdrawal credentials. GetWithdrawalCredentials() WithdrawlCredentialsT + // GetIndex returns deposit index + GetIndex() math.U64 // VerifySignature verifies the deposit and creates a validator. VerifySignature( forkData ForkDataT, From 333764d3c80c7ac58b0bab8873cefdc1b01fd99c Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 20 Nov 2024 19:31:16 +0100 Subject: [PATCH 33/52] Boonet: fixed Bera token produced at Genesis (#2161) --- .mockery.yaml | 1 + .../mocks/blobs_bundle.mock.go | 2 +- .../mocks/built_execution_payload_env.mock.go | 2 +- .../mocks/payload_attributer.mock.go | 2 +- .../backend/mocks/availability_store.mock.go | 2 +- .../backend/mocks/beacon_block_header.mock.go | 2 +- .../backend/mocks/beacon_state.mock.go | 2 +- .../backend/mocks/block_store.mock.go | 2 +- .../backend/mocks/deposit_store.mock.go | 2 +- mod/node-api/backend/mocks/node.mock.go | 2 +- .../backend/mocks/state_processor.mock.go | 2 +- .../backend/mocks/storage_backend.mock.go | 2 +- mod/node-api/backend/mocks/validator.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal.mock.go | 2 +- .../mocks/withdrawal_credentials.mock.go | 2 +- mod/node-core/pkg/components/dispatcher.go | 4 ++- .../pkg/services/registry/mocks/basic.mock.go | 2 +- .../registry/mocks/dispatcher.mock.go | 2 +- .../registry/mocks/registry_option.mock.go | 2 +- .../pkg/crypto/mocks/bls_signer.mock.go | 2 +- .../pkg/core/mocks/execution_engine.mock.go | 2 +- .../pkg/core/state/statedb.go | 27 ++++++++++++++++++- .../pkg/core/state_processor.go | 2 +- .../pkg/core/state_processor_staking.go | 23 ++++++++++++++-- mod/storage/pkg/interfaces/mocks/db.mock.go | 2 +- .../pkg/pruner/mocks/beacon_block.mock.go | 2 +- .../pkg/pruner/mocks/block_event.mock.go | 2 +- mod/storage/pkg/pruner/mocks/prunable.mock.go | 2 +- mod/storage/pkg/pruner/mocks/pruner.mock.go | 2 +- 29 files changed, 76 insertions(+), 29 deletions(-) diff --git a/.mockery.yaml b/.mockery.yaml index e4efc43af..f8fbd7d8d 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -27,6 +27,7 @@ dir: "{{.InterfaceDir}}/mocks" mockname: "{{.InterfaceNameCamel}}" filename: "{{.InterfaceNameSnake}}.mock.go" outpkg: "mocks" +resolve-type-alias: False # see https://vektra.github.io/mockery/latest/deprecations/#resolve-type-alias packages: github.com/berachain/beacon-kit/mod/execution/pkg/client/ethclient: config: 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 67afc56b7..a9755a8c7 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks 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 df3a20089..2eb2e63c6 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go index 0edbc8091..ce712b7f2 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 20eb2e5b6..26ab51f6c 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks 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 eb238bac1..db5cfc419 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 6d9fb92e2..ef3004fd8 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index df70ab86b..c5bc5b846 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/deposit_store.mock.go b/mod/node-api/backend/mocks/deposit_store.mock.go index 32e838105..a226184c7 100644 --- a/mod/node-api/backend/mocks/deposit_store.mock.go +++ b/mod/node-api/backend/mocks/deposit_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/node.mock.go b/mod/node-api/backend/mocks/node.mock.go index b80643442..45a53055b 100644 --- a/mod/node-api/backend/mocks/node.mock.go +++ b/mod/node-api/backend/mocks/node.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index ac2b23b03..031400960 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/storage_backend.mock.go b/mod/node-api/backend/mocks/storage_backend.mock.go index dd28160b4..2992bb6e9 100644 --- a/mod/node-api/backend/mocks/storage_backend.mock.go +++ b/mod/node-api/backend/mocks/storage_backend.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 3f904a98e..997eae07a 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index 654d5f85e..d0ef6cff9 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go index 5189b3b6b..6abab4521 100644 --- a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go +++ b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/components/dispatcher.go b/mod/node-core/pkg/components/dispatcher.go index 028bbe2e3..5ba612bca 100644 --- a/mod/node-core/pkg/components/dispatcher.go +++ b/mod/node-core/pkg/components/dispatcher.go @@ -57,7 +57,9 @@ func ProvideDispatcher[ dp.WithEvent[async.Event[ConsensusSidecars]](async.SidecarsReceived), dp.WithEvent[async.Event[BeaconBlockT]](async.BeaconBlockVerified), dp.WithEvent[async.Event[BlobSidecarsT]](async.SidecarsVerified), - dp.WithEvent[async.Event[ConsensusBlockT]](async.FinalBeaconBlockReceived), + dp.WithEvent[async.Event[ConsensusBlockT]]( + async.FinalBeaconBlockReceived, + ), dp.WithEvent[async.Event[BlobSidecarsT]](async.FinalSidecarsReceived), dp.WithEvent[ValidatorUpdateEvent]( async.FinalValidatorUpdatesProcessed, diff --git a/mod/node-core/pkg/services/registry/mocks/basic.mock.go b/mod/node-core/pkg/services/registry/mocks/basic.mock.go index 5636cc249..c72558a57 100644 --- a/mod/node-core/pkg/services/registry/mocks/basic.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/basic.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go index 8c02d2646..13003c311 100644 --- a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go index cf55bbcda..d0239c9f3 100644 --- a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index 4abffe896..fad1b0884 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go index c0ddbae4a..8bf5537e0 100644 --- a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 830ad7e31..14eefc011 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -27,6 +27,19 @@ import ( "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) +const ( + // EVMMintingSlot is the slot at which we force a single withdrawal to + // mint EVMMintingAmount EVM tokens to EVMMintingAddress. No other + // withdrawals are inserted at this slot. + EVMMintingSlot uint64 = 69420 + + // EVMMintingAddress is the address at which we mint EVM tokens to. + EVMMintingAddress = "0x8a73D1380345942F1cb32541F1b19C40D8e6C94B" + + // EVMMintingAmount is the amount of EVM tokens to mint. + EVMMintingAmount uint64 = 530000000000000000 +) + // StateDB is the underlying struct behind the BeaconState interface. // //nolint:revive // todo fix somehow @@ -187,7 +200,7 @@ func (s *StateDB[ // ExpectedWithdrawals as defined in the Ethereum 2.0 Specification: // https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#new-get_expected_withdrawals // -//nolint:lll +//nolint:lll,funlen func (s *StateDB[ _, _, _, _, _, _, ValidatorT, _, WithdrawalT, _, ]) ExpectedWithdrawals() ([]WithdrawalT, error) { @@ -203,6 +216,18 @@ func (s *StateDB[ return nil, err } + // Slot used to mint EVM tokens. + if slot.Unwrap() == EVMMintingSlot { + var withdrawal WithdrawalT + withdrawals = append(withdrawals, withdrawal.New( + 0, // NOT USED + 0, // NOT USED + common.NewExecutionAddressFromHex(EVMMintingAddress), + math.Gwei(EVMMintingAmount), + )) + return withdrawals, nil + } + epoch := math.Epoch(slot.Unwrap() / s.cs.SlotsPerEpoch()) withdrawalIndex, err := s.GetNextWithdrawalIndex() diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 4a4a05050..7602b961b 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -301,7 +301,7 @@ func (sp *StateProcessor[ return err } - if err := sp.processWithdrawals(st, blk.GetBody()); err != nil { + if err := sp.processWithdrawals(st, blk); err != nil { return err } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index c161d3286..91ffe721d 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -29,6 +29,7 @@ import ( "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/version" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/davecgh/go-spew/spew" ) @@ -227,11 +228,13 @@ func (sp *StateProcessor[ // //nolint:lll func (sp *StateProcessor[ - _, BeaconBlockBodyT, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, + BeaconBlockT, _, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, ]) processWithdrawals( st BeaconStateT, - body BeaconBlockBodyT, + blk BeaconBlockT, ) error { + body := blk.GetBody() + // Dequeue and verify the logs. var ( nextValidatorIndex math.ValidatorIndex @@ -255,6 +258,22 @@ func (sp *StateProcessor[ ) } + // Slot used to mint EVM tokens. + slot := blk.GetSlot() + if slot.Unwrap() == state.EVMMintingSlot { + // Sanity check. + wd := expectedWithdrawals[0] + if !wd.Equals(payloadWithdrawals[0]) { + return fmt.Errorf( + "minting withdrawal does not match expected %s, got %s", + spew.Sdump(wd), spew.Sdump(payloadWithdrawals[0]), + ) + } + + // No processing needed. + return nil + } + // Compare and process each withdrawal. for i, wd := range expectedWithdrawals { // Ensure the withdrawals match the local state. diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index f9cdef39a..956c2182d 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go index ba68c5bf2..3f6fa20bc 100644 --- a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go +++ b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/block_event.mock.go b/mod/storage/pkg/pruner/mocks/block_event.mock.go index 5d2d1891c..0297db3ce 100644 --- a/mod/storage/pkg/pruner/mocks/block_event.mock.go +++ b/mod/storage/pkg/pruner/mocks/block_event.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/prunable.mock.go b/mod/storage/pkg/pruner/mocks/prunable.mock.go index 0b84e1e0b..894d56ac3 100644 --- a/mod/storage/pkg/pruner/mocks/prunable.mock.go +++ b/mod/storage/pkg/pruner/mocks/prunable.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/pruner.mock.go b/mod/storage/pkg/pruner/mocks/pruner.mock.go index 77e354f31..6d5b0672c 100644 --- a/mod/storage/pkg/pruner/mocks/pruner.mock.go +++ b/mod/storage/pkg/pruner/mocks/pruner.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.48.0. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks From 19c311ad0918a30a939b7e8a1092ca6f7eae576f Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 21:17:03 +0100 Subject: [PATCH 34/52] some more log fixes --- mod/state-transition/pkg/core/state_processor_staking.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 0a0e3d324..3df90c7e4 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -45,22 +45,23 @@ func (sp *StateProcessor[ if err != nil { return err } + expectedStartIdx := depositIndex + 1 stateDeposits, err := sp.ds.GetDepositsByIndex( - depositIndex+1, // pick expected next deposit index + expectedStartIdx, sp.cs.MaxDepositsPerBlock(), ) if err != nil { return err } - deposits := blk.GetBody().GetDeposits() sp.logger.Info( "processOperations", - "Expected deposit index from payload", depositIndex, - "deposits withdrawals length", len(deposits), + "Expected deposit start index", expectedStartIdx, + "Expected deposits length", len(stateDeposits), ) + deposits := blk.GetBody().GetDeposits() if len(stateDeposits) != len(deposits) { return fmt.Errorf("%w, state: %d, payload: %d", ErrDepositsLengthMismatch, From 4480026e4bd3f5eaa954c45fb2fc107a77d088ae Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 24 Nov 2024 22:02:22 +0100 Subject: [PATCH 35/52] comment nit --- mod/state-transition/pkg/core/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index bda1ff077..1709ecc8e 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -38,8 +38,8 @@ var ( // listed in block is different from deposits from store. ErrDepositsLengthMismatch = errors.New("deposits lengths mismatched") - // ErrDepositsLengthMismatch is returned when a specific deposit - // listed in block is different from the corrispondent one from store. + // ErrDepositMismatch is returned when a specific deposit listed in + // block is different from the corrispondent one from store. ErrDepositMismatch = errors.New("deposit mismatched") // ErrParentRootMismatch is returned when the parent root in an execution From 4512758088af654590ebf596aab623065c65ddf6 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 25 Nov 2024 00:53:08 +0100 Subject: [PATCH 36/52] tmp: debugging --- testing/e2e/config/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index 0a41752ef..54e7ca4f2 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -182,17 +182,17 @@ func defaultValidators() NodeSet { Nodes: []Node{ { ElType: "nethermind", - Replicas: 1, + Replicas: 0, // nethermind cannot keep up with deposits checks KZGImpl: "crate-crypto/go-kzg-4844", }, { ElType: "geth", - Replicas: 2, //nolint:mnd // bet. + Replicas: 2, //nolint:mnd // we want two replicas here KZGImpl: "crate-crypto/go-kzg-4844", }, { ElType: "reth", - Replicas: 1, + Replicas: 2, //nolint:mnd // we want two replicas here KZGImpl: "crate-crypto/go-kzg-4844", }, { From 11c268839774c0b2cc14d3d48c6bec73c37ea59e Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 25 Nov 2024 14:00:10 +0100 Subject: [PATCH 37/52] nit --- testing/e2e/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index 54e7ca4f2..5e450ec77 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -181,7 +181,9 @@ func defaultValidators() NodeSet { Type: "validator", Nodes: []Node{ { - ElType: "nethermind", + ElType: "nethermind", + // TODO: restore once we solve + // https://github.com/berachain/beacon-kit/issues/2177 Replicas: 0, // nethermind cannot keep up with deposits checks KZGImpl: "crate-crypto/go-kzg-4844", }, From 80bb6566e4c8a4150f11b7c4e507847fb05b9536 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 26 Nov 2024 22:14:22 +0100 Subject: [PATCH 38/52] special cased Bartio for backward compatibility --- mod/state-transition/pkg/core/state_processor_genesis.go | 9 +++++++++ mod/state-transition/pkg/core/state_processor_staking.go | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 0525f8d1d..a3ad6a616 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -97,6 +97,15 @@ func (sp *StateProcessor[ } for _, deposit := range deposits { + // Bartio does not properly validate deposits index + // Special casing checks for backward compatibility + if sp.cs.DepositEth1ChainID() == spec.BartioChainID { + if err := sp.processDeposit(st, deposit); err != nil { + return nil, err + } + continue + } + prevDepositIndex, err := st.GetEth1DepositIndex() if err != nil { // currently this only happen on the first genesis deposit diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index c92ef5b58..217ac9cd5 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -41,6 +41,14 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { + deposits := blk.GetBody().GetDeposits() + + // Bartio does not properly validate deposits index + // Special casing checks for backward compatibility + if sp.cs.DepositEth1ChainID() == spec.BartioChainID { + return sp.processDeposits(st, deposits) + } + // Verify that outstanding deposits matches those listed by contract depositIndex, err := st.GetEth1DepositIndex() if err != nil { @@ -62,7 +70,6 @@ func (sp *StateProcessor[ "Expected deposits length", len(stateDeposits), ) - deposits := blk.GetBody().GetDeposits() if len(stateDeposits) != len(deposits) { return fmt.Errorf("%w, state: %d, payload: %d", ErrDepositsLengthMismatch, From 628dbbaf17f0bf59f6a06e083e20d0ff141f461a Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 26 Nov 2024 23:10:38 +0100 Subject: [PATCH 39/52] made bug fix backward compatible --- mod/config/pkg/spec/special_cases.go | 8 + .../pkg/core/deposits_validation.go | 137 ++++++++++++++++++ .../pkg/core/state/statedb.go | 2 +- .../pkg/core/state_processor.go | 18 +++ .../pkg/core/state_processor_genesis.go | 23 +-- .../pkg/core/state_processor_staking.go | 58 +------- 6 files changed, 168 insertions(+), 78 deletions(-) create mode 100644 mod/state-transition/pkg/core/deposits_validation.go diff --git a/mod/config/pkg/spec/special_cases.go b/mod/config/pkg/spec/special_cases.go index 5407715bc..22597da44 100644 --- a/mod/config/pkg/spec/special_cases.go +++ b/mod/config/pkg/spec/special_cases.go @@ -20,6 +20,8 @@ package spec +import "math" + // Special cased Bartio for some ad-hoc handling due to the way // some bugs were handled on Bartio. To be removed. const ( @@ -28,3 +30,9 @@ const ( //nolint:lll // temporary. BArtioValRoot = "0x9147586693b6e8faa837715c0f3071c2000045b54233901c2e7871b15872bc43" ) + +const ( + BoonetFork1Height uint64 = 69420 + + BoonetFork2Height uint64 = math.MaxUint64 +) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go new file mode 100644 index 000000000..ca4d63184 --- /dev/null +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -0,0 +1,137 @@ +// 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 + +import ( + "fmt" + + "github.com/berachain/beacon-kit/mod/config/pkg/spec" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" +) + +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, DepositT, + _, _, _, _, _, _, _, _, _, _, _, +]) validateGenesisDeposit( + st BeaconStateT, + deposit DepositT, +) error { + switch { + case sp.cs.DepositEth1ChainID() == spec.BartioChainID: + // Bartio does not properly validate deposits index + // Special casing checks for backward compatibility + return nil + + case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID: + // Boonet inherited the bug from Bartio and it may have added some + // validators before we activate the fork. So we skip validation + // before fork activation + return nil + + default: + // verify that deposits index are ordered and contiguous + prevDepositIndex, err := st.GetEth1DepositIndex() + if err != nil { + // currently this only happen on the first genesis deposit + if deposit.GetIndex() != 0 { + return ErrDepositMismatch + } + } else { + if deposit.GetIndex() != math.U64(prevDepositIndex+1) { + return ErrDepositMismatch + } + } + return nil + } +} + +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, DepositT, + _, _, _, _, _, _, _, _, _, _, _, +]) validateNonGenesisDeposits( + st BeaconStateT, + deposits []DepositT, +) error { + slot, err := st.GetSlot() + if err != nil { + return fmt.Errorf( + "failed loading slot while processing deposits: %w", + err, + ) + } + switch { + case sp.cs.DepositEth1ChainID() == spec.BartioChainID: + // Bartio does not properly validate deposits index + // Special casing checks for backward compatibility + return nil + + case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID && + slot < math.U64(spec.BoonetFork2Height): + // Boonet inherited the bug from Bartio and it may have added some + // validators before we activate the fork. So we skip validation + // before fork activation + return nil + + default: + // Verify that outstanding deposits matches those listed by contract + var depositIndex uint64 + depositIndex, err = st.GetEth1DepositIndex() + if err != nil { + return err + } + expectedStartIdx := depositIndex + 1 + + var stateDeposits []DepositT + stateDeposits, err = sp.ds.GetDepositsByIndex( + expectedStartIdx, + sp.cs.MaxDepositsPerBlock(), + ) + if err != nil { + return err + } + + sp.logger.Info( + "processOperations", + "Expected deposit start index", expectedStartIdx, + "Expected deposits length", len(stateDeposits), + ) + + if len(stateDeposits) != len(deposits) { + return fmt.Errorf("%w, state: %d, payload: %d", + ErrDepositsLengthMismatch, + len(stateDeposits), + len(deposits), + ) + } + + for i, sd := range stateDeposits { + if !sd.Equals(deposits[i]) { + sp.logger.Error( + ErrDepositMismatch.Error(), + "state deposit", sd, + "payload deposit", deposits[i], + ) + return ErrDepositMismatch + } + } + return nil + } +} diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 14eefc011..bac38eea9 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -31,7 +31,7 @@ const ( // EVMMintingSlot is the slot at which we force a single withdrawal to // mint EVMMintingAmount EVM tokens to EVMMintingAddress. No other // withdrawals are inserted at this slot. - EVMMintingSlot uint64 = 69420 + EVMMintingSlot = spec.BoonetFork1Height // EVMMintingAddress is the address at which we mint EVM tokens to. EVMMintingAddress = "0x8a73D1380345942F1cb32541F1b19C40D8e6C94B" diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 9d1606b6a..c91341bfa 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -22,7 +22,9 @@ package core import ( "bytes" + "fmt" + "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/log" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" @@ -219,6 +221,22 @@ func (sp *StateProcessor[ return nil, err } + // Handle special cases + if slot == math.U64(spec.BoonetFork2Height) { + var idx uint64 + idx, err = st.GetEth1DepositIndex() + if err != nil { + return nil, fmt.Errorf( + "failed retrieving deposit index at slot %d: %w", + slot, err, + ) + } + fixedDepositIdx := idx - 1 + if err = st.SetEth1DepositIndex(fixedDepositIdx); err != nil { + return nil, err + } + } + // Process the Epoch Boundary. boundary := (stateSlot.Unwrap()+1)%sp.cs.SlotsPerEpoch() == 0 if boundary { diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index a3ad6a616..efc808513 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -97,27 +97,10 @@ func (sp *StateProcessor[ } for _, deposit := range deposits { - // Bartio does not properly validate deposits index - // Special casing checks for backward compatibility - if sp.cs.DepositEth1ChainID() == spec.BartioChainID { - if err := sp.processDeposit(st, deposit); err != nil { - return nil, err - } - continue - } - - prevDepositIndex, err := st.GetEth1DepositIndex() - if err != nil { - // currently this only happen on the first genesis deposit - if deposit.GetIndex() != 0 { - return nil, ErrDepositMismatch - } - } else { - if deposit.GetIndex() != math.U64(prevDepositIndex+1) { - return nil, ErrDepositMismatch - } + if err := sp.validateGenesisDeposit(st, deposit); err != nil { + return nil, err } - if err = sp.processDeposit(st, deposit); err != nil { + if err := sp.processDeposit(st, deposit); err != nil { return nil, err } } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 217ac9cd5..19eee2dc8 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -42,65 +42,9 @@ func (sp *StateProcessor[ blk BeaconBlockT, ) error { deposits := blk.GetBody().GetDeposits() - - // Bartio does not properly validate deposits index - // Special casing checks for backward compatibility - if sp.cs.DepositEth1ChainID() == spec.BartioChainID { - return sp.processDeposits(st, deposits) - } - - // Verify that outstanding deposits matches those listed by contract - depositIndex, err := st.GetEth1DepositIndex() - if err != nil { - return err - } - expectedStartIdx := depositIndex + 1 - - stateDeposits, err := sp.ds.GetDepositsByIndex( - expectedStartIdx, - sp.cs.MaxDepositsPerBlock(), - ) - if err != nil { + if err := sp.validateNonGenesisDeposits(st, deposits); err != nil { return err } - - sp.logger.Info( - "processOperations", - "Expected deposit start index", expectedStartIdx, - "Expected deposits length", len(stateDeposits), - ) - - if len(stateDeposits) != len(deposits) { - return fmt.Errorf("%w, state: %d, payload: %d", - ErrDepositsLengthMismatch, - len(stateDeposits), - len(deposits), - ) - } - - for i, sd := range stateDeposits { - if !sd.Equals(deposits[i]) { - sp.logger.Error( - ErrDepositMismatch.Error(), - "state deposit", sd, - "payload deposit", deposits[i], - ) - return ErrDepositMismatch - } - } - - return sp.processDeposits(st, deposits) -} - -// processDeposits processes the deposits and ensures they match the -// local state. -func (sp *StateProcessor[ - _, _, _, BeaconStateT, _, DepositT, _, _, _, _, _, _, _, _, _, _, _, -]) processDeposits( - st BeaconStateT, - deposits []DepositT, -) error { - // Ensure the deposits match the local state. for _, dep := range deposits { if err := sp.processDeposit(st, dep); err != nil { return err From 386087dc2839245b7bfcd2115188a1d4dc313e26 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 26 Nov 2024 23:38:16 +0100 Subject: [PATCH 40/52] nits + properly guarding fix --- mod/state-transition/pkg/core/deposits_validation.go | 8 ++++---- mod/state-transition/pkg/core/state_processor.go | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index ca4d63184..048e809a4 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -37,7 +37,7 @@ func (sp *StateProcessor[ switch { case sp.cs.DepositEth1ChainID() == spec.BartioChainID: // Bartio does not properly validate deposits index - // Special casing checks for backward compatibility + // We skip checksfor backward compatibility return nil case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID: @@ -50,7 +50,7 @@ func (sp *StateProcessor[ // verify that deposits index are ordered and contiguous prevDepositIndex, err := st.GetEth1DepositIndex() if err != nil { - // currently this only happen on the first genesis deposit + // currently this only happens on the first genesis deposit if deposit.GetIndex() != 0 { return ErrDepositMismatch } @@ -80,7 +80,7 @@ func (sp *StateProcessor[ switch { case sp.cs.DepositEth1ChainID() == spec.BartioChainID: // Bartio does not properly validate deposits index - // Special casing checks for backward compatibility + // We skip checksfor backward compatibility return nil case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID && @@ -91,7 +91,7 @@ func (sp *StateProcessor[ return nil default: - // Verify that outstanding deposits matches those listed by contract + // Verify that outstanding deposits match those listed by contract var depositIndex uint64 depositIndex, err = st.GetEth1DepositIndex() if err != nil { diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index c91341bfa..e82697f42 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -222,7 +222,8 @@ func (sp *StateProcessor[ } // Handle special cases - if slot == math.U64(spec.BoonetFork2Height) { + if sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID && + slot == math.U64(spec.BoonetFork2Height) { var idx uint64 idx, err = st.GetEth1DepositIndex() if err != nil { From c087141cbd1352c919c0bd354c14f56b6586d856 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 00:18:03 +0100 Subject: [PATCH 41/52] minor hardening of genesis deposits validation --- .../pkg/core/deposits_validation.go | 25 +++++++++++-------- .../pkg/core/state_processor_genesis.go | 6 ++--- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index 048e809a4..6487c6c86 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -30,9 +30,9 @@ import ( func (sp *StateProcessor[ _, _, _, BeaconStateT, _, DepositT, _, _, _, _, _, _, _, _, _, _, _, -]) validateGenesisDeposit( +]) validateGenesisDeposits( st BeaconStateT, - deposit DepositT, + deposits []DepositT, ) error { switch { case sp.cs.DepositEth1ChainID() == spec.BartioChainID: @@ -47,15 +47,18 @@ func (sp *StateProcessor[ return nil default: - // verify that deposits index are ordered and contiguous - prevDepositIndex, err := st.GetEth1DepositIndex() - if err != nil { - // currently this only happens on the first genesis deposit - if deposit.GetIndex() != 0 { - return ErrDepositMismatch - } - } else { - if deposit.GetIndex() != math.U64(prevDepositIndex+1) { + if _, err := st.GetEth1DepositIndex(); err == nil { + // there should not be Eth1DepositIndex stored before + // genesis first deposit + return ErrDepositMismatch + } + if len(deposits) == 0 { + // there should be at least a validator in genesis + return ErrDepositsLengthMismatch + } + for i, deposit := range deposits { + // deposits indexes should be contiguous + if deposit.GetIndex() != math.U64(i) { return ErrDepositMismatch } } diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index efc808513..082b94df2 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -96,10 +96,10 @@ func (sp *StateProcessor[ } } + if err := sp.validateGenesisDeposits(st, deposits); err != nil { + return nil, err + } for _, deposit := range deposits { - if err := sp.validateGenesisDeposit(st, deposit); err != nil { - return nil, err - } if err := sp.processDeposit(st, deposit); err != nil { return nil, err } From 2ad5fc1136d8654217d32f3be8c3000b42c25201 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 00:40:20 +0100 Subject: [PATCH 42/52] Update mod/state-transition/pkg/core/deposits_validation.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Cal Bera --- mod/state-transition/pkg/core/deposits_validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index 6487c6c86..f638fa252 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -37,7 +37,7 @@ func (sp *StateProcessor[ switch { case sp.cs.DepositEth1ChainID() == spec.BartioChainID: // Bartio does not properly validate deposits index - // We skip checksfor backward compatibility + // We skip checks for backward compatibility return nil case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID: From 7a2813b8faee3aa810dfc3c689ac59358c746695 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 00:41:12 +0100 Subject: [PATCH 43/52] Update mod/state-transition/pkg/core/deposits_validation.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Cal Bera --- mod/state-transition/pkg/core/deposits_validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index f638fa252..79b264749 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -57,7 +57,7 @@ func (sp *StateProcessor[ return ErrDepositsLengthMismatch } for i, deposit := range deposits { - // deposits indexes should be contiguous + // deposit indices should be contiguous if deposit.GetIndex() != math.U64(i) { return ErrDepositMismatch } From 099c5ae45f2986c56bad705feff178d24f344675 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 00:42:32 +0100 Subject: [PATCH 44/52] Update mod/state-transition/pkg/core/deposits_validation.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Cal Bera --- mod/state-transition/pkg/core/deposits_validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index 79b264749..c9a37e1d8 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -83,7 +83,7 @@ func (sp *StateProcessor[ switch { case sp.cs.DepositEth1ChainID() == spec.BartioChainID: // Bartio does not properly validate deposits index - // We skip checksfor backward compatibility + // We skip checks for backward compatibility return nil case sp.cs.DepositEth1ChainID() == spec.BoonetEth1ChainID && From 94ff29d4410f3ac704a4347bc2f62a97b1068b9d Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 00:56:32 +0100 Subject: [PATCH 45/52] guarded block building --- mod/beacon/validator/block_builder.go | 9 +++++++-- mod/config/pkg/spec/special_cases.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 00912cc9b..95c70f977 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -26,6 +26,7 @@ import ( "time" payloadtime "github.com/berachain/beacon-kit/mod/beacon/payload-time" + "github.com/berachain/beacon-kit/mod/config/pkg/spec" 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" @@ -288,14 +289,18 @@ func (s *Service[ // Set the KZG commitments on the block body. body.SetBlobKzgCommitments(blobsBundle.GetCommitments()) + // Dequeue deposits from the state. depositIndex, err := st.GetEth1DepositIndex() if err != nil { return ErrNilDepositIndexStart } - // Dequeue deposits from the state. + if s.chainSpec.DepositEth1ChainID() == spec.BoonetEth1ChainID && + blk.GetSlot() > math.U64(spec.BoonetFork2Height) { + depositIndex++ + } deposits, err := s.sb.DepositStore().GetDepositsByIndex( - depositIndex+1, // pick expected next deposit index + depositIndex, s.chainSpec.MaxDepositsPerBlock(), ) if err != nil { diff --git a/mod/config/pkg/spec/special_cases.go b/mod/config/pkg/spec/special_cases.go index 22597da44..b21549f9c 100644 --- a/mod/config/pkg/spec/special_cases.go +++ b/mod/config/pkg/spec/special_cases.go @@ -31,7 +31,7 @@ const ( BArtioValRoot = "0x9147586693b6e8faa837715c0f3071c2000045b54233901c2e7871b15872bc43" ) -const ( +const ( // Planned hard-fork upgrades on boonet. BoonetFork1Height uint64 = 69420 BoonetFork2Height uint64 = math.MaxUint64 From a75a0c2232602b0410062a5b307fe21537b78839 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 02:34:56 +0100 Subject: [PATCH 46/52] deposits validation errors cleanup --- .../pkg/core/deposits_validation.go | 44 +++++++++++++------ mod/state-transition/pkg/core/errors.go | 4 ++ 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index c9a37e1d8..95e6e3728 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -24,6 +24,7 @@ import ( "fmt" "github.com/berachain/beacon-kit/mod/config/pkg/spec" + "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" ) @@ -50,16 +51,26 @@ func (sp *StateProcessor[ if _, err := st.GetEth1DepositIndex(); err == nil { // there should not be Eth1DepositIndex stored before // genesis first deposit - return ErrDepositMismatch + return errors.Wrap( + ErrDepositMismatch, + "Eth1DepositIndex should be unset at genesis", + ) } if len(deposits) == 0 { // there should be at least a validator in genesis - return ErrDepositsLengthMismatch + return errors.Wrap( + ErrDepositsLengthMismatch, + "at least one validator should be in genesis", + ) } for i, deposit := range deposits { // deposit indices should be contiguous if deposit.GetIndex() != math.U64(i) { - return ErrDepositMismatch + return errors.Wrapf( + ErrDepositIndexOutOfOrder, + "deposit index: %d, expected index: %d", + deposit.GetIndex().Unwrap(), i, + ) } } return nil @@ -76,8 +87,7 @@ func (sp *StateProcessor[ slot, err := st.GetSlot() if err != nil { return fmt.Errorf( - "failed loading slot while processing deposits: %w", - err, + "failed loading slot while processing deposits: %w", err, ) } switch { @@ -118,23 +128,31 @@ func (sp *StateProcessor[ ) if len(stateDeposits) != len(deposits) { - return fmt.Errorf("%w, state: %d, payload: %d", + return errors.Wrapf( ErrDepositsLengthMismatch, - len(stateDeposits), - len(deposits), + "state: %d, payload: %d", len(stateDeposits), len(deposits), ) } for i, sd := range stateDeposits { + // Deposit indices should be contiguous. + if sd.GetIndex().Unwrap() != expectedStartIdx+uint64(i) { + return errors.Wrapf( + ErrDepositIndexOutOfOrder, + "state deposit: %d, expected index: %d", + sd.GetIndex().Unwrap(), expectedStartIdx+uint64(i), + ) + } + if !sd.Equals(deposits[i]) { - sp.logger.Error( - ErrDepositMismatch.Error(), - "state deposit", sd, - "payload deposit", deposits[i], + return errors.Wrapf( + ErrDepositMismatch, + "state deposit: %d, payload deposit: %d", + sd, deposits[i], ) - return ErrDepositMismatch } } + return nil } } diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index 1709ecc8e..69015866b 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -42,6 +42,10 @@ var ( // block is different from the corrispondent one from store. ErrDepositMismatch = errors.New("deposit mismatched") + // ErrDepositIndexOutOfOrder is returned when deposits are not in + // contiguous order. + ErrDepositIndexOutOfOrder = errors.New("deposit index out of order") + // ErrParentRootMismatch is returned when the parent root in an execution // payload does not match the expected value. ErrParentRootMismatch = errors.New("parent root mismatch") From 9f470118d37f70488db2c98bc6b0f8d85a036ff7 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 02:36:27 +0100 Subject: [PATCH 47/52] nit renaming --- .../pkg/core/deposits_validation.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index 95e6e3728..a063e9634 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -68,7 +68,7 @@ func (sp *StateProcessor[ if deposit.GetIndex() != math.U64(i) { return errors.Wrapf( ErrDepositIndexOutOfOrder, - "deposit index: %d, expected index: %d", + "genesis deposit index: %d, expected index: %d", deposit.GetIndex().Unwrap(), i, ) } @@ -112,8 +112,8 @@ func (sp *StateProcessor[ } expectedStartIdx := depositIndex + 1 - var stateDeposits []DepositT - stateDeposits, err = sp.ds.GetDepositsByIndex( + var localDeposits []DepositT + localDeposits, err = sp.ds.GetDepositsByIndex( expectedStartIdx, sp.cs.MaxDepositsPerBlock(), ) @@ -124,22 +124,22 @@ func (sp *StateProcessor[ sp.logger.Info( "processOperations", "Expected deposit start index", expectedStartIdx, - "Expected deposits length", len(stateDeposits), + "Expected deposits length", len(localDeposits), ) - if len(stateDeposits) != len(deposits) { + if len(localDeposits) != len(deposits) { return errors.Wrapf( ErrDepositsLengthMismatch, - "state: %d, payload: %d", len(stateDeposits), len(deposits), + "local: %d, payload: %d", len(localDeposits), len(deposits), ) } - for i, sd := range stateDeposits { + for i, sd := range localDeposits { // Deposit indices should be contiguous. if sd.GetIndex().Unwrap() != expectedStartIdx+uint64(i) { return errors.Wrapf( ErrDepositIndexOutOfOrder, - "state deposit: %d, expected index: %d", + "local deposit index: %d, expected index: %d", sd.GetIndex().Unwrap(), expectedStartIdx+uint64(i), ) } @@ -147,7 +147,7 @@ func (sp *StateProcessor[ if !sd.Equals(deposits[i]) { return errors.Wrapf( ErrDepositMismatch, - "state deposit: %d, payload deposit: %d", + "local deposit: %d, payload deposit: %d", sd, deposits[i], ) } From 8cf215466c1354ac6a8d48f302afa5f1316b12b4 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Wed, 27 Nov 2024 02:42:09 +0100 Subject: [PATCH 48/52] gen --- .../pkg/engine-primitives/mocks/blobs_bundle.mock.go | 2 +- .../engine-primitives/mocks/built_execution_payload_env.mock.go | 2 +- .../pkg/engine-primitives/mocks/payload_attributer.mock.go | 2 +- mod/node-api/backend/mocks/availability_store.mock.go | 2 +- mod/node-api/backend/mocks/beacon_block_header.mock.go | 2 +- mod/node-api/backend/mocks/beacon_state.mock.go | 2 +- mod/node-api/backend/mocks/block_store.mock.go | 2 +- mod/node-api/backend/mocks/deposit_store.mock.go | 2 +- mod/node-api/backend/mocks/node.mock.go | 2 +- mod/node-api/backend/mocks/state_processor.mock.go | 2 +- mod/node-api/backend/mocks/storage_backend.mock.go | 2 +- mod/node-api/backend/mocks/validator.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal_credentials.mock.go | 2 +- mod/node-core/pkg/services/registry/mocks/basic.mock.go | 2 +- mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go | 2 +- .../pkg/services/registry/mocks/registry_option.mock.go | 2 +- mod/primitives/pkg/crypto/mocks/bls_signer.mock.go | 2 +- mod/state-transition/pkg/core/mocks/execution_engine.mock.go | 2 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 2 +- mod/storage/pkg/pruner/mocks/beacon_block.mock.go | 2 +- mod/storage/pkg/pruner/mocks/block_event.mock.go | 2 +- mod/storage/pkg/pruner/mocks/prunable.mock.go | 2 +- mod/storage/pkg/pruner/mocks/pruner.mock.go | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) 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 a9755a8c7..0f910642f 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks 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 2eb2e63c6..bb9afae80 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go index ce712b7f2..c6213b25c 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 26ab51f6c..d26b082de 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks 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 db5cfc419..40f47d1bb 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index ef3004fd8..37a4ab72f 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index c5bc5b846..0aec7824a 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/deposit_store.mock.go b/mod/node-api/backend/mocks/deposit_store.mock.go index a226184c7..42efd3429 100644 --- a/mod/node-api/backend/mocks/deposit_store.mock.go +++ b/mod/node-api/backend/mocks/deposit_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/node.mock.go b/mod/node-api/backend/mocks/node.mock.go index 45a53055b..7b6ea6df8 100644 --- a/mod/node-api/backend/mocks/node.mock.go +++ b/mod/node-api/backend/mocks/node.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index 031400960..90b28efe4 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/storage_backend.mock.go b/mod/node-api/backend/mocks/storage_backend.mock.go index 2992bb6e9..8ddbf4eba 100644 --- a/mod/node-api/backend/mocks/storage_backend.mock.go +++ b/mod/node-api/backend/mocks/storage_backend.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 997eae07a..867842ed7 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index d0ef6cff9..d9bd959e9 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go index 6abab4521..44769f067 100644 --- a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go +++ b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/basic.mock.go b/mod/node-core/pkg/services/registry/mocks/basic.mock.go index c72558a57..2b75bf30e 100644 --- a/mod/node-core/pkg/services/registry/mocks/basic.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/basic.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go index 13003c311..b8c291669 100644 --- a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go index d0239c9f3..f5bd036c8 100644 --- a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index fad1b0884..91a694259 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go index 8bf5537e0..6b65b7f9b 100644 --- a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index 956c2182d..809d49ef3 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go index 3f6fa20bc..8d1dd864d 100644 --- a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go +++ b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/block_event.mock.go b/mod/storage/pkg/pruner/mocks/block_event.mock.go index 0297db3ce..0ef5bbc15 100644 --- a/mod/storage/pkg/pruner/mocks/block_event.mock.go +++ b/mod/storage/pkg/pruner/mocks/block_event.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/prunable.mock.go b/mod/storage/pkg/pruner/mocks/prunable.mock.go index 894d56ac3..056c3d36e 100644 --- a/mod/storage/pkg/pruner/mocks/prunable.mock.go +++ b/mod/storage/pkg/pruner/mocks/prunable.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/pruner.mock.go b/mod/storage/pkg/pruner/mocks/pruner.mock.go index 6d5b0672c..a167523f9 100644 --- a/mod/storage/pkg/pruner/mocks/pruner.mock.go +++ b/mod/storage/pkg/pruner/mocks/pruner.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.0. DO NOT EDIT. +// Code generated by mockery v2.49.1. DO NOT EDIT. package mocks From 7d22a921b71bebc1064bd5f14bc45d1c63a489b9 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 08:52:56 +0100 Subject: [PATCH 49/52] anchored mockery to v2.49.0 --- build/scripts/codegen.mk | 2 +- .../pkg/engine-primitives/mocks/blobs_bundle.mock.go | 2 +- .../engine-primitives/mocks/built_execution_payload_env.mock.go | 2 +- .../pkg/engine-primitives/mocks/payload_attributer.mock.go | 2 +- mod/node-api/backend/mocks/availability_store.mock.go | 2 +- mod/node-api/backend/mocks/beacon_block_header.mock.go | 2 +- mod/node-api/backend/mocks/beacon_state.mock.go | 2 +- mod/node-api/backend/mocks/block_store.mock.go | 2 +- mod/node-api/backend/mocks/deposit_store.mock.go | 2 +- mod/node-api/backend/mocks/node.mock.go | 2 +- mod/node-api/backend/mocks/state_processor.mock.go | 2 +- mod/node-api/backend/mocks/storage_backend.mock.go | 2 +- mod/node-api/backend/mocks/validator.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal.mock.go | 2 +- mod/node-api/backend/mocks/withdrawal_credentials.mock.go | 2 +- mod/node-core/pkg/services/registry/mocks/basic.mock.go | 2 +- mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go | 2 +- .../pkg/services/registry/mocks/registry_option.mock.go | 2 +- mod/primitives/pkg/crypto/mocks/bls_signer.mock.go | 2 +- mod/state-transition/pkg/core/mocks/execution_engine.mock.go | 2 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 2 +- mod/storage/pkg/pruner/mocks/beacon_block.mock.go | 2 +- mod/storage/pkg/pruner/mocks/block_event.mock.go | 2 +- mod/storage/pkg/pruner/mocks/prunable.mock.go | 2 +- mod/storage/pkg/pruner/mocks/pruner.mock.go | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/build/scripts/codegen.mk b/build/scripts/codegen.mk index b504bfb87..b292fa510 100644 --- a/build/scripts/codegen.mk +++ b/build/scripts/codegen.mk @@ -12,7 +12,7 @@ generate: ## generate all the code (cd $$module && \ GETH_PKG_INCLUDE=$(GETH_PKG_INCLUDE) go generate ./...) || exit 1; \ done - @go run github.com/vektra/mockery/v2@latest + @go run github.com/vektra/mockery/v2@v2.49.0 generate-check: @$(MAKE) forge-build 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 0f910642f..a9755a8c7 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks 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 bb9afae80..2eb2e63c6 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 @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go index c6213b25c..ce712b7f2 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index d26b082de..26ab51f6c 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks 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 40f47d1bb..db5cfc419 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 37a4ab72f..ef3004fd8 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 0aec7824a..c5bc5b846 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/deposit_store.mock.go b/mod/node-api/backend/mocks/deposit_store.mock.go index 42efd3429..a226184c7 100644 --- a/mod/node-api/backend/mocks/deposit_store.mock.go +++ b/mod/node-api/backend/mocks/deposit_store.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/node.mock.go b/mod/node-api/backend/mocks/node.mock.go index 7b6ea6df8..45a53055b 100644 --- a/mod/node-api/backend/mocks/node.mock.go +++ b/mod/node-api/backend/mocks/node.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index 90b28efe4..031400960 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/storage_backend.mock.go b/mod/node-api/backend/mocks/storage_backend.mock.go index 8ddbf4eba..2992bb6e9 100644 --- a/mod/node-api/backend/mocks/storage_backend.mock.go +++ b/mod/node-api/backend/mocks/storage_backend.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 867842ed7..997eae07a 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index d9bd959e9..d0ef6cff9 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go index 44769f067..6abab4521 100644 --- a/mod/node-api/backend/mocks/withdrawal_credentials.mock.go +++ b/mod/node-api/backend/mocks/withdrawal_credentials.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/basic.mock.go b/mod/node-core/pkg/services/registry/mocks/basic.mock.go index 2b75bf30e..c72558a57 100644 --- a/mod/node-core/pkg/services/registry/mocks/basic.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/basic.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go index b8c291669..13003c311 100644 --- a/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/dispatcher.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go index f5bd036c8..d0239c9f3 100644 --- a/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go +++ b/mod/node-core/pkg/services/registry/mocks/registry_option.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index 91a694259..fad1b0884 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go index 6b65b7f9b..8bf5537e0 100644 --- a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index 809d49ef3..956c2182d 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go index 8d1dd864d..3f6fa20bc 100644 --- a/mod/storage/pkg/pruner/mocks/beacon_block.mock.go +++ b/mod/storage/pkg/pruner/mocks/beacon_block.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/block_event.mock.go b/mod/storage/pkg/pruner/mocks/block_event.mock.go index 0ef5bbc15..0297db3ce 100644 --- a/mod/storage/pkg/pruner/mocks/block_event.mock.go +++ b/mod/storage/pkg/pruner/mocks/block_event.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/prunable.mock.go b/mod/storage/pkg/pruner/mocks/prunable.mock.go index 056c3d36e..894d56ac3 100644 --- a/mod/storage/pkg/pruner/mocks/prunable.mock.go +++ b/mod/storage/pkg/pruner/mocks/prunable.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks diff --git a/mod/storage/pkg/pruner/mocks/pruner.mock.go b/mod/storage/pkg/pruner/mocks/pruner.mock.go index a167523f9..6d5b0672c 100644 --- a/mod/storage/pkg/pruner/mocks/pruner.mock.go +++ b/mod/storage/pkg/pruner/mocks/pruner.mock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.49.1. DO NOT EDIT. +// Code generated by mockery v2.49.0. DO NOT EDIT. package mocks From 84cf57dd0b3d0ef56077862898753da911b9668f Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 09:02:57 +0100 Subject: [PATCH 50/52] appease gosec --- mod/state-transition/pkg/core/deposits_validation.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index a063e9634..8f7fcade2 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -135,12 +135,14 @@ func (sp *StateProcessor[ } for i, sd := range localDeposits { - // Deposit indices should be contiguous. - if sd.GetIndex().Unwrap() != expectedStartIdx+uint64(i) { + // Deposit indices should be contiguous + //#nosec:G701 // i never negative + expectedIdx := expectedStartIdx + uint64(i) + if sd.GetIndex().Unwrap() != expectedIdx { return errors.Wrapf( ErrDepositIndexOutOfOrder, "local deposit index: %d, expected index: %d", - sd.GetIndex().Unwrap(), expectedStartIdx+uint64(i), + sd.GetIndex().Unwrap(), expectedIdx, ) } From 14f9416cc9217fa993f3e3ec64d80547d63d91cd Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 09:23:49 +0100 Subject: [PATCH 51/52] nit --- mod/state-transition/pkg/core/deposits_validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/state-transition/pkg/core/deposits_validation.go b/mod/state-transition/pkg/core/deposits_validation.go index 8f7fcade2..87fdeeff2 100644 --- a/mod/state-transition/pkg/core/deposits_validation.go +++ b/mod/state-transition/pkg/core/deposits_validation.go @@ -149,7 +149,7 @@ func (sp *StateProcessor[ if !sd.Equals(deposits[i]) { return errors.Wrapf( ErrDepositMismatch, - "local deposit: %d, payload deposit: %d", + "local deposit: %+v, payload deposit: %+v", sd, deposits[i], ) } From 8f8a1b3133da83059a89c9903dff0c88c5304d9d Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 27 Nov 2024 10:04:19 +0100 Subject: [PATCH 52/52] fixed block building logic --- mod/beacon/validator/block_builder.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod/beacon/validator/block_builder.go b/mod/beacon/validator/block_builder.go index 95c70f977..e713e9bd2 100644 --- a/mod/beacon/validator/block_builder.go +++ b/mod/beacon/validator/block_builder.go @@ -295,8 +295,11 @@ func (s *Service[ return ErrNilDepositIndexStart } - if s.chainSpec.DepositEth1ChainID() == spec.BoonetEth1ChainID && - blk.GetSlot() > math.U64(spec.BoonetFork2Height) { + // Bartio and Boonet pre Fork2 have deposit broken and undervalidated + // Any other network should build deposits the right way + if !(s.chainSpec.DepositEth1ChainID() == spec.BartioChainID || + (s.chainSpec.DepositEth1ChainID() == spec.BoonetEth1ChainID && + blk.GetSlot() < math.U64(spec.BoonetFork2Height))) { depositIndex++ } deposits, err := s.sb.DepositStore().GetDepositsByIndex(