From b4a1077a8379f8d522a0630530e9573f14f06d6a Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 28 Oct 2024 19:00:23 +0100 Subject: [PATCH 01/77] skip zero amount withdrawals to reduce number of withdrawals processed --- .../pkg/core/state/statedb.go | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 115816152c..9edb37d595 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -225,10 +225,6 @@ func (s *StateDB[ // Iterate through indices to find the next validators to withdraw. for range bound { - var ( - withdrawal WithdrawalT - amount math.Gwei - ) validator, err = s.ValidatorByIndex(validatorIndex) if err != nil { return nil, err @@ -247,21 +243,24 @@ func (s *StateDB[ // Set the amount of the withdrawal depending on the balance of the // validator. + var withdrawal WithdrawalT if validator.IsFullyWithdrawable(balance, epoch) { - amount = balance + withdrawals = append(withdrawals, withdrawal.New( + math.U64(withdrawalIndex), + validatorIndex, + withdrawalAddress, + balance, + )) } else if validator.IsPartiallyWithdrawable( balance, math.Gwei(s.cs.MaxEffectiveBalance()), ) { - amount = balance - math.Gwei(s.cs.MaxEffectiveBalance()) + withdrawals = append(withdrawals, withdrawal.New( + math.U64(withdrawalIndex), + validatorIndex, + withdrawalAddress, + balance-math.Gwei(s.cs.MaxEffectiveBalance()), + )) } - withdrawal = withdrawal.New( - math.U64(withdrawalIndex), - validatorIndex, - withdrawalAddress, - amount, - ) - - withdrawals = append(withdrawals, withdrawal) // Increment the withdrawal index to process the next withdrawal. withdrawalIndex++ From f4a7d795e9d0c005617fc8a4fc6f31c12de3ed4e Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 15:45:26 +0100 Subject: [PATCH 02/77] wip: adding UTs to state transition package --- .../pkg/core/state_processor_genesis_test.go | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 mod/state-transition/pkg/core/state_processor_genesis_test.go diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go new file mode 100644 index 0000000000..cc30205815 --- /dev/null +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package core_test + +import ( + "testing" + + "github.com/berachain/beacon-kit/mod/config/pkg/spec" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" + "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" +) + +type ( + TestBeaconStateMarshallableT = types.BeaconState[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.BeaconBlockHeader, + types.Eth1Data, + types.ExecutionPayloadHeader, + types.Fork, + types.Validator, + ] + + TestKVStoreT = beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ] + + TestBeaconStateT = statedb.StateDB[ + *types.BeaconBlockHeader, + *TestBeaconStateMarshallableT, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + types.WithdrawalCredentials, + ] +) + +func TestInitialize(t *testing.T) { + cs := spec.TestnetChainSpec() + // in.ExecutionEngine, + mocksSigner := &mocks.BLSSigner{} + + _ = core.NewStateProcessor[ + *types.BeaconBlock, + *types.BeaconBlockBody, + *types.BeaconBlockHeader, + *TestBeaconStateT, + + *transition.Context, + *types.Deposit, + *types.Eth1Data, + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.ForkData, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + engineprimitives.Withdrawals, + types.WithdrawalCredentials, + ]( + cs, + nil, + mocksSigner, + ) + + // vals, err := sp.InitializePreminedBeaconStateFromEth1() + // require.NoError(t, err) + + // This is not the right assert, just want to get to compile + // require.Empty(t, vals) + +} From 0f461722ebcd59cbf8cfa935b9cd28fc37503a56 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 17:17:16 +0100 Subject: [PATCH 03/77] wip: completed simple UT for state transition package --- .../pkg/core/state_processor_genesis_test.go | 120 +++++++++++++++++- 1 file changed, 114 insertions(+), 6 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index cc30205815..4184c762e1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -21,16 +21,33 @@ package core_test import ( + "context" + "fmt" "testing" + corestore "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" + "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" + "github.com/berachain/beacon-kit/mod/storage/pkg/db" + "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" + dbm "github.com/cosmos/cosmos-db" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" ) type ( @@ -75,12 +92,11 @@ func TestInitialize(t *testing.T) { // in.ExecutionEngine, mocksSigner := &mocks.BLSSigner{} - _ = core.NewStateProcessor[ + sp := core.NewStateProcessor[ *types.BeaconBlock, *types.BeaconBlockBody, *types.BeaconBlockHeader, *TestBeaconStateT, - *transition.Context, *types.Deposit, *types.Eth1Data, @@ -100,10 +116,102 @@ func TestInitialize(t *testing.T) { mocksSigner, ) - // vals, err := sp.InitializePreminedBeaconStateFromEth1() - // require.NoError(t, err) + kvStore, err := initTestStore() + require.NoError(t, err) + + var ( + beaconState = new(TestBeaconStateT).NewFromDB(kvStore, cs) + deposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x01}, + Amount: math.Gwei(1_000), + Index: uint64(0), + }, + { + Pubkey: [48]byte{0x02}, + Amount: math.Gwei(2_000), + Index: uint64(1), + }, + } + executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genesisVersion = version.FromUint32[common.Version](version.Deneb) + ) + + mocksSigner.On( + "VerifySignature", + mock.Anything, + mock.Anything, + mock.Anything, + ).Return(nil) + + vals, err := sp.InitializePreminedBeaconStateFromEth1( + beaconState, + deposits, + executionPayloadHeader, + genesisVersion, + ) + require.NoError(t, err) + require.Len(t, vals, len(deposits)) +} + +// Unit tests helpers + +type testKVStoreService struct { + ctx sdk.Context +} + +func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { + //nolint:contextcheck // fine with tests + return components.NewKVStore( + sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), + ) +} + +var ( + testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") + testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} +) + +func initTestStore() ( + *beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ], error) { + db, err := db.OpenDB("", dbm.MemDBBackend) + if err != nil { + return nil, fmt.Errorf("failed opening mem db: %w", err) + } + var ( + nopLog = log.NewNopLogger() + nopMetrics = metrics.NewNoOpMetrics() + ) + + cms := store.NewCommitMultiStore( + db, + nopLog, + nopMetrics, + ) - // This is not the right assert, just want to get to compile - // require.Empty(t, vals) + ctx := sdk.NewContext(cms, true, nopLog) + cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) + if err = cms.LoadLatestVersion(); err != nil { + return nil, fmt.Errorf("failed to load latest version: %w", err) + } + testStoreService := &testKVStoreService{ctx: ctx} + return beacondb.New[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ]( + testStoreService, + testCodec, + ), nil } From 22c7717d0648daf68814321d0f1e9d0fb826da29 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 22:07:41 +0100 Subject: [PATCH 04/77] wip: minimal execution engine stub --- mod/state-transition/pkg/core/helpers_test.go | 113 ++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 78 +----------- 2 files changed, 115 insertions(+), 76 deletions(-) create mode 100644 mod/state-transition/pkg/core/helpers_test.go diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go new file mode 100644 index 0000000000..1631830784 --- /dev/null +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: BUSL-1.1 +// +// Copyright (C) 2024, Berachain Foundation. All rights reserved. +// Use of this software is governed by the Business Source License included +// in the LICENSE file of this repository and at www.mariadb.com/bsl11. +// +// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY +// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER +// VERSIONS OF THE LICENSED WORK. +// +// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF +// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF +// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). +// +// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON +// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, +// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND +// TITLE. + +package core_test + +import ( + "context" + "fmt" + + corestore "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/store" + "cosmossdk.io/store/metrics" + storetypes "cosmossdk.io/store/types" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" + "github.com/berachain/beacon-kit/mod/storage/pkg/db" + "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" + dbm "github.com/cosmos/cosmos-db" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// TODO: replace with proper mock +type testExecutionEngine struct{} + +func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( + _ context.Context, + _ *engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ], +) error { + return nil +} + +type testKVStoreService struct { + ctx sdk.Context +} + +func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { + //nolint:contextcheck // fine with tests + return components.NewKVStore( + sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), + ) +} + +var ( + testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") + testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} +) + +func initTestStore() ( + *beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ], error) { + db, err := db.OpenDB("", dbm.MemDBBackend) + if err != nil { + return nil, fmt.Errorf("failed opening mem db: %w", err) + } + var ( + nopLog = log.NewNopLogger() + nopMetrics = metrics.NewNoOpMetrics() + ) + + cms := store.NewCommitMultiStore( + db, + nopLog, + nopMetrics, + ) + + ctx := sdk.NewContext(cms, true, nopLog) + cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) + if err = cms.LoadLatestVersion(); err != nil { + return nil, fmt.Errorf("failed to load latest version: %w", err) + } + testStoreService := &testKVStoreService{ctx: ctx} + + return beacondb.New[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ]( + testStoreService, + testCodec, + ), nil +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 4184c762e1..d27efca6a1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -21,19 +21,11 @@ package core_test import ( - "context" - "fmt" "testing" - corestore "cosmossdk.io/core/store" - "cosmossdk.io/log" - "cosmossdk.io/store" - "cosmossdk.io/store/metrics" - storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - "github.com/berachain/beacon-kit/mod/node-core/pkg/components" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -42,10 +34,6 @@ import ( "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" - "github.com/berachain/beacon-kit/mod/storage/pkg/db" - "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" - dbm "github.com/cosmos/cosmos-db" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) @@ -89,7 +77,7 @@ type ( func TestInitialize(t *testing.T) { cs := spec.TestnetChainSpec() - // in.ExecutionEngine, + execEngine := &testExecutionEngine{} mocksSigner := &mocks.BLSSigner{} sp := core.NewStateProcessor[ @@ -112,7 +100,7 @@ func TestInitialize(t *testing.T) { types.WithdrawalCredentials, ]( cs, - nil, + execEngine, mocksSigner, ) @@ -153,65 +141,3 @@ func TestInitialize(t *testing.T) { require.NoError(t, err) require.Len(t, vals, len(deposits)) } - -// Unit tests helpers - -type testKVStoreService struct { - ctx sdk.Context -} - -func (kvs *testKVStoreService) OpenKVStore(context.Context) corestore.KVStore { - //nolint:contextcheck // fine with tests - return components.NewKVStore( - sdk.UnwrapSDKContext(kvs.ctx).KVStore(testStoreKey), - ) -} - -var ( - testStoreKey = storetypes.NewKVStoreKey("state-transition-tests") - testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} -) - -func initTestStore() ( - *beacondb.KVStore[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ], error) { - db, err := db.OpenDB("", dbm.MemDBBackend) - if err != nil { - return nil, fmt.Errorf("failed opening mem db: %w", err) - } - var ( - nopLog = log.NewNopLogger() - nopMetrics = metrics.NewNoOpMetrics() - ) - - cms := store.NewCommitMultiStore( - db, - nopLog, - nopMetrics, - ) - - ctx := sdk.NewContext(cms, true, nopLog) - cms.MountStoreWithDB(testStoreKey, storetypes.StoreTypeIAVL, nil) - if err = cms.LoadLatestVersion(); err != nil { - return nil, fmt.Errorf("failed to load latest version: %w", err) - } - testStoreService := &testKVStoreService{ctx: ctx} - - return beacondb.New[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ]( - testStoreService, - testCodec, - ), nil -} From 05cba8072be6c116b7a733f881653316053056e4 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 22:15:12 +0100 Subject: [PATCH 05/77] extended asserts --- .../pkg/core/state_processor_genesis_test.go | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index d27efca6a1..88450c897b 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -27,6 +27,7 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" @@ -76,6 +77,7 @@ type ( ) func TestInitialize(t *testing.T) { + // Create state processor to test cs := spec.TestnetChainSpec() execEngine := &testExecutionEngine{} mocksSigner := &mocks.BLSSigner{} @@ -104,6 +106,7 @@ func TestInitialize(t *testing.T) { mocksSigner, ) + // create test inputs kvStore, err := initTestStore() require.NoError(t, err) @@ -112,12 +115,12 @@ func TestInitialize(t *testing.T) { deposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(1_000), + Amount: math.Gwei(cs.MaxEffectiveBalance()), Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(2_000), + Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), Index: uint64(1), }, } @@ -125,19 +128,49 @@ func TestInitialize(t *testing.T) { genesisVersion = version.FromUint32[common.Version](version.Deneb) ) + // define mocks expectations mocksSigner.On( "VerifySignature", - mock.Anything, - mock.Anything, - mock.Anything, + mock.Anything, mock.Anything, mock.Anything, ).Return(nil) + // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, deposits, executionPayloadHeader, genesisVersion, ) + + // check outputs require.NoError(t, err) require.Len(t, vals, len(deposits)) + + // check beacon state changes + resSlot, err := beaconState.GetSlot() + require.NoError(t, err) + require.Equal(t, math.Slot(0), resSlot) + + resFork, err := beaconState.GetFork() + require.NoError(t, err) + require.Equal(t, + &types.Fork{ + PreviousVersion: genesisVersion, + CurrentVersion: genesisVersion, + Epoch: math.Epoch(constants.GenesisEpoch), + }, + resFork) + + for _, dep := range deposits { + var idx math.U64 + idx, err = beaconState.ValidatorIndexByPubkey(dep.Pubkey) + require.NoError(t, err) + require.Equal(t, math.U64(dep.Index), idx) + + var val *types.Validator + val, err = beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, dep.Pubkey, val.Pubkey) + require.Equal(t, dep.Amount, val.EffectiveBalance) + } } From 443ac1b524ff4bf2bb79fa61485a7414cf566930 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 23:40:42 +0100 Subject: [PATCH 06/77] added test case --- .../pkg/core/state_processor_genesis_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 88450c897b..a37cca2a1e 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -123,6 +123,11 @@ func TestInitialize(t *testing.T) { Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), Index: uint64(1), }, + { + Pubkey: [48]byte{0x03}, + Amount: math.Gwei(cs.EffectiveBalanceIncrement()), + Index: uint64(2), + }, } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genesisVersion = version.FromUint32[common.Version](version.Deneb) From 10efd5ebef93349d9e2096c4e1a16be3fc91c389 Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 29 Oct 2024 23:51:17 +0100 Subject: [PATCH 07/77] nits --- .../pkg/core/state_processor_staking.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a98def71a3..fc336908da 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -131,12 +131,6 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - var ( - genesisValidatorsRoot common.Root - epoch math.Epoch - err error - ) - // Get the current slot. slot, err := st.GetSlot() if err != nil { @@ -144,9 +138,8 @@ func (sp *StateProcessor[ } // At genesis, the validators sign over an empty root. - if slot == 0 { - genesisValidatorsRoot = common.Root{} - } else { + genesisValidatorsRoot := common.Root{} + if slot != 0 { // Get the genesis validators root to be used to find fork data later. genesisValidatorsRoot, err = st.GetGenesisValidatorsRoot() if err != nil { @@ -155,7 +148,7 @@ func (sp *StateProcessor[ } // Get the current epoch. - epoch = sp.cs.SlotToEpoch(slot) + epoch := sp.cs.SlotToEpoch(slot) // Verify that the message was signed correctly. var d ForkDataT @@ -192,7 +185,6 @@ func (sp *StateProcessor[ ) // TODO: This is a bug that lives on bArtio. Delete this eventually. - const bArtioChainID = 80084 if sp.cs.DepositEth1ChainID() == bArtioChainID { if err := st.AddValidatorBartio(val); err != nil { return err From 099716dbbf3b190b5622493a85a3279fd3b27821 Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 12:22:16 +0530 Subject: [PATCH 08/77] tests for helpers in state transition using mock Signed-off-by: nidhi-singh02 --- .mockery.yaml | 5 + .../pkg/types/deposit_message_test.go | 2 +- .../mocks/blobs_bundle.mock.go | 13 +- .../mocks/built_execution_payload_env.mock.go | 16 +- .../backend/mocks/availability_store.mock.go | 24 +- .../backend/mocks/beacon_block_header.mock.go | 38 +- .../backend/mocks/beacon_state.mock.go | 164 +- .../backend/mocks/block_store.mock.go | 42 +- .../backend/mocks/state_processor.mock.go | 16 +- mod/node-api/backend/mocks/validator.mock.go | 28 +- mod/node-api/backend/mocks/withdrawal.mock.go | 14 +- .../pkg/crypto/mocks/bls_signer.mock.go | 66 +- mod/state-transition/pkg/core/helpers_test.go | 43 +- .../pkg/core/mocks/beacon_block.mock.go | 313 +++ .../pkg/core/mocks/beacon_block_body.mock.go | 320 +++ .../core/mocks/beacon_block_header.mock.go | 399 +++ .../pkg/core/mocks/beacon_state.mock.go | 2395 +++++++++++++++++ .../pkg/core/mocks/context.mock.go | 411 +++ .../pkg/core/mocks/deposit.mock.go | 225 ++ .../pkg/core/mocks/execution_engine.mock.go | 86 + .../pkg/core/mocks/execution_payload.mock.go | 1122 ++++++++ .../mocks/execution_payload_header.mock.go | 83 + .../pkg/core/mocks/fork_data.mock.go | 134 + .../core/mocks/read_only_beacon_state.mock.go | 1326 +++++++++ .../core/mocks/read_only_eth_1_data.mock.go | 197 ++ .../core/mocks/read_only_randao_mixes.mock.go | 94 + .../core/mocks/read_only_state_roots.mock.go | 94 + .../core/mocks/read_only_validators.mock.go | 149 + .../core/mocks/read_only_withdrawals.mock.go | 89 + .../pkg/core/mocks/validator.mock.go | 500 ++++ .../pkg/core/mocks/validators.mock.go | 83 + .../pkg/core/mocks/withdrawal.mock.go | 266 ++ .../core/mocks/withdrawals_constraint.mock.go | 115 + .../mocks/write_only_beacon_state.mock.go | 919 +++++++ .../core/mocks/write_only_eth_1_data.mock.go | 170 ++ .../mocks/write_only_randao_mixes.mock.go | 83 + .../core/mocks/write_only_state_roots.mock.go | 83 + .../core/mocks/write_only_validators.mock.go | 174 ++ .../pkg/core/state_processor_genesis_test.go | 12 +- mod/state-transition/pkg/core/types.go | 11 +- mod/storage/pkg/filedb/range_db_test.go | 4 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 82 +- 42 files changed, 10138 insertions(+), 272 deletions(-) create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/context.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/deposit.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_payload.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/fork_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_validators.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/validator.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/validators.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/withdrawal.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go create mode 100644 mod/state-transition/pkg/core/mocks/write_only_validators.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index 6062236306..dbbc916112 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,3 +68,8 @@ packages: recursive: False with-expecter: true all: True + github.com/berachain/beacon-kit/mod/state-transition/pkg/core: + config: + recursive: False + with-expecter: true + all: True diff --git a/mod/consensus-types/pkg/types/deposit_message_test.go b/mod/consensus-types/pkg/types/deposit_message_test.go index 66e4f89a3d..02cd17ab7b 100644 --- a/mod/consensus-types/pkg/types/deposit_message_test.go +++ b/mod/consensus-types/pkg/types/deposit_message_test.go @@ -44,7 +44,7 @@ func TestCreateAndSignDepositMessage(t *testing.T) { 0x01, 0x00, 0x00, 0x00, } - mocksSigner := &mocks.BLSSigner{} + mocksSigner := &mocks.Blssigner{} mocksSigner.On("PublicKey").Return(crypto.BLSPubkey{}) mocksSigner.On("Sign", mock.Anything).Return(crypto.BLSSignature{}, nil) diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go index 94ad0fad6e..688aad3a39 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go @@ -3,7 +3,6 @@ package mocks import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" mock "github.com/stretchr/testify/mock" @@ -117,19 +116,19 @@ func (_c *BlobsBundle_GetCommitments_Call) RunAndReturn(run func() []eip4844.KZG } // GetProofs provides a mock function with given fields: -func (_m *BlobsBundle) GetProofs() []bytes.B48 { +func (_m *BlobsBundle) GetProofs() []eip4844.KZGProof { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProofs") } - var r0 []bytes.B48 - if rf, ok := ret.Get(0).(func() []bytes.B48); ok { + var r0 []eip4844.KZGProof + if rf, ok := ret.Get(0).(func() []eip4844.KZGProof); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]bytes.B48) + r0 = ret.Get(0).([]eip4844.KZGProof) } } @@ -153,12 +152,12 @@ func (_c *BlobsBundle_GetProofs_Call) Run(run func()) *BlobsBundle_GetProofs_Cal return _c } -func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []bytes.B48) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { _c.Call.Return(_a0) return _c } -func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []bytes.B48) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { _c.Call.Return(run) return _c } diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go index 0ec103484e..01235c4ba2 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go @@ -4,9 +4,9 @@ package mocks import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - mock "github.com/stretchr/testify/mock" + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - uint256 "github.com/holiman/uint256" + mock "github.com/stretchr/testify/mock" ) // BuiltExecutionPayloadEnv is an autogenerated mock type for the BuiltExecutionPayloadEnv type @@ -115,19 +115,19 @@ func (_c *BuiltExecutionPayloadEnv_GetExecutionPayload_Call[ExecutionPayloadT]) } // GetValue provides a mock function with given fields: -func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *uint256.Int { +func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *math.U256 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetValue") } - var r0 *uint256.Int - if rf, ok := ret.Get(0).(func() *uint256.Int); ok { + var r0 *math.U256 + if rf, ok := ret.Get(0).(func() *math.U256); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*uint256.Int) + r0 = ret.Get(0).(*math.U256) } } @@ -151,12 +151,12 @@ func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Run(run fun return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(_a0) return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 17d2d80e87..784cdda804 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -23,7 +23,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) EXPECT() *Availabi } // IsDataAvailable provides a mock function with given fields: _a0, _a1, _a2 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT) bool { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT) bool { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a } var r0 bool - if rf, ok := ret.Get(0).(func(context.Context, math.U64, BeaconBlockBodyT) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, math.Slot, BeaconBlockBodyT) bool); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(bool) @@ -47,15 +47,15 @@ type AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT any, BlobSidecarsT // IsDataAvailable is a helper method to define mock.On call // - _a0 context.Context -// - _a1 math.U64 +// - _a1 math.Slot // - _a2 BeaconBlockBodyT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("IsDataAvailable", _a0, _a1, _a2)} } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(math.U64), args[2].(BeaconBlockBodyT)) + run(args[0].(context.Context), args[1].(math.Slot), args[2].(BeaconBlockBodyT)) }) return _c } @@ -65,13 +65,13 @@ func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT return _c } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.U64, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.Slot, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } // Persist provides a mock function with given fields: _a0, _a1 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U64, _a1 BlobSidecarsT) error { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.Slot, _a1 BlobSidecarsT) error { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -79,7 +79,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U } var r0 error - if rf, ok := ret.Get(0).(func(math.U64, BlobSidecarsT) error); ok { + if rf, ok := ret.Get(0).(func(math.Slot, BlobSidecarsT) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -94,15 +94,15 @@ type AvailabilityStore_Persist_Call[BeaconBlockBodyT any, BlobSidecarsT any] str } // Persist is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.Slot // - _a1 BlobSidecarsT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 interface{}, _a1 interface{}) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("Persist", _a0, _a1)} } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.U64, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.Slot, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(BlobSidecarsT)) + run(args[0].(math.Slot), args[1].(BlobSidecarsT)) }) return _c } @@ -112,7 +112,7 @@ func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Retur return _c } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.U64, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.Slot, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_block_header.mock.go b/mod/node-api/backend/mocks/beacon_block_header.mock.go index c9d0cd0b6d..5e019b5821 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -117,18 +117,18 @@ func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndR } // GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.U64 { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProposerIndex") } - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } return r0 @@ -151,29 +151,29 @@ func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run f return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.U64 { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } return r0 @@ -196,12 +196,12 @@ func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *B return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } @@ -358,7 +358,7 @@ func (_c *BeaconBlockHeader_MarshalSSZ_Call[BeaconBlockHeaderT]) RunAndReturn(ru } // New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) if len(ret) == 0 { @@ -366,7 +366,7 @@ func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerInde } var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) } else { r0 = ret.Get(0).(BeaconBlockHeaderT) @@ -381,8 +381,8 @@ type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { } // New is a helper method to define mock.On call -// - slot math.U64 -// - proposerIndex math.U64 +// - slot math.Slot +// - proposerIndex math.ValidatorIndex // - parentBlockRoot common.Root // - stateRoot common.Root // - bodyRoot common.Root @@ -390,9 +390,9 @@ func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) }) return _c } @@ -402,7 +402,7 @@ func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlock return _c } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 184d2d7024..1f9fdf1302 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -3,9 +3,7 @@ package mocks import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -84,25 +82,25 @@ func (_c *BeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, Ex } // GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.U64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetBalance") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } - if rf, ok := ret.Get(1).(func(math.U64) error); ok { + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -117,24 +115,24 @@ type BeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, Executio } // GetBalance is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.ValidatorIndex func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.ValidatorIndex)) }) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -585,22 +583,22 @@ func (_c *BeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, } // GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetNextWithdrawalValidatorIndex") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func() error); ok { @@ -629,34 +627,34 @@ func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (bytes.B32, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetRandaoMixAtIndex") } - var r0 bytes.B32 + var r0 common.Bytes32 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (bytes.B32, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) bytes.B32); ok { + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(bytes.B32) + r0 = ret.Get(0).(common.Bytes32) } } @@ -687,33 +685,33 @@ func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Ex return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 bytes.B32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (bytes.B32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetSlashingAtIndex") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -743,33 +741,33 @@ func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Exe return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.Slot); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func() error); ok { @@ -798,33 +796,33 @@ func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetTotalActiveBalances") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -854,33 +852,33 @@ func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetTotalSlashing") } - var r0 math.U64 + var r0 math.Gwei var r1 error - if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.U64); ok { + if rf, ok := ret.Get(0).(func() math.Gwei); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Gwei) } if rf, ok := ret.Get(1).(func() error); ok { @@ -909,12 +907,12 @@ func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1087,7 +1085,7 @@ func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, E } // SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.U64) error { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1095,7 +1093,7 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo } var r0 error - if rf, ok := ret.Get(0).(func(math.U64) error); ok { + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -1110,14 +1108,14 @@ type BeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPa } // SetSlot is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.Slot func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.Slot)) }) return _c } @@ -1127,7 +1125,7 @@ func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1191,7 +1189,7 @@ func (_c *BeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu } // ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.U64) (ValidatorT, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1200,16 +1198,16 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo var r0 ValidatorT var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (ValidatorT, error)); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.U64) ValidatorT); ok { + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ValidatorT) } - if rf, ok := ret.Get(1).(func(math.U64) error); ok { + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -1224,14 +1222,14 @@ type BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, Ex } // ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.U64 +// - _a0 math.ValidatorIndex func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64)) + run(args[0].(math.ValidatorIndex)) }) return _c } @@ -1241,28 +1239,28 @@ func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { ret := _m.Called(cometBFTAddress) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByCometBFTAddress") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { return rf(cometBFTAddress) } - if rf, ok := ret.Get(0).(func([]byte) math.U64); ok { + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { r0 = rf(cometBFTAddress) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func([]byte) error); ok { @@ -1292,33 +1290,33 @@ func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.U64, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.U64, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByPubkey") } - var r0 math.U64 + var r0 math.ValidatorIndex var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.U64); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.ValidatorIndex) } if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { @@ -1348,12 +1346,12 @@ func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.U64, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 4e532a619f..74f3b716a2 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -23,22 +23,22 @@ func (_m *BlockStore[BeaconBlockT]) EXPECT() *BlockStore_Expecter[BeaconBlockT] } // GetParentSlotByTimestamp provides a mock function with given fields: timestamp -func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.Slot, error) { ret := _m.Called(timestamp) if len(ret) == 0 { panic("no return value specified for GetParentSlotByTimestamp") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.Slot, error)); ok { return rf(timestamp) } - if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.Slot); ok { r0 = rf(timestamp) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(math.U64) error); ok { @@ -68,33 +68,33 @@ func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Run(run func(t return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.Slot, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByBlockRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.Slot, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByBlockRoot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -124,33 +124,33 @@ func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByStateRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.U64, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.Slot, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByStateRoot") } - var r0 math.U64 + var r0 math.Slot var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.U64) + r0 = ret.Get(0).(math.Slot) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -180,12 +180,12 @@ func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index a7103536ed..7dcf5f3002 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -23,7 +23,7 @@ func (_m *StateProcessor[BeaconStateT]) EXPECT() *StateProcessor_Expecter[Beacon } // ProcessSlots provides a mock function with given fields: _a0, _a1 -func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.U64) (transition.ValidatorUpdates, error) { +func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.Slot) (transition.ValidatorUpdates, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -32,10 +32,10 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. var r0 transition.ValidatorUpdates var r1 error - if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) transition.ValidatorUpdates); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) transition.ValidatorUpdates); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -43,7 +43,7 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. } } - if rf, ok := ret.Get(1).(func(BeaconStateT, math.U64) error); ok { + if rf, ok := ret.Get(1).(func(BeaconStateT, math.Slot) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -59,14 +59,14 @@ type StateProcessor_ProcessSlots_Call[BeaconStateT any] struct { // ProcessSlots is a helper method to define mock.On call // - _a0 BeaconStateT -// - _a1 math.U64 +// - _a1 math.Slot func (_e *StateProcessor_Expecter[BeaconStateT]) ProcessSlots(_a0 interface{}, _a1 interface{}) *StateProcessor_ProcessSlots_Call[BeaconStateT] { return &StateProcessor_ProcessSlots_Call[BeaconStateT]{Call: _e.mock.On("ProcessSlots", _a0, _a1)} } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.U64)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.Slot)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconStateT), args[1].(math.U64)) + run(args[0].(BeaconStateT), args[1].(math.Slot)) }) return _c } @@ -76,7 +76,7 @@ func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Return(_a0 transition. return _c } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 73404aa0d7..655e2123b2 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -68,7 +68,7 @@ func (_c *Validator_GetWithdrawalCredentials_Call[WithdrawalCredentialsT]) RunAn } // IsFullyWithdrawable provides a mock function with given fields: amount, epoch -func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64, epoch math.U64) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwei, epoch math.Epoch) bool { ret := _m.Called(amount, epoch) if len(ret) == 0 { @@ -76,7 +76,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64 } var r0 bool - if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { + if rf, ok := ret.Get(0).(func(math.Gwei, math.Epoch) bool); ok { r0 = rf(amount, epoch) } else { r0 = ret.Get(0).(bool) @@ -91,15 +91,15 @@ type Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT backend.Withdrawa } // IsFullyWithdrawable is a helper method to define mock.On call -// - amount math.U64 -// - epoch math.U64 +// - amount math.Gwei +// - epoch math.Epoch func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsFullyWithdrawable(amount interface{}, epoch interface{}) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsFullyWithdrawable", amount, epoch)} } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.U64, epoch math.U64)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.Gwei, epoch math.Epoch)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64)) + run(args[0].(math.Gwei), args[1].(math.Epoch)) }) return _c } @@ -109,13 +109,13 @@ func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Return(_a0 return _c } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Epoch) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } // IsPartiallyWithdrawable provides a mock function with given fields: amount1, amount2 -func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.U64, amount2 math.U64) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.Gwei, amount2 math.Gwei) bool { ret := _m.Called(amount1, amount2) if len(ret) == 0 { @@ -123,7 +123,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 mat } var r0 bool - if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { + if rf, ok := ret.Get(0).(func(math.Gwei, math.Gwei) bool); ok { r0 = rf(amount1, amount2) } else { r0 = ret.Get(0).(bool) @@ -138,15 +138,15 @@ type Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT backend.Withd } // IsPartiallyWithdrawable is a helper method to define mock.On call -// - amount1 math.U64 -// - amount2 math.U64 +// - amount1 math.Gwei +// - amount2 math.Gwei func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 interface{}, amount2 interface{}) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsPartiallyWithdrawable", amount1, amount2)} } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.U64, amount2 math.U64)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.Gwei, amount2 math.Gwei)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64)) + run(args[0].(math.Gwei), args[1].(math.Gwei)) }) return _c } @@ -156,7 +156,7 @@ func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Return return _c } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Gwei) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index d7dbcb6747..72fd41fa44 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -23,7 +23,7 @@ func (_m *Withdrawal[T]) EXPECT() *Withdrawal_Expecter[T] { } // New provides a mock function with given fields: index, validator, address, amount -func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64) T { +func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei) T { ret := _m.Called(index, validator, address, amount) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common. } var r0 T - if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.ExecutionAddress, math.U64) T); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T); ok { r0 = rf(index, validator, address, amount) } else { r0 = ret.Get(0).(T) @@ -47,16 +47,16 @@ type Withdrawal_New_Call[T any] struct { // New is a helper method to define mock.On call // - index math.U64 -// - validator math.U64 +// - validator math.ValidatorIndex // - address common.ExecutionAddress -// - amount math.U64 +// - amount math.Gwei func (_e *Withdrawal_Expecter[T]) New(index interface{}, validator interface{}, address interface{}, amount interface{}) *Withdrawal_New_Call[T] { return &Withdrawal_New_Call[T]{Call: _e.mock.On("New", index, validator, address, amount)} } -func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64)) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei)) *Withdrawal_New_Call[T] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.U64), args[2].(common.ExecutionAddress), args[3].(math.U64)) + run(args[0].(math.U64), args[1].(math.ValidatorIndex), args[2].(common.ExecutionAddress), args[3].(math.Gwei)) }) return _c } @@ -66,7 +66,7 @@ func (_c *Withdrawal_New_Call[T]) Return(_a0 T) *Withdrawal_New_Call[T] { return _c } -func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.U64, common.ExecutionAddress, math.U64) T) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T) *Withdrawal_New_Call[T] { _c.Call.Return(run) return _c } diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index 4ea1d83c10..a9e52cb133 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -7,21 +7,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// BLSSigner is an autogenerated mock type for the BLSSigner type -type BLSSigner struct { +// Blssigner is an autogenerated mock type for the BLSSigner type +type Blssigner struct { mock.Mock } -type BLSSigner_Expecter struct { +type Blssigner_Expecter struct { mock *mock.Mock } -func (_m *BLSSigner) EXPECT() *BLSSigner_Expecter { - return &BLSSigner_Expecter{mock: &_m.Mock} +func (_m *Blssigner) EXPECT() *Blssigner_Expecter { + return &Blssigner_Expecter{mock: &_m.Mock} } // PublicKey provides a mock function with given fields: -func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { +func (_m *Blssigner) PublicKey() crypto.BLSPubkey { ret := _m.Called() if len(ret) == 0 { @@ -40,35 +40,35 @@ func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { return r0 } -// BLSSigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' -type BLSSigner_PublicKey_Call struct { +// Blssigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' +type Blssigner_PublicKey_Call struct { *mock.Call } // PublicKey is a helper method to define mock.On call -func (_e *BLSSigner_Expecter) PublicKey() *BLSSigner_PublicKey_Call { - return &BLSSigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} +func (_e *Blssigner_Expecter) PublicKey() *Blssigner_PublicKey_Call { + return &Blssigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} } -func (_c *BLSSigner_PublicKey_Call) Run(run func()) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) Run(run func()) *Blssigner_PublicKey_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } -func (_c *BLSSigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *Blssigner_PublicKey_Call { _c.Call.Return(_a0) return _c } -func (_c *BLSSigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *BLSSigner_PublicKey_Call { +func (_c *Blssigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *Blssigner_PublicKey_Call { _c.Call.Return(run) return _c } // Sign provides a mock function with given fields: _a0 -func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { +func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -97,36 +97,36 @@ func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { return r0, r1 } -// BLSSigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' -type BLSSigner_Sign_Call struct { +// Blssigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type Blssigner_Sign_Call struct { *mock.Call } // Sign is a helper method to define mock.On call // - _a0 []byte -func (_e *BLSSigner_Expecter) Sign(_a0 interface{}) *BLSSigner_Sign_Call { - return &BLSSigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} +func (_e *Blssigner_Expecter) Sign(_a0 interface{}) *Blssigner_Sign_Call { + return &Blssigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} } -func (_c *BLSSigner_Sign_Call) Run(run func(_a0 []byte)) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) Run(run func(_a0 []byte)) *Blssigner_Sign_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *BLSSigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *Blssigner_Sign_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *BLSSigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *BLSSigner_Sign_Call { +func (_c *Blssigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *Blssigner_Sign_Call { _c.Call.Return(run) return _c } // VerifySignature provides a mock function with given fields: pubKey, msg, signature -func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { +func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { ret := _m.Called(pubKey, msg, signature) if len(ret) == 0 { @@ -143,8 +143,8 @@ func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signat return r0 } -// BLSSigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type BLSSigner_VerifySignature_Call struct { +// Blssigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type Blssigner_VerifySignature_Call struct { *mock.Call } @@ -152,34 +152,34 @@ type BLSSigner_VerifySignature_Call struct { // - pubKey crypto.BLSPubkey // - msg []byte // - signature crypto.BLSSignature -func (_e *BLSSigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *BLSSigner_VerifySignature_Call { - return &BLSSigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} +func (_e *Blssigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *Blssigner_VerifySignature_Call { + return &Blssigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} } -func (_c *BLSSigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *Blssigner_VerifySignature_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(crypto.BLSPubkey), args[1].([]byte), args[2].(crypto.BLSSignature)) }) return _c } -func (_c *BLSSigner_VerifySignature_Call) Return(_a0 error) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) Return(_a0 error) *Blssigner_VerifySignature_Call { _c.Call.Return(_a0) return _c } -func (_c *BLSSigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *BLSSigner_VerifySignature_Call { +func (_c *Blssigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *Blssigner_VerifySignature_Call { _c.Call.Return(run) return _c } -// NewBLSSigner creates a new instance of BLSSigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewBlssigner creates a new instance of Blssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewBLSSigner(t interface { +func NewBlssigner(t interface { mock.TestingT Cleanup(func()) -}) *BLSSigner { - mock := &BLSSigner{} +}) *Blssigner { + mock := &Blssigner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 1631830784..b982800a67 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,6 +23,7 @@ package core_test import ( "context" "fmt" + "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -32,24 +33,48 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" ) -// TODO: replace with proper mock -type testExecutionEngine struct{} - -func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( - _ context.Context, - _ *engineprimitives.NewPayloadRequest[ +func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { + mockEngine := mocks.NewExecutionEngine[ *types.ExecutionPayload, + *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ], -) error { - return nil + ](t) + + t.Run("successful verification with complete payload", func(t *testing.T) { + req := &engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ]{ + ExecutionPayload: &types.ExecutionPayload{}, + VersionedHashes: []common.ExecutionHash{ + {0x1}, + {0x2}, + }, + ParentBeaconBlockRoot: &common.Root{0x3}, + Optimistic: false, + } + + // Set up expectation for successful verification + mockEngine.EXPECT(). + VerifyAndNotifyNewPayload( + context.Background(), + req, + ). + Return(nil) + + err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) + require.NoError(t, err) + }) } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go new file mode 100644 index 0000000000..9b7182a9b9 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go @@ -0,0 +1,313 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlock is an autogenerated mock type for the BeaconBlock type +type BeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock.Mock +} + +type BeaconBlock_Expecter[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// GetBody provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() BeaconBlockBodyT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBody") + } + + var r0 BeaconBlockBodyT + if rf, ok := ret.Get(0).(func() BeaconBlockBodyT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockBodyT) + } + + return r0 +} + +// BeaconBlock_GetBody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBody' +type BeaconBlock_GetBody_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetBody is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBody")} +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetParentBlockRoot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentBlockRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlock_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' +type BeaconBlock_GetParentBlockRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetParentBlockRoot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentBlockRoot")} +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetProposerIndex provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// BeaconBlock_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' +type BeaconBlock_GetProposerIndex_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetProposerIndex is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetProposerIndex")} +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() math.Slot { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + return r0 +} + +// BeaconBlock_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconBlock_GetSlot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlock_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type BeaconBlock_GetStateRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// IsNil provides a mock function with given fields: +func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsNil") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// BeaconBlock_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' +type BeaconBlock_IsNil_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// IsNil is a helper method to define mock.On call +func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlock creates a new instance of BeaconBlock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go new file mode 100644 index 0000000000..cc750bf211 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go @@ -0,0 +1,320 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlockBody is an autogenerated mock type for the BeaconBlockBody type +type BeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock.Mock +} + +type BeaconBlockBody_Expecter[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// Empty provides a mock function with given fields: _a0 +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) BeaconBlockBodyT { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Empty") + } + + var r0 BeaconBlockBodyT + if rf, ok := ret.Get(0).(func(uint32) BeaconBlockBodyT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(BeaconBlockBodyT) + } + + return r0 +} + +// BeaconBlockBody_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' +type BeaconBlockBody_Empty_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// Empty is a helper method to define mock.On call +// - _a0 uint32 +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint32)) + }) + return _c +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlobKzgCommitments provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() eip4844.KZGCommitments[common.ExecutionHash] { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlobKzgCommitments") + } + + var r0 eip4844.KZGCommitments[common.ExecutionHash] + if rf, ok := ret.Get(0).(func() eip4844.KZGCommitments[common.ExecutionHash]); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(eip4844.KZGCommitments[common.ExecutionHash]) + } + } + + return r0 +} + +// BeaconBlockBody_GetBlobKzgCommitments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobKzgCommitments' +type BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlobKzgCommitments is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobKzgCommitments")} +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetDeposits provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() []DepositT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetDeposits") + } + + var r0 []DepositT + if rf, ok := ret.Get(0).(func() []DepositT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]DepositT) + } + } + + return r0 +} + +// BeaconBlockBody_GetDeposits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeposits' +type BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetDeposits is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetDeposits")} +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExecutionPayload provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() ExecutionPayloadT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExecutionPayload") + } + + var r0 ExecutionPayloadT + if rf, ok := ret.Get(0).(func() ExecutionPayloadT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadT) + } + + return r0 +} + +// BeaconBlockBody_GetExecutionPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionPayload' +type BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetExecutionPayload is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExecutionPayload")} +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoReveal provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() crypto.BLSSignature { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetRandaoReveal") + } + + var r0 crypto.BLSSignature + if rf, ok := ret.Get(0).(func() crypto.BLSSignature); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSSignature) + } + } + + return r0 +} + +// BeaconBlockBody_GetRandaoReveal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoReveal' +type BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// GetRandaoReveal is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetRandaoReveal")} +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockBody_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlockBody creates a new instance of BeaconBlockBody. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go new file mode 100644 index 0000000000..e8353c6e6d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go @@ -0,0 +1,399 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconBlockHeader is an autogenerated mock type for the BeaconBlockHeader type +type BeaconBlockHeader[BeaconBlockHeaderT any] struct { + mock.Mock +} + +type BeaconBlockHeader_Expecter[BeaconBlockHeaderT any] struct { + mock *mock.Mock +} + +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) EXPECT() *BeaconBlockHeader_Expecter[BeaconBlockHeaderT] { + return &BeaconBlockHeader_Expecter[BeaconBlockHeaderT]{mock: &_m.Mock} +} + +// GetBodyRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetBodyRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBodyRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetBodyRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBodyRoot' +type BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetBodyRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetBodyRoot() *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetBodyRoot")} +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetParentBlockRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetParentBlockRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentBlockRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' +type BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetParentBlockRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetParentBlockRoot() *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetParentBlockRoot")} +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetProposerIndex provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// BeaconBlockHeader_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' +type BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetProposerIndex is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetProposerIndex() *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetProposerIndex")} +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + return r0 +} + +// BeaconBlockHeader_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetSlot() *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetStateRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetStateRoot() *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconBlockHeader_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) HashTreeRoot() *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { + ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 BeaconBlockHeaderT + if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + return r0 +} + +// BeaconBlockHeader_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - slot math.Slot +// - proposerIndex math.ValidatorIndex +// - parentBlockRoot common.Root +// - stateRoot common.Root +// - bodyRoot common.Root +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, proposerIndex interface{}, parentBlockRoot interface{}, stateRoot interface{}, bodyRoot interface{}) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + }) + return _c +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetStateRoot provides a mock function with given fields: _a0 +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) SetStateRoot(_a0 common.Root) { + _m.Called(_a0) +} + +// BeaconBlockHeader_SetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStateRoot' +type BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT any] struct { + *mock.Call +} + +// SetStateRoot is a helper method to define mock.On call +// - _a0 common.Root +func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) SetStateRoot(_a0 interface{}) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + return &BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("SetStateRoot", _a0)} +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Run(run func(_a0 common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Return() *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return() + return _c +} + +func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func(common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconBlockHeader creates a new instance of BeaconBlockHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconBlockHeader[BeaconBlockHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconBlockHeader[BeaconBlockHeaderT] { + mock := &BeaconBlockHeader[BeaconBlockHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go new file mode 100644 index 0000000000..c857192228 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go @@ -0,0 +1,2395 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// BeaconState is an autogenerated mock type for the BeaconState type +type BeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock.Mock +} + +type BeaconState_Expecter[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type BeaconState_AddValidator_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 interface{}) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type BeaconState_AddValidatorBartio_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 interface{}) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// Context provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() context.Context { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Context") + } + + var r0 context.Context + if rf, ok := ret.Get(0).(func() context.Context); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(context.Context) + } + } + + return r0 +} + +// BeaconState_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' +type BeaconState_Context_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// Context is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Context")} +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// Copy provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() T { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Copy") + } + + var r0 T + if rf, ok := ret.Get(0).(func() T); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(T) + } + + return r0 +} + +// BeaconState_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' +type BeaconState_Copy_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// Copy is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Copy")} +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// DecreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for DecreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' +type BeaconState_DecreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// DecreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type BeaconState_ExpectedWithdrawals_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBalance provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBalance") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type BeaconState_GetBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBlockRootAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBlockRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' +type BeaconState_GetBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1Data provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type BeaconState_GetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type BeaconState_GetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetFork provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFork") + } + + var r0 ForkT + var r1 error + if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ForkT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ForkT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' +type BeaconState_GetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetFork is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetGenesisValidatorsRoot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGenesisValidatorsRoot") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' +type BeaconState_GetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetGenesisValidatorsRoot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestBlockHeader provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestBlockHeader") + } + + var r0 BeaconBlockHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' +type BeaconState_GetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestBlockHeader is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type BeaconState_GetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' +type BeaconState_GetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalValidatorIndex provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalValidatorIndex") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' +type BeaconState_GetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type BeaconState_GetRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlashingAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetSlashingAtIndex") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' +type BeaconState_GetSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + var r1 error + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type BeaconState_GetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalActiveBalances provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetTotalActiveBalances") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' +type BeaconState_GetTotalActiveBalances_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalActiveBalances is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalSlashing provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalSlashing") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' +type BeaconState_GetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalSlashing is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalValidators provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalValidators") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' +type BeaconState_GetTotalValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalValidators is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidators provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidators") + } + + var r0 ValidatorsT + var r1 error + if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ValidatorsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ValidatorsT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' +type BeaconState_GetValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidators is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorsByEffectiveBalance provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorsByEffectiveBalance") + } + + var r0 []ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []ValidatorT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ValidatorT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' +type BeaconState_GetValidatorsByEffectiveBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorsByEffectiveBalance is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// BeaconState_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type BeaconState_HashTreeRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// IncreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IncreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' +type BeaconState_IncreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// IncreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewFromDB provides a mock function with given fields: bdb, cs +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb KVStoreT, cs common.ChainSpec) T { + ret := _m.Called(bdb, cs) + + if len(ret) == 0 { + panic("no return value specified for NewFromDB") + } + + var r0 T + if rf, ok := ret.Get(0).(func(KVStoreT, common.ChainSpec) T); ok { + r0 = rf(bdb, cs) + } else { + r0 = ret.Get(0).(T) + } + + return r0 +} + +// BeaconState_NewFromDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewFromDB' +type BeaconState_NewFromDB_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// NewFromDB is a helper method to define mock.On call +// - bdb KVStoreT +// - cs common.ChainSpec +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb interface{}, cs interface{}) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("NewFromDB", bdb, cs)} +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(bdb KVStoreT, cs common.ChainSpec)) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(KVStoreT), args[1].(common.ChainSpec)) + }) + return _c +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(KVStoreT, common.ChainSpec) T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type BeaconState_SetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 interface{}) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 Eth1DataT)) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(Eth1DataT) error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type BeaconState_SetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 interface{}) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetFork provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 ForkT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetFork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' +type BeaconState_SetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetFork is a helper method to define mock.On call +// - _a0 ForkT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 interface{}) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetFork", _a0)} +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ForkT)) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkT)) + }) + return _c +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ForkT) error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetGenesisValidatorsRoot provides a mock function with given fields: root +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root common.Root) error { + ret := _m.Called(root) + + if len(ret) == 0 { + panic("no return value specified for SetGenesisValidatorsRoot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(common.Root) error); ok { + r0 = rf(root) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' +type BeaconState_SetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetGenesisValidatorsRoot is a helper method to define mock.On call +// - root common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root interface{}) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(root common.Root)) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(common.Root) error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetLatestBlockHeader provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestBlockHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' +type BeaconState_SetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetLatestBlockHeader is a helper method to define mock.On call +// - _a0 BeaconBlockHeaderT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 interface{}) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 BeaconBlockHeaderT)) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(BeaconBlockHeaderT)) + }) + return _c +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type BeaconState_SetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' +type BeaconState_SetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetNextWithdrawalIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalValidatorIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' +type BeaconState_SetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetSlot provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetSlot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' +type BeaconState_SetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetSlot is a helper method to define mock.On call +// - _a0 math.Slot +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot)) + }) + return _c +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// SetTotalSlashing provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 math.Gwei) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetTotalSlashing") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' +type BeaconState_SetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// SetTotalSlashing is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 interface{}) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetTotalSlashing", _a0)} +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Gwei)) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Gwei) error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type BeaconState_StateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateBlockRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' +type BeaconState_UpdateBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type BeaconState_UpdateRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Bytes32) error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateSlashingAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' +type BeaconState_UpdateSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 math.Gwei +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, math.Gwei) error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type BeaconState_UpdateStateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// BeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type BeaconState_UpdateValidatorAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type BeaconState_ValidatorByIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { + ret := _m.Called(cometBFTAddress) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByCometBFTAddress") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + return rf(cometBFTAddress) + } + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + r0 = rf(cometBFTAddress) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(cometBFTAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' +type BeaconState_ValidatorIndexByCometBFTAddress_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call +// - cometBFTAddress []byte +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// BeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type BeaconState_ValidatorIndexByPubkey_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + return &BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewBeaconState creates a new instance of BeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { + mock := &BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/context.mock.go b/mod/state-transition/pkg/core/mocks/context.mock.go new file mode 100644 index 0000000000..580f0c7713 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/context.mock.go @@ -0,0 +1,411 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + time "time" + + mock "github.com/stretchr/testify/mock" +) + +// Context is an autogenerated mock type for the Context type +type Context struct { + mock.Mock +} + +type Context_Expecter struct { + mock *mock.Mock +} + +func (_m *Context) EXPECT() *Context_Expecter { + return &Context_Expecter{mock: &_m.Mock} +} + +// Deadline provides a mock function with given fields: +func (_m *Context) Deadline() (time.Time, bool) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Deadline") + } + + var r0 time.Time + var r1 bool + if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() time.Time); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(time.Time) + } + + if rf, ok := ret.Get(1).(func() bool); ok { + r1 = rf() + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + +// Context_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline' +type Context_Deadline_Call struct { + *mock.Call +} + +// Deadline is a helper method to define mock.On call +func (_e *Context_Expecter) Deadline() *Context_Deadline_Call { + return &Context_Deadline_Call{Call: _e.mock.On("Deadline")} +} + +func (_c *Context_Deadline_Call) Run(run func()) *Context_Deadline_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Deadline_Call) Return(deadline time.Time, ok bool) *Context_Deadline_Call { + _c.Call.Return(deadline, ok) + return _c +} + +func (_c *Context_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *Context_Deadline_Call { + _c.Call.Return(run) + return _c +} + +// Done provides a mock function with given fields: +func (_m *Context) Done() <-chan struct{} { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Done") + } + + var r0 <-chan struct{} + if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan struct{}) + } + } + + return r0 +} + +// Context_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' +type Context_Done_Call struct { + *mock.Call +} + +// Done is a helper method to define mock.On call +func (_e *Context_Expecter) Done() *Context_Done_Call { + return &Context_Done_Call{Call: _e.mock.On("Done")} +} + +func (_c *Context_Done_Call) Run(run func()) *Context_Done_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Done_Call) Return(_a0 <-chan struct{}) *Context_Done_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Done_Call) RunAndReturn(run func() <-chan struct{}) *Context_Done_Call { + _c.Call.Return(run) + return _c +} + +// Err provides a mock function with given fields: +func (_m *Context) Err() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Err") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Context_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Context_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Context_Expecter) Err() *Context_Err_Call { + return &Context_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Context_Err_Call) Run(run func()) *Context_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_Err_Call) Return(_a0 error) *Context_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Err_Call) RunAndReturn(run func() error) *Context_Err_Call { + _c.Call.Return(run) + return _c +} + +// GetOptimisticEngine provides a mock function with given fields: +func (_m *Context) GetOptimisticEngine() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetOptimisticEngine") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetOptimisticEngine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOptimisticEngine' +type Context_GetOptimisticEngine_Call struct { + *mock.Call +} + +// GetOptimisticEngine is a helper method to define mock.On call +func (_e *Context_Expecter) GetOptimisticEngine() *Context_GetOptimisticEngine_Call { + return &Context_GetOptimisticEngine_Call{Call: _e.mock.On("GetOptimisticEngine")} +} + +func (_c *Context_GetOptimisticEngine_Call) Run(run func()) *Context_GetOptimisticEngine_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetOptimisticEngine_Call) Return(_a0 bool) *Context_GetOptimisticEngine_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetOptimisticEngine_Call) RunAndReturn(run func() bool) *Context_GetOptimisticEngine_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipPayloadVerification provides a mock function with given fields: +func (_m *Context) GetSkipPayloadVerification() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipPayloadVerification") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipPayloadVerification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipPayloadVerification' +type Context_GetSkipPayloadVerification_Call struct { + *mock.Call +} + +// GetSkipPayloadVerification is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipPayloadVerification() *Context_GetSkipPayloadVerification_Call { + return &Context_GetSkipPayloadVerification_Call{Call: _e.mock.On("GetSkipPayloadVerification")} +} + +func (_c *Context_GetSkipPayloadVerification_Call) Run(run func()) *Context_GetSkipPayloadVerification_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipPayloadVerification_Call) Return(_a0 bool) *Context_GetSkipPayloadVerification_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipPayloadVerification_Call) RunAndReturn(run func() bool) *Context_GetSkipPayloadVerification_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipValidateRandao provides a mock function with given fields: +func (_m *Context) GetSkipValidateRandao() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipValidateRandao") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipValidateRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateRandao' +type Context_GetSkipValidateRandao_Call struct { + *mock.Call +} + +// GetSkipValidateRandao is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipValidateRandao() *Context_GetSkipValidateRandao_Call { + return &Context_GetSkipValidateRandao_Call{Call: _e.mock.On("GetSkipValidateRandao")} +} + +func (_c *Context_GetSkipValidateRandao_Call) Run(run func()) *Context_GetSkipValidateRandao_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipValidateRandao_Call) Return(_a0 bool) *Context_GetSkipValidateRandao_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipValidateRandao_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateRandao_Call { + _c.Call.Return(run) + return _c +} + +// GetSkipValidateResult provides a mock function with given fields: +func (_m *Context) GetSkipValidateResult() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSkipValidateResult") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Context_GetSkipValidateResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateResult' +type Context_GetSkipValidateResult_Call struct { + *mock.Call +} + +// GetSkipValidateResult is a helper method to define mock.On call +func (_e *Context_Expecter) GetSkipValidateResult() *Context_GetSkipValidateResult_Call { + return &Context_GetSkipValidateResult_Call{Call: _e.mock.On("GetSkipValidateResult")} +} + +func (_c *Context_GetSkipValidateResult_Call) Run(run func()) *Context_GetSkipValidateResult_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Context_GetSkipValidateResult_Call) Return(_a0 bool) *Context_GetSkipValidateResult_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_GetSkipValidateResult_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateResult_Call { + _c.Call.Return(run) + return _c +} + +// Value provides a mock function with given fields: key +func (_m *Context) Value(key any) any { + ret := _m.Called(key) + + if len(ret) == 0 { + panic("no return value specified for Value") + } + + var r0 any + if rf, ok := ret.Get(0).(func(any) any); ok { + r0 = rf(key) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(any) + } + } + + return r0 +} + +// Context_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' +type Context_Value_Call struct { + *mock.Call +} + +// Value is a helper method to define mock.On call +// - key any +func (_e *Context_Expecter) Value(key interface{}) *Context_Value_Call { + return &Context_Value_Call{Call: _e.mock.On("Value", key)} +} + +func (_c *Context_Value_Call) Run(run func(key any)) *Context_Value_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(any)) + }) + return _c +} + +func (_c *Context_Value_Call) Return(_a0 any) *Context_Value_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Context_Value_Call) RunAndReturn(run func(any) any) *Context_Value_Call { + _c.Call.Return(run) + return _c +} + +// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewContext(t interface { + mock.TestingT + Cleanup(func()) +}) *Context { + mock := &Context{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/deposit.mock.go b/mod/state-transition/pkg/core/mocks/deposit.mock.go new file mode 100644 index 0000000000..d424fc8c1d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/deposit.mock.go @@ -0,0 +1,225 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Deposit is an autogenerated mock type for the Deposit type +type Deposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + mock.Mock +} + +type Deposit_Expecter[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + mock *mock.Mock +} + +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) EXPECT() *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]{mock: &_m.Mock} +} + +// GetAmount provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetAmount() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAmount") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Deposit_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' +type Deposit_GetAmount_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetAmount is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetAmount() *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetAmount")} +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetPubkey provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetPubkey() crypto.BLSPubkey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPubkey") + } + + var r0 crypto.BLSPubkey + if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSPubkey) + } + } + + return r0 +} + +// Deposit_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' +type Deposit_GetPubkey_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetPubkey is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetPubkey() *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetPubkey")} +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawalCredentials provides a mock function with given fields: +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() WithdrawlCredentialsT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawalCredentials") + } + + var r0 WithdrawlCredentialsT + if rf, ok := ret.Get(0).(func() WithdrawlCredentialsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(WithdrawlCredentialsT) + } + + return r0 +} + +// Deposit_GetWithdrawalCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawalCredentials' +type Deposit_GetWithdrawalCredentials_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetWithdrawalCredentials is a helper method to define mock.On call +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetWithdrawalCredentials")} +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// VerifySignature provides a mock function with given fields: forkData, domainType, signatureVerificationFn +func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error { + ret := _m.Called(forkData, domainType, signatureVerificationFn) + + if len(ret) == 0 { + panic("no return value specified for VerifySignature") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error); ok { + r0 = rf(forkData, domainType, signatureVerificationFn) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Deposit_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type Deposit_VerifySignature_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// VerifySignature is a helper method to define mock.On call +// - forkData ForkDataT +// - domainType common.DomainType +// - signatureVerificationFn func(crypto.BLSPubkey , []byte , crypto.BLSSignature) error +func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData interface{}, domainType interface{}, signatureVerificationFn interface{}) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + return &Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("VerifySignature", forkData, domainType, signatureVerificationFn)} +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkDataT), args[1].(common.DomainType), args[2].(func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) + }) + return _c +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { + _c.Call.Return(run) + return _c +} + +// NewDeposit creates a new instance of Deposit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewDeposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }](t interface { + mock.TestingT + Cleanup(func()) +}) *Deposit[ForkDataT, WithdrawlCredentialsT] { + mock := &Deposit[ForkDataT, WithdrawlCredentialsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go new file mode 100644 index 0000000000..77baa04080 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -0,0 +1,86 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type +type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + mock.Mock +} + +type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + mock *mock.Mock +} + +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for VerifyAndNotifyNewPayload") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { + r0 = rf(ctx, req) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' +type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { + *mock.Call +} + +// VerifyAndNotifyNewPayload is a helper method to define mock.On call +// - ctx context.Context +// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] +func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) + }) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go new file mode 100644 index 0000000000..9f22de5ead --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go @@ -0,0 +1,1122 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionPayload is an autogenerated mock type for the ExecutionPayload type +type ExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + mock.Mock +} + +type ExecutionPayload_Expecter[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + mock *mock.Mock +} + +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// Empty provides a mock function with given fields: _a0 +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) ExecutionPayloadT { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Empty") + } + + var r0 ExecutionPayloadT + if rf, ok := ret.Get(0).(func(uint32) ExecutionPayloadT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ExecutionPayloadT) + } + + return r0 +} + +// ExecutionPayload_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' +type ExecutionPayload_Empty_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// Empty is a helper method to define mock.On call +// - _a0 uint32 +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint32)) + }) + return _c +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBaseFeePerGas provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *math.U256 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBaseFeePerGas") + } + + var r0 *math.U256 + if rf, ok := ret.Get(0).(func() *math.U256); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*math.U256) + } + } + + return r0 +} + +// ExecutionPayload_GetBaseFeePerGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBaseFeePerGas' +type ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBaseFeePerGas is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBaseFeePerGas")} +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlobGasUsed provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlobGasUsed") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetBlobGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobGasUsed' +type ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlobGasUsed is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobGasUsed")} +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetBlockHash provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlockHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayload_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' +type ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetBlockHash is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlockHash")} +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExcessBlobGas provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExcessBlobGas") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetExcessBlobGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExcessBlobGas' +type ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetExcessBlobGas is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExcessBlobGas")} +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetExtraData provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() []byte { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetExtraData") + } + + var r0 []byte + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + return r0 +} + +// ExecutionPayload_GetExtraData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExtraData' +type ExecutionPayload_GetExtraData_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetExtraData is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExtraData")} +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetFeeRecipient provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() common.ExecutionAddress { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFeeRecipient") + } + + var r0 common.ExecutionAddress + if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionAddress) + } + } + + return r0 +} + +// ExecutionPayload_GetFeeRecipient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeRecipient' +type ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetFeeRecipient is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetFeeRecipient")} +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetGasLimit provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasLimit") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetGasLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasLimit' +type ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetGasLimit is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasLimit")} +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetGasUsed provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGasUsed") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasUsed' +type ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetGasUsed is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasUsed")} +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetLogsBloom provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() bytes.B256 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogsBloom") + } + + var r0 bytes.B256 + if rf, ok := ret.Get(0).(func() bytes.B256); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(bytes.B256) + } + } + + return r0 +} + +// ExecutionPayload_GetLogsBloom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogsBloom' +type ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetLogsBloom is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetLogsBloom")} +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetNumber provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNumber") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNumber' +type ExecutionPayload_GetNumber_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetNumber is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetNumber")} +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetParentHash provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetParentHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayload_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' +type ExecutionPayload_GetParentHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetParentHash is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentHash")} +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetPrevRandao provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPrevRandao") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetPrevRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrevRandao' +type ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetPrevRandao is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetPrevRandao")} +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetReceiptsRoot provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetReceiptsRoot") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetReceiptsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReceiptsRoot' +type ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetReceiptsRoot is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetReceiptsRoot")} +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetStateRoot provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Bytes32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetStateRoot") + } + + var r0 common.Bytes32 + if rf, ok := ret.Get(0).(func() common.Bytes32); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + return r0 +} + +// ExecutionPayload_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' +type ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetStateRoot is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetTimestamp provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTimestamp") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// ExecutionPayload_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' +type ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetTimestamp is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTimestamp")} +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetTransactions provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() engineprimitives.Transactions { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTransactions") + } + + var r0 engineprimitives.Transactions + if rf, ok := ret.Get(0).(func() engineprimitives.Transactions); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(engineprimitives.Transactions) + } + } + + return r0 +} + +// ExecutionPayload_GetTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactions' +type ExecutionPayload_GetTransactions_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetTransactions is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTransactions")} +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawals provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() WithdrawalsT { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawals") + } + + var r0 WithdrawalsT + if rf, ok := ret.Get(0).(func() WithdrawalsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(WithdrawalsT) + } + + return r0 +} + +// ExecutionPayload_GetWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawals' +type ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// GetWithdrawals is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetWithdrawals")} +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// IsNil provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsNil") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// ExecutionPayload_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' +type ExecutionPayload_IsNil_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// IsNil is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// MarshalJSON provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() ([]byte, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MarshalJSON") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ExecutionPayload_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' +type ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// MarshalJSON is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("MarshalJSON")} +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte, _a1 error) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ([]byte, error)) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// ToHeader provides a mock function with given fields: maxWithdrawalsPerPayload, eth1ChainID +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload uint64, eth1ChainID uint64) (ExecutionPayloadHeaderT, error) { + ret := _m.Called(maxWithdrawalsPerPayload, eth1ChainID) + + if len(ret) == 0 { + panic("no return value specified for ToHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func(uint64, uint64) (ExecutionPayloadHeaderT, error)); ok { + return rf(maxWithdrawalsPerPayload, eth1ChainID) + } + if rf, ok := ret.Get(0).(func(uint64, uint64) ExecutionPayloadHeaderT); ok { + r0 = rf(maxWithdrawalsPerPayload, eth1ChainID) + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func(uint64, uint64) error); ok { + r1 = rf(maxWithdrawalsPerPayload, eth1ChainID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ExecutionPayload_ToHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToHeader' +type ExecutionPayload_ToHeader_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// ToHeader is a helper method to define mock.On call +// - maxWithdrawalsPerPayload uint64 +// - eth1ChainID uint64 +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload interface{}, eth1ChainID interface{}) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("ToHeader", maxWithdrawalsPerPayload, eth1ChainID)} +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(maxWithdrawalsPerPayload uint64, eth1ChainID uint64)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(uint64)) + }) + return _c +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint64, uint64) (ExecutionPayloadHeaderT, error)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// UnmarshalJSON provides a mock function with given fields: _a0 +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 []byte) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for UnmarshalJSON") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]byte) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionPayload_UnmarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalJSON' +type ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// UnmarshalJSON is a helper method to define mock.On call +// - _a0 []byte +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 interface{}) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("UnmarshalJSON", _a0)} +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 []byte)) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func([]byte) error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// Version provides a mock function with given fields: +func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Version") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// ExecutionPayload_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' +type ExecutionPayload_Version_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { + *mock.Call +} + +// Version is a helper method to define mock.On call +func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Version")} +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionPayload creates a new instance of ExecutionPayload. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go new file mode 100644 index 0000000000..eda051f23d --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionPayloadHeader is an autogenerated mock type for the ExecutionPayloadHeader type +type ExecutionPayloadHeader struct { + mock.Mock +} + +type ExecutionPayloadHeader_Expecter struct { + mock *mock.Mock +} + +func (_m *ExecutionPayloadHeader) EXPECT() *ExecutionPayloadHeader_Expecter { + return &ExecutionPayloadHeader_Expecter{mock: &_m.Mock} +} + +// GetBlockHash provides a mock function with given fields: +func (_m *ExecutionPayloadHeader) GetBlockHash() common.ExecutionHash { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBlockHash") + } + + var r0 common.ExecutionHash + if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionHash) + } + } + + return r0 +} + +// ExecutionPayloadHeader_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' +type ExecutionPayloadHeader_GetBlockHash_Call struct { + *mock.Call +} + +// GetBlockHash is a helper method to define mock.On call +func (_e *ExecutionPayloadHeader_Expecter) GetBlockHash() *ExecutionPayloadHeader_GetBlockHash_Call { + return &ExecutionPayloadHeader_GetBlockHash_Call{Call: _e.mock.On("GetBlockHash")} +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Run(run func()) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Return(_a0 common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionPayloadHeader_GetBlockHash_Call) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { + _c.Call.Return(run) + return _c +} + +// NewExecutionPayloadHeader creates a new instance of ExecutionPayloadHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionPayloadHeader(t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionPayloadHeader { + mock := &ExecutionPayloadHeader{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/fork_data.mock.go b/mod/state-transition/pkg/core/mocks/fork_data.mock.go new file mode 100644 index 0000000000..5b0d48628a --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/fork_data.mock.go @@ -0,0 +1,134 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ForkData is an autogenerated mock type for the ForkData type +type ForkData[ForkDataT any] struct { + mock.Mock +} + +type ForkData_Expecter[ForkDataT any] struct { + mock *mock.Mock +} + +func (_m *ForkData[ForkDataT]) EXPECT() *ForkData_Expecter[ForkDataT] { + return &ForkData_Expecter[ForkDataT]{mock: &_m.Mock} +} + +// ComputeRandaoSigningRoot provides a mock function with given fields: domainType, epoch +func (_m *ForkData[ForkDataT]) ComputeRandaoSigningRoot(domainType common.DomainType, epoch math.Epoch) common.Root { + ret := _m.Called(domainType, epoch) + + if len(ret) == 0 { + panic("no return value specified for ComputeRandaoSigningRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func(common.DomainType, math.Epoch) common.Root); ok { + r0 = rf(domainType, epoch) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// ForkData_ComputeRandaoSigningRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputeRandaoSigningRoot' +type ForkData_ComputeRandaoSigningRoot_Call[ForkDataT any] struct { + *mock.Call +} + +// ComputeRandaoSigningRoot is a helper method to define mock.On call +// - domainType common.DomainType +// - epoch math.Epoch +func (_e *ForkData_Expecter[ForkDataT]) ComputeRandaoSigningRoot(domainType interface{}, epoch interface{}) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + return &ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]{Call: _e.mock.On("ComputeRandaoSigningRoot", domainType, epoch)} +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Run(run func(domainType common.DomainType, epoch math.Epoch)) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.DomainType), args[1].(math.Epoch)) + }) + return _c +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Return(_a0 common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) RunAndReturn(run func(common.DomainType, math.Epoch) common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: _a0, _a1 +func (_m *ForkData[ForkDataT]) New(_a0 common.Version, _a1 common.Root) ForkDataT { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 ForkDataT + if rf, ok := ret.Get(0).(func(common.Version, common.Root) ForkDataT); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Get(0).(ForkDataT) + } + + return r0 +} + +// ForkData_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type ForkData_New_Call[ForkDataT any] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - _a0 common.Version +// - _a1 common.Root +func (_e *ForkData_Expecter[ForkDataT]) New(_a0 interface{}, _a1 interface{}) *ForkData_New_Call[ForkDataT] { + return &ForkData_New_Call[ForkDataT]{Call: _e.mock.On("New", _a0, _a1)} +} + +func (_c *ForkData_New_Call[ForkDataT]) Run(run func(_a0 common.Version, _a1 common.Root)) *ForkData_New_Call[ForkDataT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Version), args[1].(common.Root)) + }) + return _c +} + +func (_c *ForkData_New_Call[ForkDataT]) Return(_a0 ForkDataT) *ForkData_New_Call[ForkDataT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ForkData_New_Call[ForkDataT]) RunAndReturn(run func(common.Version, common.Root) ForkDataT) *ForkData_New_Call[ForkDataT] { + _c.Call.Return(run) + return _c +} + +// NewForkData creates a new instance of ForkData. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewForkData[ForkDataT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ForkData[ForkDataT] { + mock := &ForkData[ForkDataT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go new file mode 100644 index 0000000000..d008b496f2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go @@ -0,0 +1,1326 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyBeaconState is an autogenerated mock type for the ReadOnlyBeaconState type +type ReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock.Mock +} + +type ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBalance provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBalance") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' +type ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetBlockRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetBlockRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' +type ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1Data provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetFork provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetFork") + } + + var r0 ForkT + var r1 error + if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ForkT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ForkT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' +type ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetFork is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetGenesisValidatorsRoot provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetGenesisValidatorsRoot") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' +type ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetGenesisValidatorsRoot is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestBlockHeader provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestBlockHeader") + } + + var r0 BeaconBlockHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(BeaconBlockHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' +type ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestBlockHeader is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' +type ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetNextWithdrawalValidatorIndex provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetNextWithdrawalValidatorIndex") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' +type ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlashingAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetSlashingAtIndex") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' +type ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetSlot provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetSlot") + } + + var r0 math.Slot + var r1 error + if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Slot); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Slot) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' +type ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetSlot is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalActiveBalances provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetTotalActiveBalances") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' +type ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalActiveBalances is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalSlashing provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalSlashing") + } + + var r0 math.Gwei + var r1 error + if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' +type ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalSlashing is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetTotalValidators provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetTotalValidators") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' +type ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetTotalValidators is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidators provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidators") + } + + var r0 ValidatorsT + var r1 error + if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ValidatorsT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ValidatorsT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' +type ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidators is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorsByEffectiveBalance provides a mock function with given fields: +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorsByEffectiveBalance") + } + + var r0 []ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []ValidatorT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]ValidatorT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' +type ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorsByEffectiveBalance is a helper method to define mock.On call +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { + ret := _m.Called(cometBFTAddress) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByCometBFTAddress") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + return rf(cometBFTAddress) + } + if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + r0 = rf(cometBFTAddress) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func([]byte) error); ok { + r1 = rf(cometBFTAddress) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' +type ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call +// - cometBFTAddress []byte +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyBeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + return &ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyBeaconState creates a new instance of ReadOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { + mock := &ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go new file mode 100644 index 0000000000..1956f9c88f --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go @@ -0,0 +1,197 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// ReadOnlyEth1Data is an autogenerated mock type for the ReadOnlyEth1Data type +type ReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock.Mock +} + +type ReadOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} +} + +// GetEth1Data provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() (Eth1DataT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1Data") + } + + var r0 Eth1DataT + var r1 error + if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() Eth1DataT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(Eth1DataT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' +type ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetEth1Data is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1Data")} +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetEth1DepositIndex provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() (uint64, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEth1DepositIndex") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func() (uint64, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() uint64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' +type ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetEth1DepositIndex is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1DepositIndex")} +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 uint64, _a1 error) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// GetLatestExecutionPayloadHeader provides a mock function with given fields: +func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLatestExecutionPayloadHeader") + } + + var r0 ExecutionPayloadHeaderT + var r1 error + if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(ExecutionPayloadHeaderT) + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' +type ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// GetLatestExecutionPayloadHeader is a helper method to define mock.On call +func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyEth1Data creates a new instance of ReadOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { + mock := &ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go new file mode 100644 index 0000000000..099e28e5d2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go @@ -0,0 +1,94 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyRandaoMixes is an autogenerated mock type for the ReadOnlyRandaoMixes type +type ReadOnlyRandaoMixes struct { + mock.Mock +} + +type ReadOnlyRandaoMixes_Expecter struct { + mock *mock.Mock +} + +func (_m *ReadOnlyRandaoMixes) EXPECT() *ReadOnlyRandaoMixes_Expecter { + return &ReadOnlyRandaoMixes_Expecter{mock: &_m.Mock} +} + +// GetRandaoMixAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyRandaoMixes) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for GetRandaoMixAtIndex") + } + + var r0 common.Bytes32 + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Bytes32) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' +type ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call struct { + *mock.Call +} + +// GetRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyRandaoMixes_Expecter) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + return &ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyRandaoMixes creates a new instance of ReadOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyRandaoMixes(t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyRandaoMixes { + mock := &ReadOnlyRandaoMixes{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go new file mode 100644 index 0000000000..be45aad8a2 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go @@ -0,0 +1,94 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyStateRoots is an autogenerated mock type for the ReadOnlyStateRoots type +type ReadOnlyStateRoots struct { + mock.Mock +} + +type ReadOnlyStateRoots_Expecter struct { + mock *mock.Mock +} + +func (_m *ReadOnlyStateRoots) EXPECT() *ReadOnlyStateRoots_Expecter { + return &ReadOnlyStateRoots_Expecter{mock: &_m.Mock} +} + +// StateRootAtIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyStateRoots) StateRootAtIndex(_a0 uint64) (common.Root, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for StateRootAtIndex") + } + + var r0 common.Root + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyStateRoots_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' +type ReadOnlyStateRoots_StateRootAtIndex_Call struct { + *mock.Call +} + +// StateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *ReadOnlyStateRoots_Expecter) StateRootAtIndex(_a0 interface{}) *ReadOnlyStateRoots_StateRootAtIndex_Call { + return &ReadOnlyStateRoots_StateRootAtIndex_Call{Call: _e.mock.On("StateRootAtIndex", _a0)} +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Return(_a0 common.Root, _a1 error) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyStateRoots_StateRootAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyStateRoots creates a new instance of ReadOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyStateRoots(t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyStateRoots { + mock := &ReadOnlyStateRoots{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go new file mode 100644 index 0000000000..935e713699 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go @@ -0,0 +1,149 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// ReadOnlyValidators is an autogenerated mock type for the ReadOnlyValidators type +type ReadOnlyValidators[ValidatorT any] struct { + mock.Mock +} + +type ReadOnlyValidators_Expecter[ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyValidators[ValidatorT]) EXPECT() *ReadOnlyValidators_Expecter[ValidatorT] { + return &ReadOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} +} + +// ValidatorByIndex provides a mock function with given fields: _a0 +func (_m *ReadOnlyValidators[ValidatorT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorByIndex") + } + + var r0 ValidatorT + var r1 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyValidators_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' +type ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT any] struct { + *mock.Call +} + +// ValidatorByIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + return &ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]{Call: _e.mock.On("ValidatorByIndex", _a0)} +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// ValidatorIndexByPubkey provides a mock function with given fields: _a0 +func (_m *ReadOnlyValidators[ValidatorT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for ValidatorIndexByPubkey") + } + + var r0 math.ValidatorIndex + var r1 error + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + return rf(_a0) + } + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyValidators_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' +type ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT any] struct { + *mock.Call +} + +// ValidatorIndexByPubkey is a helper method to define mock.On call +// - _a0 crypto.BLSPubkey +func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + return &ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey)) + }) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyValidators creates a new instance of ReadOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyValidators[ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyValidators[ValidatorT] { + mock := &ReadOnlyValidators[ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go new file mode 100644 index 0000000000..82b8b930d6 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go @@ -0,0 +1,89 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// ReadOnlyWithdrawals is an autogenerated mock type for the ReadOnlyWithdrawals type +type ReadOnlyWithdrawals[WithdrawalT any] struct { + mock.Mock +} + +type ReadOnlyWithdrawals_Expecter[WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *ReadOnlyWithdrawals[WithdrawalT]) EXPECT() *ReadOnlyWithdrawals_Expecter[WithdrawalT] { + return &ReadOnlyWithdrawals_Expecter[WithdrawalT]{mock: &_m.Mock} +} + +// ExpectedWithdrawals provides a mock function with given fields: +func (_m *ReadOnlyWithdrawals[WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for ExpectedWithdrawals") + } + + var r0 []WithdrawalT + var r1 error + if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]WithdrawalT) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ReadOnlyWithdrawals_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' +type ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT any] struct { + *mock.Call +} + +// ExpectedWithdrawals is a helper method to define mock.On call +func (_e *ReadOnlyWithdrawals_Expecter[WithdrawalT]) ExpectedWithdrawals() *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + return &ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Run(run func()) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewReadOnlyWithdrawals creates a new instance of ReadOnlyWithdrawals. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewReadOnlyWithdrawals[WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *ReadOnlyWithdrawals[WithdrawalT] { + mock := &ReadOnlyWithdrawals[WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/validator.mock.go b/mod/state-transition/pkg/core/mocks/validator.mock.go new file mode 100644 index 0000000000..9245a3de7a --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/validator.mock.go @@ -0,0 +1,500 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Validator is an autogenerated mock type for the Validator type +type Validator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + mock.Mock +} + +type Validator_Expecter[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + mock *mock.Mock +} + +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) EXPECT() *Validator_Expecter[ValidatorT, WithdrawalCredentialsT] { + return &Validator_Expecter[ValidatorT, WithdrawalCredentialsT]{mock: &_m.Mock} +} + +// GetEffectiveBalance provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetEffectiveBalance") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Validator_GetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEffectiveBalance' +type Validator_GetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetEffectiveBalance is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetEffectiveBalance")} +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetPubkey provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetPubkey() crypto.BLSPubkey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetPubkey") + } + + var r0 crypto.BLSPubkey + if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.BLSPubkey) + } + } + + return r0 +} + +// Validator_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' +type Validator_GetPubkey_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetPubkey is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetPubkey() *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetPubkey")} +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// GetWithdrawableEpoch provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() math.Epoch { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetWithdrawableEpoch") + } + + var r0 math.Epoch + if rf, ok := ret.Get(0).(func() math.Epoch); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Epoch) + } + + return r0 +} + +// Validator_GetWithdrawableEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawableEpoch' +type Validator_GetWithdrawableEpoch_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// GetWithdrawableEpoch is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetWithdrawableEpoch")} +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// Validator_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type Validator_HashTreeRoot_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// IsSlashed provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) IsSlashed() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for IsSlashed") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Validator_IsSlashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSlashed' +type Validator_IsSlashed_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// IsSlashed is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) IsSlashed() *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("IsSlashed")} +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// MarshalSSZ provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() ([]byte, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for MarshalSSZ") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []byte); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Validator_MarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalSSZ' +type Validator_MarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// MarshalSSZ is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("MarshalSSZ")} +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 []byte, _a1 error) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() ([]byte, error)) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// New provides a mock function with given fields: pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) New(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei) ValidatorT { + ret := _m.Called(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) + + if len(ret) == 0 { + panic("no return value specified for New") + } + + var r0 ValidatorT + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT); ok { + r0 = rf(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) + } else { + r0 = ret.Get(0).(ValidatorT) + } + + return r0 +} + +// Validator_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' +type Validator_New_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// New is a helper method to define mock.On call +// - pubkey crypto.BLSPubkey +// - withdrawalCredentials WithdrawalCredentialsT +// - amount math.Gwei +// - effectiveBalanceIncrement math.Gwei +// - maxEffectiveBalance math.Gwei +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) New(pubkey interface{}, withdrawalCredentials interface{}, amount interface{}, effectiveBalanceIncrement interface{}, maxEffectiveBalance interface{}) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_New_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("New", pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance)} +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei)) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(crypto.BLSPubkey), args[1].(WithdrawalCredentialsT), args[2].(math.Gwei), args[3].(math.Gwei), args[4].(math.Gwei)) + }) + return _c +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// SetEffectiveBalance provides a mock function with given fields: _a0 +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 math.Gwei) { + _m.Called(_a0) +} + +// Validator_SetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEffectiveBalance' +type Validator_SetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// SetEffectiveBalance is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 interface{}) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SetEffectiveBalance", _a0)} +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return() *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return() + return _c +} + +func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// SizeSSZ provides a mock function with given fields: +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() uint32 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for SizeSSZ") + } + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +// Validator_SizeSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SizeSSZ' +type Validator_SizeSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// SizeSSZ is a helper method to define mock.On call +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SizeSSZ")} +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// UnmarshalSSZ provides a mock function with given fields: _a0 +func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 []byte) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for UnmarshalSSZ") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]byte) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Validator_UnmarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalSSZ' +type Validator_UnmarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { + *mock.Call +} + +// UnmarshalSSZ is a helper method to define mock.On call +// - _a0 []byte +func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 interface{}) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + return &Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("UnmarshalSSZ", _a0)} +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 []byte)) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func([]byte) error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { + _c.Call.Return(run) + return _c +} + +// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewValidator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }](t interface { + mock.TestingT + Cleanup(func()) +}) *Validator[ValidatorT, WithdrawalCredentialsT] { + mock := &Validator[ValidatorT, WithdrawalCredentialsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/validators.mock.go b/mod/state-transition/pkg/core/mocks/validators.mock.go new file mode 100644 index 0000000000..15a4fb46bc --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/validators.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// Validators is an autogenerated mock type for the Validators type +type Validators struct { + mock.Mock +} + +type Validators_Expecter struct { + mock *mock.Mock +} + +func (_m *Validators) EXPECT() *Validators_Expecter { + return &Validators_Expecter{mock: &_m.Mock} +} + +// HashTreeRoot provides a mock function with given fields: +func (_m *Validators) HashTreeRoot() common.Root { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for HashTreeRoot") + } + + var r0 common.Root + if rf, ok := ret.Get(0).(func() common.Root); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Root) + } + } + + return r0 +} + +// Validators_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' +type Validators_HashTreeRoot_Call struct { + *mock.Call +} + +// HashTreeRoot is a helper method to define mock.On call +func (_e *Validators_Expecter) HashTreeRoot() *Validators_HashTreeRoot_Call { + return &Validators_HashTreeRoot_Call{Call: _e.mock.On("HashTreeRoot")} +} + +func (_c *Validators_HashTreeRoot_Call) Run(run func()) *Validators_HashTreeRoot_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Validators_HashTreeRoot_Call) Return(_a0 common.Root) *Validators_HashTreeRoot_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Validators_HashTreeRoot_Call) RunAndReturn(run func() common.Root) *Validators_HashTreeRoot_Call { + _c.Call.Return(run) + return _c +} + +// NewValidators creates a new instance of Validators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewValidators(t interface { + mock.TestingT + Cleanup(func()) +}) *Validators { + mock := &Validators{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go new file mode 100644 index 0000000000..e76e91136f --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go @@ -0,0 +1,266 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// Withdrawal is an autogenerated mock type for the Withdrawal type +type Withdrawal[WithdrawalT any] struct { + mock.Mock +} + +type Withdrawal_Expecter[WithdrawalT any] struct { + mock *mock.Mock +} + +func (_m *Withdrawal[WithdrawalT]) EXPECT() *Withdrawal_Expecter[WithdrawalT] { + return &Withdrawal_Expecter[WithdrawalT]{mock: &_m.Mock} +} + +// Equals provides a mock function with given fields: _a0 +func (_m *Withdrawal[WithdrawalT]) Equals(_a0 WithdrawalT) bool { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Equals") + } + + var r0 bool + if rf, ok := ret.Get(0).(func(WithdrawalT) bool); ok { + r0 = rf(_a0) + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Withdrawal_Equals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equals' +type Withdrawal_Equals_Call[WithdrawalT any] struct { + *mock.Call +} + +// Equals is a helper method to define mock.On call +// - _a0 WithdrawalT +func (_e *Withdrawal_Expecter[WithdrawalT]) Equals(_a0 interface{}) *Withdrawal_Equals_Call[WithdrawalT] { + return &Withdrawal_Equals_Call[WithdrawalT]{Call: _e.mock.On("Equals", _a0)} +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) Run(run func(_a0 WithdrawalT)) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(WithdrawalT)) + }) + return _c +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) Return(_a0 bool) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_Equals_Call[WithdrawalT]) RunAndReturn(run func(WithdrawalT) bool) *Withdrawal_Equals_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetAddress provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetAddress() common.ExecutionAddress { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAddress") + } + + var r0 common.ExecutionAddress + if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.ExecutionAddress) + } + } + + return r0 +} + +// Withdrawal_GetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAddress' +type Withdrawal_GetAddress_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetAddress is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetAddress() *Withdrawal_GetAddress_Call[WithdrawalT] { + return &Withdrawal_GetAddress_Call[WithdrawalT]{Call: _e.mock.On("GetAddress")} +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Return(_a0 common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) RunAndReturn(run func() common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetAmount provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetAmount() math.Gwei { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAmount") + } + + var r0 math.Gwei + if rf, ok := ret.Get(0).(func() math.Gwei); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.Gwei) + } + + return r0 +} + +// Withdrawal_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' +type Withdrawal_GetAmount_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetAmount is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetAmount() *Withdrawal_GetAmount_Call[WithdrawalT] { + return &Withdrawal_GetAmount_Call[WithdrawalT]{Call: _e.mock.On("GetAmount")} +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Return(_a0 math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) RunAndReturn(run func() math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetIndex provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetIndex() math.U64 { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetIndex") + } + + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.U64) + } + + return r0 +} + +// Withdrawal_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex' +type Withdrawal_GetIndex_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetIndex is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetIndex() *Withdrawal_GetIndex_Call[WithdrawalT] { + return &Withdrawal_GetIndex_Call[WithdrawalT]{Call: _e.mock.On("GetIndex")} +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Return(_a0 math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) RunAndReturn(run func() math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// GetValidatorIndex provides a mock function with given fields: +func (_m *Withdrawal[WithdrawalT]) GetValidatorIndex() math.ValidatorIndex { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetValidatorIndex") + } + + var r0 math.ValidatorIndex + if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(math.ValidatorIndex) + } + + return r0 +} + +// Withdrawal_GetValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorIndex' +type Withdrawal_GetValidatorIndex_Call[WithdrawalT any] struct { + *mock.Call +} + +// GetValidatorIndex is a helper method to define mock.On call +func (_e *Withdrawal_Expecter[WithdrawalT]) GetValidatorIndex() *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + return &Withdrawal_GetValidatorIndex_Call[WithdrawalT]{Call: _e.mock.On("GetValidatorIndex")} +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Return(_a0 math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) RunAndReturn(run func() math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { + _c.Call.Return(run) + return _c +} + +// NewWithdrawal creates a new instance of Withdrawal. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWithdrawal[WithdrawalT any](t interface { + mock.TestingT + Cleanup(func()) +}) *Withdrawal[WithdrawalT] { + mock := &Withdrawal[WithdrawalT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go new file mode 100644 index 0000000000..291d70a837 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go @@ -0,0 +1,115 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + bytes "bytes" + + mock "github.com/stretchr/testify/mock" +) + +// WithdrawalsConstraint is an autogenerated mock type for the WithdrawalsConstraint type +type WithdrawalsConstraint struct { + mock.Mock +} + +type WithdrawalsConstraint_Expecter struct { + mock *mock.Mock +} + +func (_m *WithdrawalsConstraint) EXPECT() *WithdrawalsConstraint_Expecter { + return &WithdrawalsConstraint_Expecter{mock: &_m.Mock} +} + +// EncodeIndex provides a mock function with given fields: _a0, _a1 +func (_m *WithdrawalsConstraint) EncodeIndex(_a0 int, _a1 *bytes.Buffer) { + _m.Called(_a0, _a1) +} + +// WithdrawalsConstraint_EncodeIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeIndex' +type WithdrawalsConstraint_EncodeIndex_Call struct { + *mock.Call +} + +// EncodeIndex is a helper method to define mock.On call +// - _a0 int +// - _a1 *bytes.Buffer +func (_e *WithdrawalsConstraint_Expecter) EncodeIndex(_a0 interface{}, _a1 interface{}) *WithdrawalsConstraint_EncodeIndex_Call { + return &WithdrawalsConstraint_EncodeIndex_Call{Call: _e.mock.On("EncodeIndex", _a0, _a1)} +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) Run(run func(_a0 int, _a1 *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int), args[1].(*bytes.Buffer)) + }) + return _c +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) Return() *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Return() + return _c +} + +func (_c *WithdrawalsConstraint_EncodeIndex_Call) RunAndReturn(run func(int, *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { + _c.Call.Return(run) + return _c +} + +// Len provides a mock function with given fields: +func (_m *WithdrawalsConstraint) Len() int { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Len") + } + + var r0 int + if rf, ok := ret.Get(0).(func() int); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(int) + } + + return r0 +} + +// WithdrawalsConstraint_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' +type WithdrawalsConstraint_Len_Call struct { + *mock.Call +} + +// Len is a helper method to define mock.On call +func (_e *WithdrawalsConstraint_Expecter) Len() *WithdrawalsConstraint_Len_Call { + return &WithdrawalsConstraint_Len_Call{Call: _e.mock.On("Len")} +} + +func (_c *WithdrawalsConstraint_Len_Call) Run(run func()) *WithdrawalsConstraint_Len_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *WithdrawalsConstraint_Len_Call) Return(_a0 int) *WithdrawalsConstraint_Len_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WithdrawalsConstraint_Len_Call) RunAndReturn(run func() int) *WithdrawalsConstraint_Len_Call { + _c.Call.Return(run) + return _c +} + +// NewWithdrawalsConstraint creates a new instance of WithdrawalsConstraint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWithdrawalsConstraint(t interface { + mock.TestingT + Cleanup(func()) +}) *WithdrawalsConstraint { + mock := &WithdrawalsConstraint{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go new file mode 100644 index 0000000000..677433b90c --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go @@ -0,0 +1,919 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyBeaconState is an autogenerated mock type for the WriteOnlyBeaconState type +type WriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + mock.Mock +} + +type WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) EXPECT() *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// DecreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for DecreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' +type WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// DecreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// IncreaseBalance provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for IncreaseBalance") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' +type WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// IncreaseBalance is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 interface{}) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetFork provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 ForkT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetFork") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ForkT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' +type WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetFork is a helper method to define mock.On call +// - _a0 ForkT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 interface{}) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetFork", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ForkT)) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ForkT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ForkT) error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetGenesisValidatorsRoot provides a mock function with given fields: root +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root common.Root) error { + ret := _m.Called(root) + + if len(ret) == 0 { + panic("no return value specified for SetGenesisValidatorsRoot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(common.Root) error); ok { + r0 = rf(root) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' +type WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetGenesisValidatorsRoot is a helper method to define mock.On call +// - root common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root interface{}) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(root common.Root)) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(common.Root) error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetLatestBlockHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestBlockHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' +type WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetLatestBlockHeader is a helper method to define mock.On call +// - _a0 BeaconBlockHeaderT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 BeaconBlockHeaderT)) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(BeaconBlockHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' +type WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetNextWithdrawalIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetNextWithdrawalValidatorIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' +type WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetSlot provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 math.Slot) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetSlot") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' +type WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetSlot is a helper method to define mock.On call +// - _a0 math.Slot +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 interface{}) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetSlot", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Slot)) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Slot)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Slot) error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// SetTotalSlashing provides a mock function with given fields: _a0 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 math.Gwei) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetTotalSlashing") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' +type WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// SetTotalSlashing is a helper method to define mock.On call +// - _a0 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 interface{}) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetTotalSlashing", _a0)} +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Gwei)) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Gwei) error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateBlockRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' +type WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateBlockRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateSlashingAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' +type WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateSlashingAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 math.Gwei +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(math.Gwei)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, math.Gwei) error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyBeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + return &WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyBeaconState creates a new instance of WriteOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { + mock := &WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go new file mode 100644 index 0000000000..a6020ec38b --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go @@ -0,0 +1,170 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// WriteOnlyEth1Data is an autogenerated mock type for the WriteOnlyEth1Data type +type WriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock.Mock +} + +type WriteOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} +} + +// SetEth1Data provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 Eth1DataT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1Data") + } + + var r0 error + if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' +type WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetEth1Data is a helper method to define mock.On call +// - _a0 Eth1DataT +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 interface{}) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1Data", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(Eth1DataT)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetEth1DepositIndex provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 uint64) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetEth1DepositIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' +type WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetEth1DepositIndex is a helper method to define mock.On call +// - _a0 uint64 +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 uint64)) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(uint64) error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 +func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for SetLatestExecutionPayloadHeader") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' +type WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { + *mock.Call +} + +// SetLatestExecutionPayloadHeader is a helper method to define mock.On call +// - _a0 ExecutionPayloadHeaderT +func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + return &WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ExecutionPayloadHeaderT)) + }) + return _c +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyEth1Data creates a new instance of WriteOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { + mock := &WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go new file mode 100644 index 0000000000..6cd16f7b52 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyRandaoMixes is an autogenerated mock type for the WriteOnlyRandaoMixes type +type WriteOnlyRandaoMixes struct { + mock.Mock +} + +type WriteOnlyRandaoMixes_Expecter struct { + mock *mock.Mock +} + +func (_m *WriteOnlyRandaoMixes) EXPECT() *WriteOnlyRandaoMixes_Expecter { + return &WriteOnlyRandaoMixes_Expecter{mock: &_m.Mock} +} + +// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyRandaoMixes) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateRandaoMixAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' +type WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call struct { + *mock.Call +} + +// UpdateRandaoMixAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Bytes32 +func (_e *WriteOnlyRandaoMixes_Expecter) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + return &WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Bytes32)) + }) + return _c +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Return(_a0 error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyRandaoMixes creates a new instance of WriteOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyRandaoMixes(t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyRandaoMixes { + mock := &WriteOnlyRandaoMixes{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go new file mode 100644 index 0000000000..7349015317 --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go @@ -0,0 +1,83 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyStateRoots is an autogenerated mock type for the WriteOnlyStateRoots type +type WriteOnlyStateRoots struct { + mock.Mock +} + +type WriteOnlyStateRoots_Expecter struct { + mock *mock.Mock +} + +func (_m *WriteOnlyStateRoots) EXPECT() *WriteOnlyStateRoots_Expecter { + return &WriteOnlyStateRoots_Expecter{mock: &_m.Mock} +} + +// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyStateRoots) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateStateRootAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyStateRoots_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' +type WriteOnlyStateRoots_UpdateStateRootAtIndex_Call struct { + *mock.Call +} + +// UpdateStateRootAtIndex is a helper method to define mock.On call +// - _a0 uint64 +// - _a1 common.Root +func (_e *WriteOnlyStateRoots_Expecter) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + return &WriteOnlyStateRoots_UpdateStateRootAtIndex_Call{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(common.Root)) + }) + return _c +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Return(_a0 error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyStateRoots creates a new instance of WriteOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyStateRoots(t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyStateRoots { + mock := &WriteOnlyStateRoots{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go new file mode 100644 index 0000000000..3f4d7bfcac --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go @@ -0,0 +1,174 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" + mock "github.com/stretchr/testify/mock" +) + +// WriteOnlyValidators is an autogenerated mock type for the WriteOnlyValidators type +type WriteOnlyValidators[ValidatorT any] struct { + mock.Mock +} + +type WriteOnlyValidators_Expecter[ValidatorT any] struct { + mock *mock.Mock +} + +func (_m *WriteOnlyValidators[ValidatorT]) EXPECT() *WriteOnlyValidators_Expecter[ValidatorT] { + return &WriteOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} +} + +// AddValidator provides a mock function with given fields: _a0 +func (_m *WriteOnlyValidators[ValidatorT]) AddValidator(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidator") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' +type WriteOnlyValidators_AddValidator_Call[ValidatorT any] struct { + *mock.Call +} + +// AddValidator is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + return &WriteOnlyValidators_AddValidator_Call[ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// AddValidatorBartio provides a mock function with given fields: _a0 +func (_m *WriteOnlyValidators[ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for AddValidatorBartio") + } + + var r0 error + if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' +type WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT any] struct { + *mock.Call +} + +// AddValidatorBartio is a helper method to define mock.On call +// - _a0 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + return &WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 +func (_m *WriteOnlyValidators[ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for UpdateValidatorAtIndex") + } + + var r0 error + if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// WriteOnlyValidators_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' +type WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT any] struct { + *mock.Call +} + +// UpdateValidatorAtIndex is a helper method to define mock.On call +// - _a0 math.ValidatorIndex +// - _a1 ValidatorT +func (_e *WriteOnlyValidators_Expecter[ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + return &WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) + }) + return _c +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { + _c.Call.Return(run) + return _c +} + +// NewWriteOnlyValidators creates a new instance of WriteOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWriteOnlyValidators[ValidatorT any](t interface { + mock.TestingT + Cleanup(func()) +}) *WriteOnlyValidators[ValidatorT] { + mock := &WriteOnlyValidators[ValidatorT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index a37cca2a1e..354f0c723a 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,11 +28,12 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -79,8 +80,13 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := &testExecutionEngine{} - mocksSigner := &mocks.BLSSigner{} + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + + mocksSigner := &cryptomocks.Blssigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 5a359344d3..6edcb5a71b 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -173,15 +173,18 @@ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } +// WithdrawalsConstraint is the interface for withdrawals constraint. +type WithdrawalsConstraint interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) +} + // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) - }, + WithdrawalsT WithdrawalsConstraint, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. diff --git a/mod/storage/pkg/filedb/range_db_test.go b/mod/storage/pkg/filedb/range_db_test.go index 51334ce806..b0e33eddf2 100644 --- a/mod/storage/pkg/filedb/range_db_test.go +++ b/mod/storage/pkg/filedb/range_db_test.go @@ -197,11 +197,11 @@ func TestExtractIndex(t *testing.T) { func TestRangeDB_DeleteRange_NotSupported(t *testing.T) { tests := []struct { name string - db *mocks.DB + db *mocks.Db }{ { name: "DeleteRangeNotSupported", - db: new(mocks.DB), + db: new(mocks.Db), }, } diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index 97c0431b20..e076d6ed35 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -4,21 +4,21 @@ package mocks import mock "github.com/stretchr/testify/mock" -// DB is an autogenerated mock type for the DB type -type DB struct { +// Db is an autogenerated mock type for the DB type +type Db struct { mock.Mock } -type DB_Expecter struct { +type Db_Expecter struct { mock *mock.Mock } -func (_m *DB) EXPECT() *DB_Expecter { - return &DB_Expecter{mock: &_m.Mock} +func (_m *Db) EXPECT() *Db_Expecter { + return &Db_Expecter{mock: &_m.Mock} } // Delete provides a mock function with given fields: key -func (_m *DB) Delete(key []byte) error { +func (_m *Db) Delete(key []byte) error { ret := _m.Called(key) if len(ret) == 0 { @@ -35,36 +35,36 @@ func (_m *DB) Delete(key []byte) error { return r0 } -// DB_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type DB_Delete_Call struct { +// Db_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Db_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Delete(key interface{}) *DB_Delete_Call { - return &DB_Delete_Call{Call: _e.mock.On("Delete", key)} +func (_e *Db_Expecter) Delete(key interface{}) *Db_Delete_Call { + return &Db_Delete_Call{Call: _e.mock.On("Delete", key)} } -func (_c *DB_Delete_Call) Run(run func(key []byte)) *DB_Delete_Call { +func (_c *Db_Delete_Call) Run(run func(key []byte)) *Db_Delete_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Delete_Call) Return(_a0 error) *DB_Delete_Call { +func (_c *Db_Delete_Call) Return(_a0 error) *Db_Delete_Call { _c.Call.Return(_a0) return _c } -func (_c *DB_Delete_Call) RunAndReturn(run func([]byte) error) *DB_Delete_Call { +func (_c *Db_Delete_Call) RunAndReturn(run func([]byte) error) *Db_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function with given fields: key -func (_m *DB) Get(key []byte) ([]byte, error) { +func (_m *Db) Get(key []byte) ([]byte, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -93,36 +93,36 @@ func (_m *DB) Get(key []byte) ([]byte, error) { return r0, r1 } -// DB_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type DB_Get_Call struct { +// Db_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Db_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Get(key interface{}) *DB_Get_Call { - return &DB_Get_Call{Call: _e.mock.On("Get", key)} +func (_e *Db_Expecter) Get(key interface{}) *Db_Get_Call { + return &Db_Get_Call{Call: _e.mock.On("Get", key)} } -func (_c *DB_Get_Call) Run(run func(key []byte)) *DB_Get_Call { +func (_c *Db_Get_Call) Run(run func(key []byte)) *Db_Get_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Get_Call) Return(_a0 []byte, _a1 error) *DB_Get_Call { +func (_c *Db_Get_Call) Return(_a0 []byte, _a1 error) *Db_Get_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *DB_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *DB_Get_Call { +func (_c *Db_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *Db_Get_Call { _c.Call.Return(run) return _c } // Has provides a mock function with given fields: key -func (_m *DB) Has(key []byte) (bool, error) { +func (_m *Db) Has(key []byte) (bool, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -149,36 +149,36 @@ func (_m *DB) Has(key []byte) (bool, error) { return r0, r1 } -// DB_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' -type DB_Has_Call struct { +// Db_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type Db_Has_Call struct { *mock.Call } // Has is a helper method to define mock.On call // - key []byte -func (_e *DB_Expecter) Has(key interface{}) *DB_Has_Call { - return &DB_Has_Call{Call: _e.mock.On("Has", key)} +func (_e *Db_Expecter) Has(key interface{}) *Db_Has_Call { + return &Db_Has_Call{Call: _e.mock.On("Has", key)} } -func (_c *DB_Has_Call) Run(run func(key []byte)) *DB_Has_Call { +func (_c *Db_Has_Call) Run(run func(key []byte)) *Db_Has_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *DB_Has_Call) Return(_a0 bool, _a1 error) *DB_Has_Call { +func (_c *Db_Has_Call) Return(_a0 bool, _a1 error) *Db_Has_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *DB_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *DB_Has_Call { +func (_c *Db_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *Db_Has_Call { _c.Call.Return(run) return _c } // Set provides a mock function with given fields: key, value -func (_m *DB) Set(key []byte, value []byte) error { +func (_m *Db) Set(key []byte, value []byte) error { ret := _m.Called(key, value) if len(ret) == 0 { @@ -195,42 +195,42 @@ func (_m *DB) Set(key []byte, value []byte) error { return r0 } -// DB_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' -type DB_Set_Call struct { +// Db_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' +type Db_Set_Call struct { *mock.Call } // Set is a helper method to define mock.On call // - key []byte // - value []byte -func (_e *DB_Expecter) Set(key interface{}, value interface{}) *DB_Set_Call { - return &DB_Set_Call{Call: _e.mock.On("Set", key, value)} +func (_e *Db_Expecter) Set(key interface{}, value interface{}) *Db_Set_Call { + return &Db_Set_Call{Call: _e.mock.On("Set", key, value)} } -func (_c *DB_Set_Call) Run(run func(key []byte, value []byte)) *DB_Set_Call { +func (_c *Db_Set_Call) Run(run func(key []byte, value []byte)) *Db_Set_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte), args[1].([]byte)) }) return _c } -func (_c *DB_Set_Call) Return(_a0 error) *DB_Set_Call { +func (_c *Db_Set_Call) Return(_a0 error) *Db_Set_Call { _c.Call.Return(_a0) return _c } -func (_c *DB_Set_Call) RunAndReturn(run func([]byte, []byte) error) *DB_Set_Call { +func (_c *Db_Set_Call) RunAndReturn(run func([]byte, []byte) error) *Db_Set_Call { _c.Call.Return(run) return _c } -// NewDB creates a new instance of DB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewDb creates a new instance of Db. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewDB(t interface { +func NewDb(t interface { mock.TestingT Cleanup(func()) -}) *DB { - mock := &DB{} +}) *Db { + mock := &Db{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) From 151a53399057b7146a64c11c8709a199c04ee87e Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 13:21:08 +0530 Subject: [PATCH 09/77] Revert "tests for helpers in state transition using mock" This reverts commit 099716dbbf3b190b5622493a85a3279fd3b27821. --- .mockery.yaml | 5 - .../pkg/types/deposit_message_test.go | 2 +- .../mocks/blobs_bundle.mock.go | 13 +- .../mocks/built_execution_payload_env.mock.go | 16 +- .../backend/mocks/availability_store.mock.go | 24 +- .../backend/mocks/beacon_block_header.mock.go | 38 +- .../backend/mocks/beacon_state.mock.go | 164 +- .../backend/mocks/block_store.mock.go | 42 +- .../backend/mocks/state_processor.mock.go | 16 +- mod/node-api/backend/mocks/validator.mock.go | 28 +- mod/node-api/backend/mocks/withdrawal.mock.go | 14 +- .../pkg/crypto/mocks/bls_signer.mock.go | 66 +- mod/state-transition/pkg/core/helpers_test.go | 43 +- .../pkg/core/mocks/beacon_block.mock.go | 313 --- .../pkg/core/mocks/beacon_block_body.mock.go | 320 --- .../core/mocks/beacon_block_header.mock.go | 399 --- .../pkg/core/mocks/beacon_state.mock.go | 2395 ----------------- .../pkg/core/mocks/context.mock.go | 411 --- .../pkg/core/mocks/deposit.mock.go | 225 -- .../pkg/core/mocks/execution_engine.mock.go | 86 - .../pkg/core/mocks/execution_payload.mock.go | 1122 -------- .../mocks/execution_payload_header.mock.go | 83 - .../pkg/core/mocks/fork_data.mock.go | 134 - .../core/mocks/read_only_beacon_state.mock.go | 1326 --------- .../core/mocks/read_only_eth_1_data.mock.go | 197 -- .../core/mocks/read_only_randao_mixes.mock.go | 94 - .../core/mocks/read_only_state_roots.mock.go | 94 - .../core/mocks/read_only_validators.mock.go | 149 - .../core/mocks/read_only_withdrawals.mock.go | 89 - .../pkg/core/mocks/validator.mock.go | 500 ---- .../pkg/core/mocks/validators.mock.go | 83 - .../pkg/core/mocks/withdrawal.mock.go | 266 -- .../core/mocks/withdrawals_constraint.mock.go | 115 - .../mocks/write_only_beacon_state.mock.go | 919 ------- .../core/mocks/write_only_eth_1_data.mock.go | 170 -- .../mocks/write_only_randao_mixes.mock.go | 83 - .../core/mocks/write_only_state_roots.mock.go | 83 - .../core/mocks/write_only_validators.mock.go | 174 -- .../pkg/core/state_processor_genesis_test.go | 12 +- mod/state-transition/pkg/core/types.go | 11 +- mod/storage/pkg/filedb/range_db_test.go | 4 +- mod/storage/pkg/interfaces/mocks/db.mock.go | 82 +- 42 files changed, 272 insertions(+), 10138 deletions(-) delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/context.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/deposit.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_payload.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/fork_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_validators.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/validator.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/validators.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/withdrawal.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go delete mode 100644 mod/state-transition/pkg/core/mocks/write_only_validators.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index dbbc916112..6062236306 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,8 +68,3 @@ packages: recursive: False with-expecter: true all: True - github.com/berachain/beacon-kit/mod/state-transition/pkg/core: - config: - recursive: False - with-expecter: true - all: True diff --git a/mod/consensus-types/pkg/types/deposit_message_test.go b/mod/consensus-types/pkg/types/deposit_message_test.go index 02cd17ab7b..66e4f89a3d 100644 --- a/mod/consensus-types/pkg/types/deposit_message_test.go +++ b/mod/consensus-types/pkg/types/deposit_message_test.go @@ -44,7 +44,7 @@ func TestCreateAndSignDepositMessage(t *testing.T) { 0x01, 0x00, 0x00, 0x00, } - mocksSigner := &mocks.Blssigner{} + mocksSigner := &mocks.BLSSigner{} mocksSigner.On("PublicKey").Return(crypto.BLSPubkey{}) mocksSigner.On("Sign", mock.Anything).Return(crypto.BLSSignature{}, nil) diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go index 688aad3a39..94ad0fad6e 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go @@ -3,6 +3,7 @@ package mocks import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" mock "github.com/stretchr/testify/mock" @@ -116,19 +117,19 @@ func (_c *BlobsBundle_GetCommitments_Call) RunAndReturn(run func() []eip4844.KZG } // GetProofs provides a mock function with given fields: -func (_m *BlobsBundle) GetProofs() []eip4844.KZGProof { +func (_m *BlobsBundle) GetProofs() []bytes.B48 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProofs") } - var r0 []eip4844.KZGProof - if rf, ok := ret.Get(0).(func() []eip4844.KZGProof); ok { + var r0 []bytes.B48 + if rf, ok := ret.Get(0).(func() []bytes.B48); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]eip4844.KZGProof) + r0 = ret.Get(0).([]bytes.B48) } } @@ -152,12 +153,12 @@ func (_c *BlobsBundle_GetProofs_Call) Run(run func()) *BlobsBundle_GetProofs_Cal return _c } -func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) Return(_a0 []bytes.B48) *BlobsBundle_GetProofs_Call { _c.Call.Return(_a0) return _c } -func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []eip4844.KZGProof) *BlobsBundle_GetProofs_Call { +func (_c *BlobsBundle_GetProofs_Call) RunAndReturn(run func() []bytes.B48) *BlobsBundle_GetProofs_Call { _c.Call.Return(run) return _c } diff --git a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go index 01235c4ba2..0ec103484e 100644 --- a/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go +++ b/mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go @@ -4,9 +4,9 @@ package mocks import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - mock "github.com/stretchr/testify/mock" + + uint256 "github.com/holiman/uint256" ) // BuiltExecutionPayloadEnv is an autogenerated mock type for the BuiltExecutionPayloadEnv type @@ -115,19 +115,19 @@ func (_c *BuiltExecutionPayloadEnv_GetExecutionPayload_Call[ExecutionPayloadT]) } // GetValue provides a mock function with given fields: -func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *math.U256 { +func (_m *BuiltExecutionPayloadEnv[ExecutionPayloadT]) GetValue() *uint256.Int { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetValue") } - var r0 *math.U256 - if rf, ok := ret.Get(0).(func() *math.U256); ok { + var r0 *uint256.Int + if rf, ok := ret.Get(0).(func() *uint256.Int); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*math.U256) + r0 = ret.Get(0).(*uint256.Int) } } @@ -151,12 +151,12 @@ func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Run(run fun return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) Return(_a0 *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(_a0) return _c } -func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *math.U256) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { +func (_c *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT]) RunAndReturn(run func() *uint256.Int) *BuiltExecutionPayloadEnv_GetValue_Call[ExecutionPayloadT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/availability_store.mock.go b/mod/node-api/backend/mocks/availability_store.mock.go index 784cdda804..17d2d80e87 100644 --- a/mod/node-api/backend/mocks/availability_store.mock.go +++ b/mod/node-api/backend/mocks/availability_store.mock.go @@ -23,7 +23,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) EXPECT() *Availabi } // IsDataAvailable provides a mock function with given fields: _a0, _a1, _a2 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT) bool { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT) bool { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a } var r0 bool - if rf, ok := ret.Get(0).(func(context.Context, math.Slot, BeaconBlockBodyT) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, math.U64, BeaconBlockBodyT) bool); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(bool) @@ -47,15 +47,15 @@ type AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT any, BlobSidecarsT // IsDataAvailable is a helper method to define mock.On call // - _a0 context.Context -// - _a1 math.Slot +// - _a1 math.U64 // - _a2 BeaconBlockBodyT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) IsDataAvailable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("IsDataAvailable", _a0, _a1, _a2)} } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.Slot, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 context.Context, _a1 math.U64, _a2 BeaconBlockBodyT)) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(math.Slot), args[2].(BeaconBlockBodyT)) + run(args[0].(context.Context), args[1].(math.U64), args[2].(BeaconBlockBodyT)) }) return _c } @@ -65,13 +65,13 @@ func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT return _c } -func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.Slot, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(context.Context, math.U64, BeaconBlockBodyT) bool) *AvailabilityStore_IsDataAvailable_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } // Persist provides a mock function with given fields: _a0, _a1 -func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.Slot, _a1 BlobSidecarsT) error { +func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.U64, _a1 BlobSidecarsT) error { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -79,7 +79,7 @@ func (_m *AvailabilityStore[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 math.S } var r0 error - if rf, ok := ret.Get(0).(func(math.Slot, BlobSidecarsT) error); ok { + if rf, ok := ret.Get(0).(func(math.U64, BlobSidecarsT) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -94,15 +94,15 @@ type AvailabilityStore_Persist_Call[BeaconBlockBodyT any, BlobSidecarsT any] str } // Persist is a helper method to define mock.On call -// - _a0 math.Slot +// - _a0 math.U64 // - _a1 BlobSidecarsT func (_e *AvailabilityStore_Expecter[BeaconBlockBodyT, BlobSidecarsT]) Persist(_a0 interface{}, _a1 interface{}) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { return &AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]{Call: _e.mock.On("Persist", _a0, _a1)} } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.Slot, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Run(run func(_a0 math.U64, _a1 BlobSidecarsT)) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(BlobSidecarsT)) + run(args[0].(math.U64), args[1].(BlobSidecarsT)) }) return _c } @@ -112,7 +112,7 @@ func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) Retur return _c } -func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.Slot, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { +func (_c *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT]) RunAndReturn(run func(math.U64, BlobSidecarsT) error) *AvailabilityStore_Persist_Call[BeaconBlockBodyT, BlobSidecarsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_block_header.mock.go b/mod/node-api/backend/mocks/beacon_block_header.mock.go index 5e019b5821..c9d0cd0b6d 100644 --- a/mod/node-api/backend/mocks/beacon_block_header.mock.go +++ b/mod/node-api/backend/mocks/beacon_block_header.mock.go @@ -117,18 +117,18 @@ func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndR } // GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.U64 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetProposerIndex") } - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } return r0 @@ -151,29 +151,29 @@ func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run f return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.U64 { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { + var r0 math.U64 + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } return r0 @@ -196,12 +196,12 @@ func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *B return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(_a0) return _c } -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.U64) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } @@ -358,7 +358,7 @@ func (_c *BeaconBlockHeader_MarshalSSZ_Call[BeaconBlockHeaderT]) RunAndReturn(ru } // New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { +func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) if len(ret) == 0 { @@ -366,7 +366,7 @@ func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerInd } var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) } else { r0 = ret.Get(0).(BeaconBlockHeaderT) @@ -381,8 +381,8 @@ type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { } // New is a helper method to define mock.On call -// - slot math.Slot -// - proposerIndex math.ValidatorIndex +// - slot math.U64 +// - proposerIndex math.U64 // - parentBlockRoot common.Root // - stateRoot common.Root // - bodyRoot common.Root @@ -390,9 +390,9 @@ func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.U64, proposerIndex math.U64, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) + run(args[0].(math.U64), args[1].(math.U64), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) }) return _c } @@ -402,7 +402,7 @@ func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlock return _c } -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { +func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.U64, math.U64, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/beacon_state.mock.go b/mod/node-api/backend/mocks/beacon_state.mock.go index 1f9fdf1302..184d2d7024 100644 --- a/mod/node-api/backend/mocks/beacon_state.mock.go +++ b/mod/node-api/backend/mocks/beacon_state.mock.go @@ -3,7 +3,9 @@ package mocks import ( + bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -82,25 +84,25 @@ func (_c *BeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, Ex } // GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.U64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetBalance") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + if rf, ok := ret.Get(1).(func(math.U64) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -115,24 +117,24 @@ type BeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, Executio } // GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) + run(args[0].(math.U64)) }) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -583,22 +585,22 @@ func (_c *BeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, } // GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetNextWithdrawalValidatorIndex") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -627,34 +629,34 @@ func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (bytes.B32, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetRandaoMixAtIndex") } - var r0 common.Bytes32 + var r0 bytes.B32 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (bytes.B32, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { + if rf, ok := ret.Get(0).(func(uint64) bytes.B32); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) + r0 = ret.Get(0).(bytes.B32) } } @@ -685,33 +687,33 @@ func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Ex return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 bytes.B32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (bytes.B32, error)) *BeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetSlashingAtIndex") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -741,33 +743,33 @@ func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Exe return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetSlot provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetSlot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.Slot); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -796,33 +798,33 @@ func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for GetTotalActiveBalances") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func(uint64) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { + if rf, ok := ret.Get(0).(func(uint64) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(uint64) error); ok { @@ -852,33 +854,33 @@ func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.U64, error)) *BeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.U64, error) { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for GetTotalSlashing") } - var r0 math.Gwei + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { + if rf, ok := ret.Get(0).(func() (math.U64, error)); ok { return rf() } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { + if rf, ok := ret.Get(0).(func() math.U64); ok { r0 = rf() } else { - r0 = ret.Get(0).(math.Gwei) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func() error); ok { @@ -907,12 +909,12 @@ func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.U64, error)) *BeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1085,7 +1087,7 @@ func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, E } // SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.U64) error { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1093,7 +1095,7 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo } var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { + if rf, ok := ret.Get(0).(func(math.U64) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -1108,14 +1110,14 @@ type BeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPa } // SetSlot is a helper method to define mock.On call -// - _a0 math.Slot +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) + run(args[0].(math.U64)) }) return _c } @@ -1125,7 +1127,7 @@ func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPaylo return _c } -func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) error) *BeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } @@ -1189,7 +1191,7 @@ func (_c *BeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu } // ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.U64) (ValidatorT, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -1198,16 +1200,16 @@ func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, Fo var r0 ValidatorT var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (ValidatorT, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { + if rf, ok := ret.Get(0).(func(math.U64) ValidatorT); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(ValidatorT) } - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { + if rf, ok := ret.Get(1).(func(math.U64) error); ok { r1 = rf(_a0) } else { r1 = ret.Error(1) @@ -1222,14 +1224,14 @@ type BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, Ex } // ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex +// - _a0 math.U64 func (_e *BeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { return &BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.U64)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) + run(args[0].(math.U64)) }) return _c } @@ -1239,28 +1241,28 @@ func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, Execu return _c } -func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.U64) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.U64, error) { ret := _m.Called(cometBFTAddress) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByCometBFTAddress") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func([]byte) (math.U64, error)); ok { return rf(cometBFTAddress) } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func([]byte) math.U64); ok { r0 = rf(cometBFTAddress) } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func([]byte) error); ok { @@ -1290,33 +1292,33 @@ func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, E return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.U64, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } // ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { +func (_m *BeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.U64, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for ValidatorIndexByPubkey") } - var r0 math.ValidatorIndex + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.U64, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { + if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.U64); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(math.ValidatorIndex) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { @@ -1346,12 +1348,12 @@ func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.U64, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { +func (_c *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.U64, error)) *BeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/block_store.mock.go b/mod/node-api/backend/mocks/block_store.mock.go index 74f3b716a2..4e532a619f 100644 --- a/mod/node-api/backend/mocks/block_store.mock.go +++ b/mod/node-api/backend/mocks/block_store.mock.go @@ -23,22 +23,22 @@ func (_m *BlockStore[BeaconBlockT]) EXPECT() *BlockStore_Expecter[BeaconBlockT] } // GetParentSlotByTimestamp provides a mock function with given fields: timestamp -func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetParentSlotByTimestamp(timestamp math.U64) (math.U64, error) { ret := _m.Called(timestamp) if len(ret) == 0 { panic("no return value specified for GetParentSlotByTimestamp") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(math.U64) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(math.U64) (math.U64, error)); ok { return rf(timestamp) } - if rf, ok := ret.Get(0).(func(math.U64) math.Slot); ok { + if rf, ok := ret.Get(0).(func(math.U64) math.U64); ok { r0 = rf(timestamp) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(math.U64) error); ok { @@ -68,33 +68,33 @@ func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Run(run func(t return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.Slot, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { +func (_c *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT]) RunAndReturn(run func(math.U64) (math.U64, error)) *BlockStore_GetParentSlotByTimestamp_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByBlockRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByBlockRoot(root common.Root) (math.U64, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByBlockRoot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -124,33 +124,33 @@ func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByBlockRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } // GetSlotByStateRoot provides a mock function with given fields: root -func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.Slot, error) { +func (_m *BlockStore[BeaconBlockT]) GetSlotByStateRoot(root common.Root) (math.U64, error) { ret := _m.Called(root) if len(ret) == 0 { panic("no return value specified for GetSlotByStateRoot") } - var r0 math.Slot + var r0 math.U64 var r1 error - if rf, ok := ret.Get(0).(func(common.Root) (math.Slot, error)); ok { + if rf, ok := ret.Get(0).(func(common.Root) (math.U64, error)); ok { return rf(root) } - if rf, ok := ret.Get(0).(func(common.Root) math.Slot); ok { + if rf, ok := ret.Get(0).(func(common.Root) math.U64); ok { r0 = rf(root) } else { - r0 = ret.Get(0).(math.Slot) + r0 = ret.Get(0).(math.U64) } if rf, ok := ret.Get(1).(func(common.Root) error); ok { @@ -180,12 +180,12 @@ func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Run(run func(root co return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.Slot, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) Return(_a0 math.U64, _a1 error) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(_a0, _a1) return _c } -func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.Slot, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { +func (_c *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT]) RunAndReturn(run func(common.Root) (math.U64, error)) *BlockStore_GetSlotByStateRoot_Call[BeaconBlockT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/state_processor.mock.go b/mod/node-api/backend/mocks/state_processor.mock.go index 7dcf5f3002..a7103536ed 100644 --- a/mod/node-api/backend/mocks/state_processor.mock.go +++ b/mod/node-api/backend/mocks/state_processor.mock.go @@ -23,7 +23,7 @@ func (_m *StateProcessor[BeaconStateT]) EXPECT() *StateProcessor_Expecter[Beacon } // ProcessSlots provides a mock function with given fields: _a0, _a1 -func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.Slot) (transition.ValidatorUpdates, error) { +func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math.U64) (transition.ValidatorUpdates, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -32,10 +32,10 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. var r0 transition.ValidatorUpdates var r1 error - if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(BeaconStateT, math.Slot) transition.ValidatorUpdates); ok { + if rf, ok := ret.Get(0).(func(BeaconStateT, math.U64) transition.ValidatorUpdates); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -43,7 +43,7 @@ func (_m *StateProcessor[BeaconStateT]) ProcessSlots(_a0 BeaconStateT, _a1 math. } } - if rf, ok := ret.Get(1).(func(BeaconStateT, math.Slot) error); ok { + if rf, ok := ret.Get(1).(func(BeaconStateT, math.U64) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -59,14 +59,14 @@ type StateProcessor_ProcessSlots_Call[BeaconStateT any] struct { // ProcessSlots is a helper method to define mock.On call // - _a0 BeaconStateT -// - _a1 math.Slot +// - _a1 math.U64 func (_e *StateProcessor_Expecter[BeaconStateT]) ProcessSlots(_a0 interface{}, _a1 interface{}) *StateProcessor_ProcessSlots_Call[BeaconStateT] { return &StateProcessor_ProcessSlots_Call[BeaconStateT]{Call: _e.mock.On("ProcessSlots", _a0, _a1)} } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.Slot)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Run(run func(_a0 BeaconStateT, _a1 math.U64)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconStateT), args[1].(math.Slot)) + run(args[0].(BeaconStateT), args[1].(math.U64)) }) return _c } @@ -76,7 +76,7 @@ func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) Return(_a0 transition. return _c } -func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.Slot) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { +func (_c *StateProcessor_ProcessSlots_Call[BeaconStateT]) RunAndReturn(run func(BeaconStateT, math.U64) (transition.ValidatorUpdates, error)) *StateProcessor_ProcessSlots_Call[BeaconStateT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/validator.mock.go b/mod/node-api/backend/mocks/validator.mock.go index 655e2123b2..73404aa0d7 100644 --- a/mod/node-api/backend/mocks/validator.mock.go +++ b/mod/node-api/backend/mocks/validator.mock.go @@ -68,7 +68,7 @@ func (_c *Validator_GetWithdrawalCredentials_Call[WithdrawalCredentialsT]) RunAn } // IsFullyWithdrawable provides a mock function with given fields: amount, epoch -func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwei, epoch math.Epoch) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.U64, epoch math.U64) bool { ret := _m.Called(amount, epoch) if len(ret) == 0 { @@ -76,7 +76,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsFullyWithdrawable(amount math.Gwe } var r0 bool - if rf, ok := ret.Get(0).(func(math.Gwei, math.Epoch) bool); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { r0 = rf(amount, epoch) } else { r0 = ret.Get(0).(bool) @@ -91,15 +91,15 @@ type Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT backend.Withdrawa } // IsFullyWithdrawable is a helper method to define mock.On call -// - amount math.Gwei -// - epoch math.Epoch +// - amount math.U64 +// - epoch math.U64 func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsFullyWithdrawable(amount interface{}, epoch interface{}) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsFullyWithdrawable", amount, epoch)} } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.Gwei, epoch math.Epoch)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount math.U64, epoch math.U64)) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei), args[1].(math.Epoch)) + run(args[0].(math.U64), args[1].(math.U64)) }) return _c } @@ -109,13 +109,13 @@ func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) Return(_a0 return _c } -func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Epoch) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsFullyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } // IsPartiallyWithdrawable provides a mock function with given fields: amount1, amount2 -func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.Gwei, amount2 math.Gwei) bool { +func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 math.U64, amount2 math.U64) bool { ret := _m.Called(amount1, amount2) if len(ret) == 0 { @@ -123,7 +123,7 @@ func (_m *Validator[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 mat } var r0 bool - if rf, ok := ret.Get(0).(func(math.Gwei, math.Gwei) bool); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64) bool); ok { r0 = rf(amount1, amount2) } else { r0 = ret.Get(0).(bool) @@ -138,15 +138,15 @@ type Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT backend.Withd } // IsPartiallyWithdrawable is a helper method to define mock.On call -// - amount1 math.Gwei -// - amount2 math.Gwei +// - amount1 math.U64 +// - amount2 math.U64 func (_e *Validator_Expecter[WithdrawalCredentialsT]) IsPartiallyWithdrawable(amount1 interface{}, amount2 interface{}) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { return &Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]{Call: _e.mock.On("IsPartiallyWithdrawable", amount1, amount2)} } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.Gwei, amount2 math.Gwei)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Run(run func(amount1 math.U64, amount2 math.U64)) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei), args[1].(math.Gwei)) + run(args[0].(math.U64), args[1].(math.U64)) }) return _c } @@ -156,7 +156,7 @@ func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) Return return _c } -func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei, math.Gwei) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { +func (_c *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT]) RunAndReturn(run func(math.U64, math.U64) bool) *Validator_IsPartiallyWithdrawable_Call[WithdrawalCredentialsT] { _c.Call.Return(run) return _c } diff --git a/mod/node-api/backend/mocks/withdrawal.mock.go b/mod/node-api/backend/mocks/withdrawal.mock.go index 72fd41fa44..d7dbcb6747 100644 --- a/mod/node-api/backend/mocks/withdrawal.mock.go +++ b/mod/node-api/backend/mocks/withdrawal.mock.go @@ -23,7 +23,7 @@ func (_m *Withdrawal[T]) EXPECT() *Withdrawal_Expecter[T] { } // New provides a mock function with given fields: index, validator, address, amount -func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei) T { +func (_m *Withdrawal[T]) New(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64) T { ret := _m.Called(index, validator, address, amount) if len(ret) == 0 { @@ -31,7 +31,7 @@ func (_m *Withdrawal[T]) New(index math.U64, validator math.ValidatorIndex, addr } var r0 T - if rf, ok := ret.Get(0).(func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T); ok { + if rf, ok := ret.Get(0).(func(math.U64, math.U64, common.ExecutionAddress, math.U64) T); ok { r0 = rf(index, validator, address, amount) } else { r0 = ret.Get(0).(T) @@ -47,16 +47,16 @@ type Withdrawal_New_Call[T any] struct { // New is a helper method to define mock.On call // - index math.U64 -// - validator math.ValidatorIndex +// - validator math.U64 // - address common.ExecutionAddress -// - amount math.Gwei +// - amount math.U64 func (_e *Withdrawal_Expecter[T]) New(index interface{}, validator interface{}, address interface{}, amount interface{}) *Withdrawal_New_Call[T] { return &Withdrawal_New_Call[T]{Call: _e.mock.On("New", index, validator, address, amount)} } -func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.ValidatorIndex, address common.ExecutionAddress, amount math.Gwei)) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) Run(run func(index math.U64, validator math.U64, address common.ExecutionAddress, amount math.U64)) *Withdrawal_New_Call[T] { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.U64), args[1].(math.ValidatorIndex), args[2].(common.ExecutionAddress), args[3].(math.Gwei)) + run(args[0].(math.U64), args[1].(math.U64), args[2].(common.ExecutionAddress), args[3].(math.U64)) }) return _c } @@ -66,7 +66,7 @@ func (_c *Withdrawal_New_Call[T]) Return(_a0 T) *Withdrawal_New_Call[T] { return _c } -func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.ValidatorIndex, common.ExecutionAddress, math.Gwei) T) *Withdrawal_New_Call[T] { +func (_c *Withdrawal_New_Call[T]) RunAndReturn(run func(math.U64, math.U64, common.ExecutionAddress, math.U64) T) *Withdrawal_New_Call[T] { _c.Call.Return(run) return _c } diff --git a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go index a9e52cb133..4ea1d83c10 100644 --- a/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go +++ b/mod/primitives/pkg/crypto/mocks/bls_signer.mock.go @@ -7,21 +7,21 @@ import ( mock "github.com/stretchr/testify/mock" ) -// Blssigner is an autogenerated mock type for the BLSSigner type -type Blssigner struct { +// BLSSigner is an autogenerated mock type for the BLSSigner type +type BLSSigner struct { mock.Mock } -type Blssigner_Expecter struct { +type BLSSigner_Expecter struct { mock *mock.Mock } -func (_m *Blssigner) EXPECT() *Blssigner_Expecter { - return &Blssigner_Expecter{mock: &_m.Mock} +func (_m *BLSSigner) EXPECT() *BLSSigner_Expecter { + return &BLSSigner_Expecter{mock: &_m.Mock} } // PublicKey provides a mock function with given fields: -func (_m *Blssigner) PublicKey() crypto.BLSPubkey { +func (_m *BLSSigner) PublicKey() crypto.BLSPubkey { ret := _m.Called() if len(ret) == 0 { @@ -40,35 +40,35 @@ func (_m *Blssigner) PublicKey() crypto.BLSPubkey { return r0 } -// Blssigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' -type Blssigner_PublicKey_Call struct { +// BLSSigner_PublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublicKey' +type BLSSigner_PublicKey_Call struct { *mock.Call } // PublicKey is a helper method to define mock.On call -func (_e *Blssigner_Expecter) PublicKey() *Blssigner_PublicKey_Call { - return &Blssigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} +func (_e *BLSSigner_Expecter) PublicKey() *BLSSigner_PublicKey_Call { + return &BLSSigner_PublicKey_Call{Call: _e.mock.On("PublicKey")} } -func (_c *Blssigner_PublicKey_Call) Run(run func()) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) Run(run func()) *BLSSigner_PublicKey_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } -func (_c *Blssigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) Return(_a0 crypto.BLSPubkey) *BLSSigner_PublicKey_Call { _c.Call.Return(_a0) return _c } -func (_c *Blssigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *Blssigner_PublicKey_Call { +func (_c *BLSSigner_PublicKey_Call) RunAndReturn(run func() crypto.BLSPubkey) *BLSSigner_PublicKey_Call { _c.Call.Return(run) return _c } // Sign provides a mock function with given fields: _a0 -func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { +func (_m *BLSSigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { ret := _m.Called(_a0) if len(ret) == 0 { @@ -97,36 +97,36 @@ func (_m *Blssigner) Sign(_a0 []byte) (crypto.BLSSignature, error) { return r0, r1 } -// Blssigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' -type Blssigner_Sign_Call struct { +// BLSSigner_Sign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sign' +type BLSSigner_Sign_Call struct { *mock.Call } // Sign is a helper method to define mock.On call // - _a0 []byte -func (_e *Blssigner_Expecter) Sign(_a0 interface{}) *Blssigner_Sign_Call { - return &Blssigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} +func (_e *BLSSigner_Expecter) Sign(_a0 interface{}) *BLSSigner_Sign_Call { + return &BLSSigner_Sign_Call{Call: _e.mock.On("Sign", _a0)} } -func (_c *Blssigner_Sign_Call) Run(run func(_a0 []byte)) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) Run(run func(_a0 []byte)) *BLSSigner_Sign_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Blssigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) Return(_a0 crypto.BLSSignature, _a1 error) *BLSSigner_Sign_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Blssigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *Blssigner_Sign_Call { +func (_c *BLSSigner_Sign_Call) RunAndReturn(run func([]byte) (crypto.BLSSignature, error)) *BLSSigner_Sign_Call { _c.Call.Return(run) return _c } // VerifySignature provides a mock function with given fields: pubKey, msg, signature -func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { +func (_m *BLSSigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature) error { ret := _m.Called(pubKey, msg, signature) if len(ret) == 0 { @@ -143,8 +143,8 @@ func (_m *Blssigner) VerifySignature(pubKey crypto.BLSPubkey, msg []byte, signat return r0 } -// Blssigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type Blssigner_VerifySignature_Call struct { +// BLSSigner_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' +type BLSSigner_VerifySignature_Call struct { *mock.Call } @@ -152,34 +152,34 @@ type Blssigner_VerifySignature_Call struct { // - pubKey crypto.BLSPubkey // - msg []byte // - signature crypto.BLSSignature -func (_e *Blssigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *Blssigner_VerifySignature_Call { - return &Blssigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} +func (_e *BLSSigner_Expecter) VerifySignature(pubKey interface{}, msg interface{}, signature interface{}) *BLSSigner_VerifySignature_Call { + return &BLSSigner_VerifySignature_Call{Call: _e.mock.On("VerifySignature", pubKey, msg, signature)} } -func (_c *Blssigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) Run(run func(pubKey crypto.BLSPubkey, msg []byte, signature crypto.BLSSignature)) *BLSSigner_VerifySignature_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(crypto.BLSPubkey), args[1].([]byte), args[2].(crypto.BLSSignature)) }) return _c } -func (_c *Blssigner_VerifySignature_Call) Return(_a0 error) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) Return(_a0 error) *BLSSigner_VerifySignature_Call { _c.Call.Return(_a0) return _c } -func (_c *Blssigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *Blssigner_VerifySignature_Call { +func (_c *BLSSigner_VerifySignature_Call) RunAndReturn(run func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) *BLSSigner_VerifySignature_Call { _c.Call.Return(run) return _c } -// NewBlssigner creates a new instance of Blssigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewBLSSigner creates a new instance of BLSSigner. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewBlssigner(t interface { +func NewBLSSigner(t interface { mock.TestingT Cleanup(func()) -}) *Blssigner { - mock := &Blssigner{} +}) *BLSSigner { + mock := &BLSSigner{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index b982800a67..1631830784 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,7 +23,6 @@ package core_test import ( "context" "fmt" - "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -33,48 +32,24 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) -func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { - mockEngine := mocks.NewExecutionEngine[ +// TODO: replace with proper mock +type testExecutionEngine struct{} + +func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( + _ context.Context, + _ *engineprimitives.NewPayloadRequest[ *types.ExecutionPayload, - *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ](t) - - t.Run("successful verification with complete payload", func(t *testing.T) { - req := &engineprimitives.NewPayloadRequest[ - *types.ExecutionPayload, - engineprimitives.Withdrawals, - ]{ - ExecutionPayload: &types.ExecutionPayload{}, - VersionedHashes: []common.ExecutionHash{ - {0x1}, - {0x2}, - }, - ParentBeaconBlockRoot: &common.Root{0x3}, - Optimistic: false, - } - - // Set up expectation for successful verification - mockEngine.EXPECT(). - VerifyAndNotifyNewPayload( - context.Background(), - req, - ). - Return(nil) - - err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) - require.NoError(t, err) - }) + ], +) error { + return nil } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block.mock.go deleted file mode 100644 index 9b7182a9b9..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block.mock.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlock is an autogenerated mock type for the BeaconBlock type -type BeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock.Mock -} - -type BeaconBlock_Expecter[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// GetBody provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() BeaconBlockBodyT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBody") - } - - var r0 BeaconBlockBodyT - if rf, ok := ret.Get(0).(func() BeaconBlockBodyT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockBodyT) - } - - return r0 -} - -// BeaconBlock_GetBody_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBody' -type BeaconBlock_GetBody_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetBody is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBody() *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBody")} -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() BeaconBlockBodyT) *BeaconBlock_GetBody_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetParentBlockRoot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentBlockRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlock_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' -type BeaconBlock_GetParentBlockRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetParentBlockRoot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentBlockRoot() *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentBlockRoot")} -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetParentBlockRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetProposerIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// BeaconBlock_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' -type BeaconBlock_GetProposerIndex_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetProposerIndex is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetProposerIndex() *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetProposerIndex")} -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlock_GetProposerIndex_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() math.Slot { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - return r0 -} - -// BeaconBlock_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconBlock_GetSlot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetSlot() *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.Slot) *BeaconBlock_GetSlot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlock_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type BeaconBlock_GetStateRoot_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlock_GetStateRoot_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// IsNil provides a mock function with given fields: -func (_m *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsNil") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// BeaconBlock_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' -type BeaconBlock_IsNil_Call[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// IsNil is a helper method to define mock.On call -func (_e *BeaconBlock_Expecter[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *BeaconBlock_IsNil_Call[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlock creates a new instance of BeaconBlock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlock[DepositT any, BeaconBlockBodyT core.BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &BeaconBlock[DepositT, BeaconBlockBodyT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go deleted file mode 100644 index cc750bf211..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block_body.mock.go +++ /dev/null @@ -1,320 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - eip4844 "github.com/berachain/beacon-kit/mod/primitives/pkg/eip4844" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlockBody is an autogenerated mock type for the BeaconBlockBody type -type BeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock.Mock -} - -type BeaconBlockBody_Expecter[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// Empty provides a mock function with given fields: _a0 -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) BeaconBlockBodyT { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Empty") - } - - var r0 BeaconBlockBodyT - if rf, ok := ret.Get(0).(func(uint32) BeaconBlockBodyT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(BeaconBlockBodyT) - } - - return r0 -} - -// BeaconBlockBody_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' -type BeaconBlockBody_Empty_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// Empty is a helper method to define mock.On call -// - _a0 uint32 -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) - }) - return _c -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) BeaconBlockBodyT) *BeaconBlockBody_Empty_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlobKzgCommitments provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() eip4844.KZGCommitments[common.ExecutionHash] { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlobKzgCommitments") - } - - var r0 eip4844.KZGCommitments[common.ExecutionHash] - if rf, ok := ret.Get(0).(func() eip4844.KZGCommitments[common.ExecutionHash]); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(eip4844.KZGCommitments[common.ExecutionHash]) - } - } - - return r0 -} - -// BeaconBlockBody_GetBlobKzgCommitments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobKzgCommitments' -type BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlobKzgCommitments is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobKzgCommitments() *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobKzgCommitments")} -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() eip4844.KZGCommitments[common.ExecutionHash]) *BeaconBlockBody_GetBlobKzgCommitments_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetDeposits provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() []DepositT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetDeposits") - } - - var r0 []DepositT - if rf, ok := ret.Get(0).(func() []DepositT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]DepositT) - } - } - - return r0 -} - -// BeaconBlockBody_GetDeposits_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDeposits' -type BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetDeposits is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetDeposits() *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetDeposits")} -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []DepositT) *BeaconBlockBody_GetDeposits_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExecutionPayload provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() ExecutionPayloadT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExecutionPayload") - } - - var r0 ExecutionPayloadT - if rf, ok := ret.Get(0).(func() ExecutionPayloadT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadT) - } - - return r0 -} - -// BeaconBlockBody_GetExecutionPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionPayload' -type BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetExecutionPayload is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExecutionPayload() *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExecutionPayload")} -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ExecutionPayloadT) *BeaconBlockBody_GetExecutionPayload_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoReveal provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() crypto.BLSSignature { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetRandaoReveal") - } - - var r0 crypto.BLSSignature - if rf, ok := ret.Get(0).(func() crypto.BLSSignature); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSSignature) - } - } - - return r0 -} - -// BeaconBlockBody_GetRandaoReveal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoReveal' -type BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// GetRandaoReveal is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetRandaoReveal() *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetRandaoReveal")} -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() crypto.BLSSignature) *BeaconBlockBody_GetRandaoReveal_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockBody_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconBlockBody_Expecter[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) HashTreeRoot() *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Root) *BeaconBlockBody_HashTreeRoot_Call[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlockBody creates a new instance of BeaconBlockBody. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlockBody[BeaconBlockBodyT any, DepositT any, ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT core.ExecutionPayloadHeader, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &BeaconBlockBody[BeaconBlockBodyT, DepositT, ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go b/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go deleted file mode 100644 index e8353c6e6d..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_block_header.mock.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconBlockHeader is an autogenerated mock type for the BeaconBlockHeader type -type BeaconBlockHeader[BeaconBlockHeaderT any] struct { - mock.Mock -} - -type BeaconBlockHeader_Expecter[BeaconBlockHeaderT any] struct { - mock *mock.Mock -} - -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) EXPECT() *BeaconBlockHeader_Expecter[BeaconBlockHeaderT] { - return &BeaconBlockHeader_Expecter[BeaconBlockHeaderT]{mock: &_m.Mock} -} - -// GetBodyRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetBodyRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBodyRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetBodyRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBodyRoot' -type BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetBodyRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetBodyRoot() *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetBodyRoot")} -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetBodyRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetParentBlockRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetParentBlockRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentBlockRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetParentBlockRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentBlockRoot' -type BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetParentBlockRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetParentBlockRoot() *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetParentBlockRoot")} -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetParentBlockRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetProposerIndex provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetProposerIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetProposerIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// BeaconBlockHeader_GetProposerIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerIndex' -type BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetProposerIndex is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetProposerIndex() *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetProposerIndex")} -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) Return(_a0 math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.ValidatorIndex) *BeaconBlockHeader_GetProposerIndex_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetSlot() math.Slot { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - return r0 -} - -// BeaconBlockHeader_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetSlot() *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) Return(_a0 math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() math.Slot) *BeaconBlockHeader_GetSlot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) GetStateRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) GetStateRoot() *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_GetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconBlockHeader_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) HashTreeRoot() *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Run(run func()) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) Return(_a0 common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func() common.Root) *BeaconBlockHeader_HashTreeRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) New(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root) BeaconBlockHeaderT { - ret := _m.Called(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 BeaconBlockHeaderT - if rf, ok := ret.Get(0).(func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT); ok { - r0 = rf(slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot) - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - return r0 -} - -// BeaconBlockHeader_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type BeaconBlockHeader_New_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - slot math.Slot -// - proposerIndex math.ValidatorIndex -// - parentBlockRoot common.Root -// - stateRoot common.Root -// - bodyRoot common.Root -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) New(slot interface{}, proposerIndex interface{}, parentBlockRoot interface{}, stateRoot interface{}, bodyRoot interface{}) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_New_Call[BeaconBlockHeaderT]{Call: _e.mock.On("New", slot, proposerIndex, parentBlockRoot, stateRoot, bodyRoot)} -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Run(run func(slot math.Slot, proposerIndex math.ValidatorIndex, parentBlockRoot common.Root, stateRoot common.Root, bodyRoot common.Root)) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot), args[1].(math.ValidatorIndex), args[2].(common.Root), args[3].(common.Root), args[4].(common.Root)) - }) - return _c -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) Return(_a0 BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconBlockHeader_New_Call[BeaconBlockHeaderT]) RunAndReturn(run func(math.Slot, math.ValidatorIndex, common.Root, common.Root, common.Root) BeaconBlockHeaderT) *BeaconBlockHeader_New_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetStateRoot provides a mock function with given fields: _a0 -func (_m *BeaconBlockHeader[BeaconBlockHeaderT]) SetStateRoot(_a0 common.Root) { - _m.Called(_a0) -} - -// BeaconBlockHeader_SetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetStateRoot' -type BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT any] struct { - *mock.Call -} - -// SetStateRoot is a helper method to define mock.On call -// - _a0 common.Root -func (_e *BeaconBlockHeader_Expecter[BeaconBlockHeaderT]) SetStateRoot(_a0 interface{}) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - return &BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]{Call: _e.mock.On("SetStateRoot", _a0)} -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Run(run func(_a0 common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) Return() *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return() - return _c -} - -func (_c *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT]) RunAndReturn(run func(common.Root)) *BeaconBlockHeader_SetStateRoot_Call[BeaconBlockHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconBlockHeader creates a new instance of BeaconBlockHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconBlockHeader[BeaconBlockHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconBlockHeader[BeaconBlockHeaderT] { - mock := &BeaconBlockHeader[BeaconBlockHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/beacon_state.mock.go deleted file mode 100644 index c857192228..0000000000 --- a/mod/state-transition/pkg/core/mocks/beacon_state.mock.go +++ /dev/null @@ -1,2395 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// BeaconState is an autogenerated mock type for the BeaconState type -type BeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock.Mock -} - -type BeaconState_Expecter[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type BeaconState_AddValidator_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidator(_a0 interface{}) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidator_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type BeaconState_AddValidatorBartio_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) AddValidatorBartio(_a0 interface{}) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ValidatorT)) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ValidatorT) error) *BeaconState_AddValidatorBartio_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// Context provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() context.Context { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Context") - } - - var r0 context.Context - if rf, ok := ret.Get(0).(func() context.Context); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(context.Context) - } - } - - return r0 -} - -// BeaconState_Context_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Context' -type BeaconState_Context_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// Context is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Context() *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Context")} -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() context.Context) *BeaconState_Context_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// Copy provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() T { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Copy") - } - - var r0 T - if rf, ok := ret.Get(0).(func() T); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(T) - } - - return r0 -} - -// BeaconState_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' -type BeaconState_Copy_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// Copy is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Copy() *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("Copy")} -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() T) *BeaconState_Copy_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// DecreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for DecreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' -type BeaconState_DecreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// DecreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_DecreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type BeaconState_ExpectedWithdrawals_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *BeaconState_ExpectedWithdrawals_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBalance provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBalance") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' -type BeaconState_GetBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *BeaconState_GetBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBlockRootAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBlockRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' -type BeaconState_GetBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_GetBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1Data provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type BeaconState_GetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *BeaconState_GetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type BeaconState_GetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetFork provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFork") - } - - var r0 ForkT - var r1 error - if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ForkT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ForkT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' -type BeaconState_GetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetFork is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *BeaconState_GetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetGenesisValidatorsRoot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGenesisValidatorsRoot") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' -type BeaconState_GetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetGenesisValidatorsRoot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *BeaconState_GetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestBlockHeader provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestBlockHeader") - } - - var r0 BeaconBlockHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' -type BeaconState_GetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestBlockHeader is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *BeaconState_GetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type BeaconState_GetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *BeaconState_GetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' -type BeaconState_GetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalValidatorIndex") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' -type BeaconState_GetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *BeaconState_GetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type BeaconState_GetRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *BeaconState_GetRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetSlashingAtIndex") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' -type BeaconState_GetSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type BeaconState_GetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *BeaconState_GetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetTotalActiveBalances") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' -type BeaconState_GetTotalActiveBalances_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalActiveBalances is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *BeaconState_GetTotalActiveBalances_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalSlashing provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalSlashing") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' -type BeaconState_GetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalSlashing is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *BeaconState_GetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalValidators provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalValidators") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' -type BeaconState_GetTotalValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalValidators is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *BeaconState_GetTotalValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidators provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidators") - } - - var r0 ValidatorsT - var r1 error - if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ValidatorsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ValidatorsT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' -type BeaconState_GetValidators_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidators is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *BeaconState_GetValidators_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorsByEffectiveBalance provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorsByEffectiveBalance") - } - - var r0 []ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []ValidatorT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]ValidatorT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' -type BeaconState_GetValidatorsByEffectiveBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorsByEffectiveBalance is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *BeaconState_GetValidatorsByEffectiveBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// BeaconState_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type BeaconState_HashTreeRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) HashTreeRoot() *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() common.Root) *BeaconState_HashTreeRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// IncreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for IncreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' -type BeaconState_IncreaseBalance_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// IncreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *BeaconState_IncreaseBalance_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewFromDB provides a mock function with given fields: bdb, cs -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb KVStoreT, cs common.ChainSpec) T { - ret := _m.Called(bdb, cs) - - if len(ret) == 0 { - panic("no return value specified for NewFromDB") - } - - var r0 T - if rf, ok := ret.Get(0).(func(KVStoreT, common.ChainSpec) T); ok { - r0 = rf(bdb, cs) - } else { - r0 = ret.Get(0).(T) - } - - return r0 -} - -// BeaconState_NewFromDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewFromDB' -type BeaconState_NewFromDB_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// NewFromDB is a helper method to define mock.On call -// - bdb KVStoreT -// - cs common.ChainSpec -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) NewFromDB(bdb interface{}, cs interface{}) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("NewFromDB", bdb, cs)} -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(bdb KVStoreT, cs common.ChainSpec)) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(KVStoreT), args[1].(common.ChainSpec)) - }) - return _c -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(KVStoreT, common.ChainSpec) T) *BeaconState_NewFromDB_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type BeaconState_SetEth1Data_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1Data(_a0 interface{}) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 Eth1DataT)) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(Eth1DataT) error) *BeaconState_SetEth1Data_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type BeaconState_SetEth1DepositIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetEth1DepositIndex(_a0 interface{}) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetEth1DepositIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetFork provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 ForkT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetFork") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' -type BeaconState_SetFork_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetFork is a helper method to define mock.On call -// - _a0 ForkT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetFork(_a0 interface{}) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetFork", _a0)} -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ForkT)) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkT)) - }) - return _c -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ForkT) error) *BeaconState_SetFork_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetGenesisValidatorsRoot provides a mock function with given fields: root -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root common.Root) error { - ret := _m.Called(root) - - if len(ret) == 0 { - panic("no return value specified for SetGenesisValidatorsRoot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(common.Root) error); ok { - r0 = rf(root) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' -type BeaconState_SetGenesisValidatorsRoot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetGenesisValidatorsRoot is a helper method to define mock.On call -// - root common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetGenesisValidatorsRoot(root interface{}) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(root common.Root)) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(common.Root) error) *BeaconState_SetGenesisValidatorsRoot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetLatestBlockHeader provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestBlockHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' -type BeaconState_SetLatestBlockHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetLatestBlockHeader is a helper method to define mock.On call -// - _a0 BeaconBlockHeaderT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestBlockHeader(_a0 interface{}) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 BeaconBlockHeaderT)) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconBlockHeaderT)) - }) - return _c -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *BeaconState_SetLatestBlockHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type BeaconState_SetLatestExecutionPayloadHeader_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *BeaconState_SetLatestExecutionPayloadHeader_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' -type BeaconState_SetNextWithdrawalIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetNextWithdrawalIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) error) *BeaconState_SetNextWithdrawalIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalValidatorIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' -type BeaconState_SetNextWithdrawalValidatorIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) error) *BeaconState_SetNextWithdrawalValidatorIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetSlot provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 math.Slot) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetSlot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' -type BeaconState_SetSlot_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetSlot is a helper method to define mock.On call -// - _a0 math.Slot -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetSlot(_a0 interface{}) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetSlot", _a0)} -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Slot)) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) - }) - return _c -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Slot) error) *BeaconState_SetSlot_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// SetTotalSlashing provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 math.Gwei) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetTotalSlashing") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' -type BeaconState_SetTotalSlashing_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// SetTotalSlashing is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) SetTotalSlashing(_a0 interface{}) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("SetTotalSlashing", _a0)} -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.Gwei)) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.Gwei) error) *BeaconState_SetTotalSlashing_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type BeaconState_StateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *BeaconState_StateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateBlockRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' -type BeaconState_UpdateBlockRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateBlockRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type BeaconState_UpdateRandaoMixAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Bytes32) error) *BeaconState_UpdateRandaoMixAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateSlashingAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' -type BeaconState_UpdateSlashingAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 math.Gwei -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, math.Gwei) error) *BeaconState_UpdateSlashingAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type BeaconState_UpdateStateRootAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64, _a1 common.Root)) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64, common.Root) error) *BeaconState_UpdateStateRootAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// BeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type BeaconState_UpdateValidatorAtIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *BeaconState_UpdateValidatorAtIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type BeaconState_ValidatorByIndex_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *BeaconState_ValidatorByIndex_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { - ret := _m.Called(cometBFTAddress) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByCometBFTAddress") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { - return rf(cometBFTAddress) - } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { - r0 = rf(cometBFTAddress) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(cometBFTAddress) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' -type BeaconState_ValidatorIndexByCometBFTAddress_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call -// - cometBFTAddress []byte -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByCometBFTAddress_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type BeaconState_ValidatorIndexByPubkey_Call[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *BeaconState_Expecter[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - return &BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *BeaconState_ValidatorIndexByPubkey_Call[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewBeaconState creates a new instance of BeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBeaconState[T any, BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, KVStoreT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT] { - mock := &BeaconState[T, BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, KVStoreT, ValidatorT, ValidatorsT, WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/context.mock.go b/mod/state-transition/pkg/core/mocks/context.mock.go deleted file mode 100644 index 580f0c7713..0000000000 --- a/mod/state-transition/pkg/core/mocks/context.mock.go +++ /dev/null @@ -1,411 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - time "time" - - mock "github.com/stretchr/testify/mock" -) - -// Context is an autogenerated mock type for the Context type -type Context struct { - mock.Mock -} - -type Context_Expecter struct { - mock *mock.Mock -} - -func (_m *Context) EXPECT() *Context_Expecter { - return &Context_Expecter{mock: &_m.Mock} -} - -// Deadline provides a mock function with given fields: -func (_m *Context) Deadline() (time.Time, bool) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Deadline") - } - - var r0 time.Time - var r1 bool - if rf, ok := ret.Get(0).(func() (time.Time, bool)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() time.Time); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Time) - } - - if rf, ok := ret.Get(1).(func() bool); ok { - r1 = rf() - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - -// Context_Deadline_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deadline' -type Context_Deadline_Call struct { - *mock.Call -} - -// Deadline is a helper method to define mock.On call -func (_e *Context_Expecter) Deadline() *Context_Deadline_Call { - return &Context_Deadline_Call{Call: _e.mock.On("Deadline")} -} - -func (_c *Context_Deadline_Call) Run(run func()) *Context_Deadline_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Deadline_Call) Return(deadline time.Time, ok bool) *Context_Deadline_Call { - _c.Call.Return(deadline, ok) - return _c -} - -func (_c *Context_Deadline_Call) RunAndReturn(run func() (time.Time, bool)) *Context_Deadline_Call { - _c.Call.Return(run) - return _c -} - -// Done provides a mock function with given fields: -func (_m *Context) Done() <-chan struct{} { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Done") - } - - var r0 <-chan struct{} - if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan struct{}) - } - } - - return r0 -} - -// Context_Done_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Done' -type Context_Done_Call struct { - *mock.Call -} - -// Done is a helper method to define mock.On call -func (_e *Context_Expecter) Done() *Context_Done_Call { - return &Context_Done_Call{Call: _e.mock.On("Done")} -} - -func (_c *Context_Done_Call) Run(run func()) *Context_Done_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Done_Call) Return(_a0 <-chan struct{}) *Context_Done_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Done_Call) RunAndReturn(run func() <-chan struct{}) *Context_Done_Call { - _c.Call.Return(run) - return _c -} - -// Err provides a mock function with given fields: -func (_m *Context) Err() error { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Err") - } - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Context_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' -type Context_Err_Call struct { - *mock.Call -} - -// Err is a helper method to define mock.On call -func (_e *Context_Expecter) Err() *Context_Err_Call { - return &Context_Err_Call{Call: _e.mock.On("Err")} -} - -func (_c *Context_Err_Call) Run(run func()) *Context_Err_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_Err_Call) Return(_a0 error) *Context_Err_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Err_Call) RunAndReturn(run func() error) *Context_Err_Call { - _c.Call.Return(run) - return _c -} - -// GetOptimisticEngine provides a mock function with given fields: -func (_m *Context) GetOptimisticEngine() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetOptimisticEngine") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetOptimisticEngine_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOptimisticEngine' -type Context_GetOptimisticEngine_Call struct { - *mock.Call -} - -// GetOptimisticEngine is a helper method to define mock.On call -func (_e *Context_Expecter) GetOptimisticEngine() *Context_GetOptimisticEngine_Call { - return &Context_GetOptimisticEngine_Call{Call: _e.mock.On("GetOptimisticEngine")} -} - -func (_c *Context_GetOptimisticEngine_Call) Run(run func()) *Context_GetOptimisticEngine_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetOptimisticEngine_Call) Return(_a0 bool) *Context_GetOptimisticEngine_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetOptimisticEngine_Call) RunAndReturn(run func() bool) *Context_GetOptimisticEngine_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipPayloadVerification provides a mock function with given fields: -func (_m *Context) GetSkipPayloadVerification() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipPayloadVerification") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipPayloadVerification_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipPayloadVerification' -type Context_GetSkipPayloadVerification_Call struct { - *mock.Call -} - -// GetSkipPayloadVerification is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipPayloadVerification() *Context_GetSkipPayloadVerification_Call { - return &Context_GetSkipPayloadVerification_Call{Call: _e.mock.On("GetSkipPayloadVerification")} -} - -func (_c *Context_GetSkipPayloadVerification_Call) Run(run func()) *Context_GetSkipPayloadVerification_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipPayloadVerification_Call) Return(_a0 bool) *Context_GetSkipPayloadVerification_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipPayloadVerification_Call) RunAndReturn(run func() bool) *Context_GetSkipPayloadVerification_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipValidateRandao provides a mock function with given fields: -func (_m *Context) GetSkipValidateRandao() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipValidateRandao") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipValidateRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateRandao' -type Context_GetSkipValidateRandao_Call struct { - *mock.Call -} - -// GetSkipValidateRandao is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipValidateRandao() *Context_GetSkipValidateRandao_Call { - return &Context_GetSkipValidateRandao_Call{Call: _e.mock.On("GetSkipValidateRandao")} -} - -func (_c *Context_GetSkipValidateRandao_Call) Run(run func()) *Context_GetSkipValidateRandao_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipValidateRandao_Call) Return(_a0 bool) *Context_GetSkipValidateRandao_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipValidateRandao_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateRandao_Call { - _c.Call.Return(run) - return _c -} - -// GetSkipValidateResult provides a mock function with given fields: -func (_m *Context) GetSkipValidateResult() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSkipValidateResult") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Context_GetSkipValidateResult_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSkipValidateResult' -type Context_GetSkipValidateResult_Call struct { - *mock.Call -} - -// GetSkipValidateResult is a helper method to define mock.On call -func (_e *Context_Expecter) GetSkipValidateResult() *Context_GetSkipValidateResult_Call { - return &Context_GetSkipValidateResult_Call{Call: _e.mock.On("GetSkipValidateResult")} -} - -func (_c *Context_GetSkipValidateResult_Call) Run(run func()) *Context_GetSkipValidateResult_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Context_GetSkipValidateResult_Call) Return(_a0 bool) *Context_GetSkipValidateResult_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_GetSkipValidateResult_Call) RunAndReturn(run func() bool) *Context_GetSkipValidateResult_Call { - _c.Call.Return(run) - return _c -} - -// Value provides a mock function with given fields: key -func (_m *Context) Value(key any) any { - ret := _m.Called(key) - - if len(ret) == 0 { - panic("no return value specified for Value") - } - - var r0 any - if rf, ok := ret.Get(0).(func(any) any); ok { - r0 = rf(key) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(any) - } - } - - return r0 -} - -// Context_Value_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Value' -type Context_Value_Call struct { - *mock.Call -} - -// Value is a helper method to define mock.On call -// - key any -func (_e *Context_Expecter) Value(key interface{}) *Context_Value_Call { - return &Context_Value_Call{Call: _e.mock.On("Value", key)} -} - -func (_c *Context_Value_Call) Run(run func(key any)) *Context_Value_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(any)) - }) - return _c -} - -func (_c *Context_Value_Call) Return(_a0 any) *Context_Value_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Context_Value_Call) RunAndReturn(run func(any) any) *Context_Value_Call { - _c.Call.Return(run) - return _c -} - -// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewContext(t interface { - mock.TestingT - Cleanup(func()) -}) *Context { - mock := &Context{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/deposit.mock.go b/mod/state-transition/pkg/core/mocks/deposit.mock.go deleted file mode 100644 index d424fc8c1d..0000000000 --- a/mod/state-transition/pkg/core/mocks/deposit.mock.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Deposit is an autogenerated mock type for the Deposit type -type Deposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - mock.Mock -} - -type Deposit_Expecter[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - mock *mock.Mock -} - -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) EXPECT() *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]{mock: &_m.Mock} -} - -// GetAmount provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetAmount() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAmount") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Deposit_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' -type Deposit_GetAmount_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetAmount is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetAmount() *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetAmount")} -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() math.Gwei) *Deposit_GetAmount_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetPubkey provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetPubkey() crypto.BLSPubkey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPubkey") - } - - var r0 crypto.BLSPubkey - if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSPubkey) - } - } - - return r0 -} - -// Deposit_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' -type Deposit_GetPubkey_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetPubkey is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetPubkey() *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetPubkey")} -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Deposit_GetPubkey_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawalCredentials provides a mock function with given fields: -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() WithdrawlCredentialsT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawalCredentials") - } - - var r0 WithdrawlCredentialsT - if rf, ok := ret.Get(0).(func() WithdrawlCredentialsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(WithdrawlCredentialsT) - } - - return r0 -} - -// Deposit_GetWithdrawalCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawalCredentials' -type Deposit_GetWithdrawalCredentials_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetWithdrawalCredentials is a helper method to define mock.On call -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) GetWithdrawalCredentials() *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("GetWithdrawalCredentials")} -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func()) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func() WithdrawlCredentialsT) *Deposit_GetWithdrawalCredentials_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// VerifySignature provides a mock function with given fields: forkData, domainType, signatureVerificationFn -func (_m *Deposit[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error { - ret := _m.Called(forkData, domainType, signatureVerificationFn) - - if len(ret) == 0 { - panic("no return value specified for VerifySignature") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error); ok { - r0 = rf(forkData, domainType, signatureVerificationFn) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Deposit_VerifySignature_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifySignature' -type Deposit_VerifySignature_Call[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// VerifySignature is a helper method to define mock.On call -// - forkData ForkDataT -// - domainType common.DomainType -// - signatureVerificationFn func(crypto.BLSPubkey , []byte , crypto.BLSSignature) error -func (_e *Deposit_Expecter[ForkDataT, WithdrawlCredentialsT]) VerifySignature(forkData interface{}, domainType interface{}, signatureVerificationFn interface{}) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - return &Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]{Call: _e.mock.On("VerifySignature", forkData, domainType, signatureVerificationFn)} -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Run(run func(forkData ForkDataT, domainType common.DomainType, signatureVerificationFn func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkDataT), args[1].(common.DomainType), args[2].(func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error)) - }) - return _c -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) Return(_a0 error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT]) RunAndReturn(run func(ForkDataT, common.DomainType, func(crypto.BLSPubkey, []byte, crypto.BLSSignature) error) error) *Deposit_VerifySignature_Call[ForkDataT, WithdrawlCredentialsT] { - _c.Call.Return(run) - return _c -} - -// NewDeposit creates a new instance of Deposit. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewDeposit[ForkDataT any, WithdrawlCredentialsT interface{ ~[32]byte }](t interface { - mock.TestingT - Cleanup(func()) -}) *Deposit[ForkDataT, WithdrawlCredentialsT] { - mock := &Deposit[ForkDataT, WithdrawlCredentialsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go deleted file mode 100644 index 77baa04080..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - context "context" - - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type -type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - mock.Mock -} - -type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - mock *mock.Mock -} - -func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req -func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for VerifyAndNotifyNewPayload") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { - r0 = rf(ctx, req) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' -type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint] struct { - *mock.Call -} - -// VerifyAndNotifyNewPayload is a helper method to define mock.On call -// - ctx context.Context -// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] -func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) - }) - return _c -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.WithdrawalsConstraint](t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload.mock.go deleted file mode 100644 index 9f22de5ead..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_payload.mock.go +++ /dev/null @@ -1,1122 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - bytes "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionPayload is an autogenerated mock type for the ExecutionPayload type -type ExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - mock.Mock -} - -type ExecutionPayload_Expecter[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - mock *mock.Mock -} - -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} -} - -// Empty provides a mock function with given fields: _a0 -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 uint32) ExecutionPayloadT { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Empty") - } - - var r0 ExecutionPayloadT - if rf, ok := ret.Get(0).(func(uint32) ExecutionPayloadT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ExecutionPayloadT) - } - - return r0 -} - -// ExecutionPayload_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty' -type ExecutionPayload_Empty_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// Empty is a helper method to define mock.On call -// - _a0 uint32 -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Empty(_a0 interface{}) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Empty", _a0)} -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 uint32)) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint32)) - }) - return _c -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint32) ExecutionPayloadT) *ExecutionPayload_Empty_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBaseFeePerGas provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *math.U256 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBaseFeePerGas") - } - - var r0 *math.U256 - if rf, ok := ret.Get(0).(func() *math.U256); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*math.U256) - } - } - - return r0 -} - -// ExecutionPayload_GetBaseFeePerGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBaseFeePerGas' -type ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBaseFeePerGas is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBaseFeePerGas() *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBaseFeePerGas")} -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() *math.U256) *ExecutionPayload_GetBaseFeePerGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlobGasUsed provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlobGasUsed") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetBlobGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlobGasUsed' -type ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlobGasUsed is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlobGasUsed() *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlobGasUsed")} -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetBlobGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetBlockHash provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlockHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayload_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' -type ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetBlockHash is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetBlockHash() *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetBlockHash")} -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetBlockHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExcessBlobGas provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExcessBlobGas") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetExcessBlobGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExcessBlobGas' -type ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetExcessBlobGas is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExcessBlobGas() *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExcessBlobGas")} -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetExcessBlobGas_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetExtraData provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() []byte { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetExtraData") - } - - var r0 []byte - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - return r0 -} - -// ExecutionPayload_GetExtraData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExtraData' -type ExecutionPayload_GetExtraData_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetExtraData is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetExtraData() *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetExtraData")} -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() []byte) *ExecutionPayload_GetExtraData_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetFeeRecipient provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() common.ExecutionAddress { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFeeRecipient") - } - - var r0 common.ExecutionAddress - if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionAddress) - } - } - - return r0 -} - -// ExecutionPayload_GetFeeRecipient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFeeRecipient' -type ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetFeeRecipient is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetFeeRecipient() *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetFeeRecipient")} -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionAddress) *ExecutionPayload_GetFeeRecipient_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetGasLimit provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGasLimit") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetGasLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasLimit' -type ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetGasLimit is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasLimit() *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasLimit")} -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasLimit_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetGasUsed provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGasUsed") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetGasUsed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGasUsed' -type ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetGasUsed is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetGasUsed() *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetGasUsed")} -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetGasUsed_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetLogsBloom provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() bytes.B256 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLogsBloom") - } - - var r0 bytes.B256 - if rf, ok := ret.Get(0).(func() bytes.B256); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(bytes.B256) - } - } - - return r0 -} - -// ExecutionPayload_GetLogsBloom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogsBloom' -type ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetLogsBloom is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetLogsBloom() *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetLogsBloom")} -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bytes.B256) *ExecutionPayload_GetLogsBloom_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetNumber provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNumber") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNumber' -type ExecutionPayload_GetNumber_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetNumber is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetNumber() *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetNumber")} -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetNumber_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetParentHash provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetParentHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayload_GetParentHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentHash' -type ExecutionPayload_GetParentHash_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetParentHash is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetParentHash() *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetParentHash")} -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayload_GetParentHash_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetPrevRandao provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPrevRandao") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetPrevRandao_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrevRandao' -type ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetPrevRandao is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetPrevRandao() *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetPrevRandao")} -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetPrevRandao_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetReceiptsRoot provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetReceiptsRoot") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetReceiptsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetReceiptsRoot' -type ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetReceiptsRoot is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetReceiptsRoot() *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetReceiptsRoot")} -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetReceiptsRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetStateRoot provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() common.Bytes32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetStateRoot") - } - - var r0 common.Bytes32 - if rf, ok := ret.Get(0).(func() common.Bytes32); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - return r0 -} - -// ExecutionPayload_GetStateRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStateRoot' -type ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetStateRoot is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetStateRoot() *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetStateRoot")} -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() common.Bytes32) *ExecutionPayload_GetStateRoot_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetTimestamp provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTimestamp") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// ExecutionPayload_GetTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTimestamp' -type ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetTimestamp is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTimestamp() *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTimestamp")} -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() math.U64) *ExecutionPayload_GetTimestamp_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetTransactions provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() engineprimitives.Transactions { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTransactions") - } - - var r0 engineprimitives.Transactions - if rf, ok := ret.Get(0).(func() engineprimitives.Transactions); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(engineprimitives.Transactions) - } - } - - return r0 -} - -// ExecutionPayload_GetTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactions' -type ExecutionPayload_GetTransactions_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetTransactions is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetTransactions() *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetTransactions")} -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() engineprimitives.Transactions) *ExecutionPayload_GetTransactions_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawals provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() WithdrawalsT { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawals") - } - - var r0 WithdrawalsT - if rf, ok := ret.Get(0).(func() WithdrawalsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(WithdrawalsT) - } - - return r0 -} - -// ExecutionPayload_GetWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawals' -type ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// GetWithdrawals is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) GetWithdrawals() *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("GetWithdrawals")} -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() WithdrawalsT) *ExecutionPayload_GetWithdrawals_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// IsNil provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsNil") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// ExecutionPayload_IsNil_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNil' -type ExecutionPayload_IsNil_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// IsNil is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) IsNil() *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("IsNil")} -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() bool) *ExecutionPayload_IsNil_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// MarshalJSON provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() ([]byte, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MarshalJSON") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ExecutionPayload_MarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalJSON' -type ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// MarshalJSON is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) MarshalJSON() *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("MarshalJSON")} -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 []byte, _a1 error) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() ([]byte, error)) *ExecutionPayload_MarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// ToHeader provides a mock function with given fields: maxWithdrawalsPerPayload, eth1ChainID -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload uint64, eth1ChainID uint64) (ExecutionPayloadHeaderT, error) { - ret := _m.Called(maxWithdrawalsPerPayload, eth1ChainID) - - if len(ret) == 0 { - panic("no return value specified for ToHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func(uint64, uint64) (ExecutionPayloadHeaderT, error)); ok { - return rf(maxWithdrawalsPerPayload, eth1ChainID) - } - if rf, ok := ret.Get(0).(func(uint64, uint64) ExecutionPayloadHeaderT); ok { - r0 = rf(maxWithdrawalsPerPayload, eth1ChainID) - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func(uint64, uint64) error); ok { - r1 = rf(maxWithdrawalsPerPayload, eth1ChainID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ExecutionPayload_ToHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToHeader' -type ExecutionPayload_ToHeader_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// ToHeader is a helper method to define mock.On call -// - maxWithdrawalsPerPayload uint64 -// - eth1ChainID uint64 -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) ToHeader(maxWithdrawalsPerPayload interface{}, eth1ChainID interface{}) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("ToHeader", maxWithdrawalsPerPayload, eth1ChainID)} -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(maxWithdrawalsPerPayload uint64, eth1ChainID uint64)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(uint64)) - }) - return _c -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(uint64, uint64) (ExecutionPayloadHeaderT, error)) *ExecutionPayload_ToHeader_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// UnmarshalJSON provides a mock function with given fields: _a0 -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 []byte) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UnmarshalJSON") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ExecutionPayload_UnmarshalJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalJSON' -type ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// UnmarshalJSON is a helper method to define mock.On call -// - _a0 []byte -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) UnmarshalJSON(_a0 interface{}) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("UnmarshalJSON", _a0)} -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(_a0 []byte)) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func([]byte) error) *ExecutionPayload_UnmarshalJSON_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// Version provides a mock function with given fields: -func (_m *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Version") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// ExecutionPayload_Version_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Version' -type ExecutionPayload_Version_Call[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any] struct { - *mock.Call -} - -// Version is a helper method to define mock.On call -func (_e *ExecutionPayload_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Version() *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - return &ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("Version")} -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func()) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func() uint32) *ExecutionPayload_Version_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - _c.Call.Return(run) - return _c -} - -// NewExecutionPayload creates a new instance of ExecutionPayload. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionPayload[ExecutionPayloadT any, ExecutionPayloadHeaderT any, WithdrawalsT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { - mock := &ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go b/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go deleted file mode 100644 index eda051f23d..0000000000 --- a/mod/state-transition/pkg/core/mocks/execution_payload_header.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ExecutionPayloadHeader is an autogenerated mock type for the ExecutionPayloadHeader type -type ExecutionPayloadHeader struct { - mock.Mock -} - -type ExecutionPayloadHeader_Expecter struct { - mock *mock.Mock -} - -func (_m *ExecutionPayloadHeader) EXPECT() *ExecutionPayloadHeader_Expecter { - return &ExecutionPayloadHeader_Expecter{mock: &_m.Mock} -} - -// GetBlockHash provides a mock function with given fields: -func (_m *ExecutionPayloadHeader) GetBlockHash() common.ExecutionHash { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetBlockHash") - } - - var r0 common.ExecutionHash - if rf, ok := ret.Get(0).(func() common.ExecutionHash); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionHash) - } - } - - return r0 -} - -// ExecutionPayloadHeader_GetBlockHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHash' -type ExecutionPayloadHeader_GetBlockHash_Call struct { - *mock.Call -} - -// GetBlockHash is a helper method to define mock.On call -func (_e *ExecutionPayloadHeader_Expecter) GetBlockHash() *ExecutionPayloadHeader_GetBlockHash_Call { - return &ExecutionPayloadHeader_GetBlockHash_Call{Call: _e.mock.On("GetBlockHash")} -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Run(run func()) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) Return(_a0 common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionPayloadHeader_GetBlockHash_Call) RunAndReturn(run func() common.ExecutionHash) *ExecutionPayloadHeader_GetBlockHash_Call { - _c.Call.Return(run) - return _c -} - -// NewExecutionPayloadHeader creates a new instance of ExecutionPayloadHeader. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionPayloadHeader(t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionPayloadHeader { - mock := &ExecutionPayloadHeader{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/fork_data.mock.go b/mod/state-transition/pkg/core/mocks/fork_data.mock.go deleted file mode 100644 index 5b0d48628a..0000000000 --- a/mod/state-transition/pkg/core/mocks/fork_data.mock.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ForkData is an autogenerated mock type for the ForkData type -type ForkData[ForkDataT any] struct { - mock.Mock -} - -type ForkData_Expecter[ForkDataT any] struct { - mock *mock.Mock -} - -func (_m *ForkData[ForkDataT]) EXPECT() *ForkData_Expecter[ForkDataT] { - return &ForkData_Expecter[ForkDataT]{mock: &_m.Mock} -} - -// ComputeRandaoSigningRoot provides a mock function with given fields: domainType, epoch -func (_m *ForkData[ForkDataT]) ComputeRandaoSigningRoot(domainType common.DomainType, epoch math.Epoch) common.Root { - ret := _m.Called(domainType, epoch) - - if len(ret) == 0 { - panic("no return value specified for ComputeRandaoSigningRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func(common.DomainType, math.Epoch) common.Root); ok { - r0 = rf(domainType, epoch) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// ForkData_ComputeRandaoSigningRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ComputeRandaoSigningRoot' -type ForkData_ComputeRandaoSigningRoot_Call[ForkDataT any] struct { - *mock.Call -} - -// ComputeRandaoSigningRoot is a helper method to define mock.On call -// - domainType common.DomainType -// - epoch math.Epoch -func (_e *ForkData_Expecter[ForkDataT]) ComputeRandaoSigningRoot(domainType interface{}, epoch interface{}) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - return &ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]{Call: _e.mock.On("ComputeRandaoSigningRoot", domainType, epoch)} -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Run(run func(domainType common.DomainType, epoch math.Epoch)) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.DomainType), args[1].(math.Epoch)) - }) - return _c -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) Return(_a0 common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT]) RunAndReturn(run func(common.DomainType, math.Epoch) common.Root) *ForkData_ComputeRandaoSigningRoot_Call[ForkDataT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: _a0, _a1 -func (_m *ForkData[ForkDataT]) New(_a0 common.Version, _a1 common.Root) ForkDataT { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 ForkDataT - if rf, ok := ret.Get(0).(func(common.Version, common.Root) ForkDataT); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Get(0).(ForkDataT) - } - - return r0 -} - -// ForkData_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type ForkData_New_Call[ForkDataT any] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - _a0 common.Version -// - _a1 common.Root -func (_e *ForkData_Expecter[ForkDataT]) New(_a0 interface{}, _a1 interface{}) *ForkData_New_Call[ForkDataT] { - return &ForkData_New_Call[ForkDataT]{Call: _e.mock.On("New", _a0, _a1)} -} - -func (_c *ForkData_New_Call[ForkDataT]) Run(run func(_a0 common.Version, _a1 common.Root)) *ForkData_New_Call[ForkDataT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Version), args[1].(common.Root)) - }) - return _c -} - -func (_c *ForkData_New_Call[ForkDataT]) Return(_a0 ForkDataT) *ForkData_New_Call[ForkDataT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *ForkData_New_Call[ForkDataT]) RunAndReturn(run func(common.Version, common.Root) ForkDataT) *ForkData_New_Call[ForkDataT] { - _c.Call.Return(run) - return _c -} - -// NewForkData creates a new instance of ForkData. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewForkData[ForkDataT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ForkData[ForkDataT] { - mock := &ForkData[ForkDataT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go deleted file mode 100644 index d008b496f2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_beacon_state.mock.go +++ /dev/null @@ -1,1326 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyBeaconState is an autogenerated mock type for the ReadOnlyBeaconState type -type ReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock.Mock -} - -type ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) EXPECT() *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{mock: &_m.Mock} -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ExpectedWithdrawals() *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyBeaconState_ExpectedWithdrawals_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBalance provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 math.ValidatorIndex) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBalance") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBalance' -type ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBalance(_a0 interface{}) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBalance", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (math.Gwei, error)) *ReadOnlyBeaconState_GetBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetBlockRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetBlockRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockRootAtIndex' -type ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetBlockRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetBlockRootAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_GetBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1Data provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1Data() *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyBeaconState_GetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetEth1DepositIndex() *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetFork provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() (ForkT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetFork") - } - - var r0 ForkT - var r1 error - if rf, ok := ret.Get(0).(func() (ForkT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ForkT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ForkT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFork' -type ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetFork is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetFork() *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetFork")} -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ForkT, _a1 error) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ForkT, error)) *ReadOnlyBeaconState_GetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetGenesisValidatorsRoot provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() (common.Root, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetGenesisValidatorsRoot") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func() (common.Root, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGenesisValidatorsRoot' -type ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetGenesisValidatorsRoot is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetGenesisValidatorsRoot() *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetGenesisValidatorsRoot")} -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (common.Root, error)) *ReadOnlyBeaconState_GetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestBlockHeader provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() (BeaconBlockHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestBlockHeader") - } - - var r0 BeaconBlockHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (BeaconBlockHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() BeaconBlockHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(BeaconBlockHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestBlockHeader' -type ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestBlockHeader is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestBlockHeader() *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestBlockHeader")} -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 BeaconBlockHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (BeaconBlockHeaderT, error)) *ReadOnlyBeaconState_GetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetLatestExecutionPayloadHeader() *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyBeaconState_GetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalIndex' -type ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalIndex() *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalIndex")} -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetNextWithdrawalValidatorIndex provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() (math.ValidatorIndex, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetNextWithdrawalValidatorIndex") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func() (math.ValidatorIndex, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextWithdrawalValidatorIndex' -type ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetNextWithdrawalValidatorIndex is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetNextWithdrawalValidatorIndex() *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetNextWithdrawalValidatorIndex")} -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.ValidatorIndex, error)) *ReadOnlyBeaconState_GetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyBeaconState_GetRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlashingAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetSlashingAtIndex") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlashingAtIndex' -type ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlashingAtIndex(_a0 interface{}) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlashingAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetSlot provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() (math.Slot, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSlot") - } - - var r0 math.Slot - var r1 error - if rf, ok := ret.Get(0).(func() (math.Slot, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Slot); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Slot) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSlot' -type ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetSlot is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetSlot() *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetSlot")} -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Slot, _a1 error) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Slot, error)) *ReadOnlyBeaconState_GetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalActiveBalances provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 uint64) (math.Gwei, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetTotalActiveBalances") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (math.Gwei, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) math.Gwei); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalActiveBalances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalActiveBalances' -type ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalActiveBalances is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalActiveBalances(_a0 interface{}) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalActiveBalances", _a0)} -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalActiveBalances_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalSlashing provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() (math.Gwei, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalSlashing") - } - - var r0 math.Gwei - var r1 error - if rf, ok := ret.Get(0).(func() (math.Gwei, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalSlashing' -type ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalSlashing is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalSlashing() *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalSlashing")} -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.Gwei, _a1 error) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (math.Gwei, error)) *ReadOnlyBeaconState_GetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetTotalValidators provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetTotalValidators") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetTotalValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTotalValidators' -type ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetTotalValidators is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetTotalValidators() *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetTotalValidators")} -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 uint64, _a1 error) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyBeaconState_GetTotalValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidators provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() (ValidatorsT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidators") - } - - var r0 ValidatorsT - var r1 error - if rf, ok := ret.Get(0).(func() (ValidatorsT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ValidatorsT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ValidatorsT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidators' -type ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidators is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidators() *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidators")} -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorsT, _a1 error) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() (ValidatorsT, error)) *ReadOnlyBeaconState_GetValidators_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorsByEffectiveBalance provides a mock function with given fields: -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() ([]ValidatorT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorsByEffectiveBalance") - } - - var r0 []ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func() ([]ValidatorT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []ValidatorT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]ValidatorT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorsByEffectiveBalance' -type ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorsByEffectiveBalance is a helper method to define mock.On call -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) GetValidatorsByEffectiveBalance() *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("GetValidatorsByEffectiveBalance")} -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func()) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 []ValidatorT, _a1 error) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func() ([]ValidatorT, error)) *ReadOnlyBeaconState_GetValidatorsByEffectiveBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) StateRootAtIndex(_a0 interface{}) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 uint64)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 common.Root, _a1 error) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyBeaconState_StateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyBeaconState_ValidatorByIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByCometBFTAddress provides a mock function with given fields: cometBFTAddress -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress []byte) (math.ValidatorIndex, error) { - ret := _m.Called(cometBFTAddress) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByCometBFTAddress") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func([]byte) (math.ValidatorIndex, error)); ok { - return rf(cometBFTAddress) - } - if rf, ok := ret.Get(0).(func([]byte) math.ValidatorIndex); ok { - r0 = rf(cometBFTAddress) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(cometBFTAddress) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByCometBFTAddress' -type ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByCometBFTAddress is a helper method to define mock.On call -// - cometBFTAddress []byte -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByCometBFTAddress(cometBFTAddress interface{}) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByCometBFTAddress", cometBFTAddress)} -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(cometBFTAddress []byte)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func([]byte) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByCometBFTAddress_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyBeaconState_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *ReadOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - return &ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyBeaconState_ValidatorIndexByPubkey_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyBeaconState creates a new instance of ReadOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any, ValidatorsT any, WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT] { - mock := &ReadOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT, ValidatorsT, WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go deleted file mode 100644 index 1956f9c88f..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_eth_1_data.mock.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ReadOnlyEth1Data is an autogenerated mock type for the ReadOnlyEth1Data type -type ReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock.Mock -} - -type ReadOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} -} - -// GetEth1Data provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() (Eth1DataT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1Data") - } - - var r0 Eth1DataT - var r1 error - if rf, ok := ret.Get(0).(func() (Eth1DataT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() Eth1DataT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(Eth1DataT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1Data' -type ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetEth1Data is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1Data() *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1Data")} -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 Eth1DataT, _a1 error) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (Eth1DataT, error)) *ReadOnlyEth1Data_GetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetEth1DepositIndex provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() (uint64, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEth1DepositIndex") - } - - var r0 uint64 - var r1 error - if rf, ok := ret.Get(0).(func() (uint64, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() uint64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint64) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEth1DepositIndex' -type ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetEth1DepositIndex is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetEth1DepositIndex() *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetEth1DepositIndex")} -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 uint64, _a1 error) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (uint64, error)) *ReadOnlyEth1Data_GetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// GetLatestExecutionPayloadHeader provides a mock function with given fields: -func (_m *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() (ExecutionPayloadHeaderT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetLatestExecutionPayloadHeader") - } - - var r0 ExecutionPayloadHeaderT - var r1 error - if rf, ok := ret.Get(0).(func() (ExecutionPayloadHeaderT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() ExecutionPayloadHeaderT); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(ExecutionPayloadHeaderT) - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLatestExecutionPayloadHeader' -type ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// GetLatestExecutionPayloadHeader is a helper method to define mock.On call -func (_e *ReadOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) GetLatestExecutionPayloadHeader() *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("GetLatestExecutionPayloadHeader")} -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func()) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 ExecutionPayloadHeaderT, _a1 error) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func() (ExecutionPayloadHeaderT, error)) *ReadOnlyEth1Data_GetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyEth1Data creates a new instance of ReadOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { - mock := &ReadOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go deleted file mode 100644 index 099e28e5d2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_randao_mixes.mock.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyRandaoMixes is an autogenerated mock type for the ReadOnlyRandaoMixes type -type ReadOnlyRandaoMixes struct { - mock.Mock -} - -type ReadOnlyRandaoMixes_Expecter struct { - mock *mock.Mock -} - -func (_m *ReadOnlyRandaoMixes) EXPECT() *ReadOnlyRandaoMixes_Expecter { - return &ReadOnlyRandaoMixes_Expecter{mock: &_m.Mock} -} - -// GetRandaoMixAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyRandaoMixes) GetRandaoMixAtIndex(_a0 uint64) (common.Bytes32, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for GetRandaoMixAtIndex") - } - - var r0 common.Bytes32 - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Bytes32, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Bytes32); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Bytes32) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRandaoMixAtIndex' -type ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call struct { - *mock.Call -} - -// GetRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyRandaoMixes_Expecter) GetRandaoMixAtIndex(_a0 interface{}) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - return &ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call{Call: _e.mock.On("GetRandaoMixAtIndex", _a0)} -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) Return(_a0 common.Bytes32, _a1 error) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call) RunAndReturn(run func(uint64) (common.Bytes32, error)) *ReadOnlyRandaoMixes_GetRandaoMixAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyRandaoMixes creates a new instance of ReadOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyRandaoMixes(t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyRandaoMixes { - mock := &ReadOnlyRandaoMixes{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go deleted file mode 100644 index be45aad8a2..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_state_roots.mock.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyStateRoots is an autogenerated mock type for the ReadOnlyStateRoots type -type ReadOnlyStateRoots struct { - mock.Mock -} - -type ReadOnlyStateRoots_Expecter struct { - mock *mock.Mock -} - -func (_m *ReadOnlyStateRoots) EXPECT() *ReadOnlyStateRoots_Expecter { - return &ReadOnlyStateRoots_Expecter{mock: &_m.Mock} -} - -// StateRootAtIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyStateRoots) StateRootAtIndex(_a0 uint64) (common.Root, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for StateRootAtIndex") - } - - var r0 common.Root - var r1 error - if rf, ok := ret.Get(0).(func(uint64) (common.Root, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(uint64) common.Root); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyStateRoots_StateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateRootAtIndex' -type ReadOnlyStateRoots_StateRootAtIndex_Call struct { - *mock.Call -} - -// StateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *ReadOnlyStateRoots_Expecter) StateRootAtIndex(_a0 interface{}) *ReadOnlyStateRoots_StateRootAtIndex_Call { - return &ReadOnlyStateRoots_StateRootAtIndex_Call{Call: _e.mock.On("StateRootAtIndex", _a0)} -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Run(run func(_a0 uint64)) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) Return(_a0 common.Root, _a1 error) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyStateRoots_StateRootAtIndex_Call) RunAndReturn(run func(uint64) (common.Root, error)) *ReadOnlyStateRoots_StateRootAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyStateRoots creates a new instance of ReadOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyStateRoots(t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyStateRoots { - mock := &ReadOnlyStateRoots{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go deleted file mode 100644 index 935e713699..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_validators.mock.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// ReadOnlyValidators is an autogenerated mock type for the ReadOnlyValidators type -type ReadOnlyValidators[ValidatorT any] struct { - mock.Mock -} - -type ReadOnlyValidators_Expecter[ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyValidators[ValidatorT]) EXPECT() *ReadOnlyValidators_Expecter[ValidatorT] { - return &ReadOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} -} - -// ValidatorByIndex provides a mock function with given fields: _a0 -func (_m *ReadOnlyValidators[ValidatorT]) ValidatorByIndex(_a0 math.ValidatorIndex) (ValidatorT, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorByIndex") - } - - var r0 ValidatorT - var r1 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) (ValidatorT, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) ValidatorT); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - if rf, ok := ret.Get(1).(func(math.ValidatorIndex) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyValidators_ValidatorByIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorByIndex' -type ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT any] struct { - *mock.Call -} - -// ValidatorByIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorByIndex(_a0 interface{}) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - return &ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]{Call: _e.mock.On("ValidatorByIndex", _a0)} -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) Return(_a0 ValidatorT, _a1 error) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) (ValidatorT, error)) *ReadOnlyValidators_ValidatorByIndex_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// ValidatorIndexByPubkey provides a mock function with given fields: _a0 -func (_m *ReadOnlyValidators[ValidatorT]) ValidatorIndexByPubkey(_a0 crypto.BLSPubkey) (math.ValidatorIndex, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ValidatorIndexByPubkey") - } - - var r0 math.ValidatorIndex - var r1 error - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) (math.ValidatorIndex, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey) math.ValidatorIndex); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - if rf, ok := ret.Get(1).(func(crypto.BLSPubkey) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyValidators_ValidatorIndexByPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorIndexByPubkey' -type ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT any] struct { - *mock.Call -} - -// ValidatorIndexByPubkey is a helper method to define mock.On call -// - _a0 crypto.BLSPubkey -func (_e *ReadOnlyValidators_Expecter[ValidatorT]) ValidatorIndexByPubkey(_a0 interface{}) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - return &ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]{Call: _e.mock.On("ValidatorIndexByPubkey", _a0)} -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Run(run func(_a0 crypto.BLSPubkey)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey)) - }) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) Return(_a0 math.ValidatorIndex, _a1 error) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT]) RunAndReturn(run func(crypto.BLSPubkey) (math.ValidatorIndex, error)) *ReadOnlyValidators_ValidatorIndexByPubkey_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyValidators creates a new instance of ReadOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyValidators[ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyValidators[ValidatorT] { - mock := &ReadOnlyValidators[ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go b/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go deleted file mode 100644 index 82b8b930d6..0000000000 --- a/mod/state-transition/pkg/core/mocks/read_only_withdrawals.mock.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// ReadOnlyWithdrawals is an autogenerated mock type for the ReadOnlyWithdrawals type -type ReadOnlyWithdrawals[WithdrawalT any] struct { - mock.Mock -} - -type ReadOnlyWithdrawals_Expecter[WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *ReadOnlyWithdrawals[WithdrawalT]) EXPECT() *ReadOnlyWithdrawals_Expecter[WithdrawalT] { - return &ReadOnlyWithdrawals_Expecter[WithdrawalT]{mock: &_m.Mock} -} - -// ExpectedWithdrawals provides a mock function with given fields: -func (_m *ReadOnlyWithdrawals[WithdrawalT]) ExpectedWithdrawals() ([]WithdrawalT, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for ExpectedWithdrawals") - } - - var r0 []WithdrawalT - var r1 error - if rf, ok := ret.Get(0).(func() ([]WithdrawalT, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []WithdrawalT); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]WithdrawalT) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ReadOnlyWithdrawals_ExpectedWithdrawals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExpectedWithdrawals' -type ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT any] struct { - *mock.Call -} - -// ExpectedWithdrawals is a helper method to define mock.On call -func (_e *ReadOnlyWithdrawals_Expecter[WithdrawalT]) ExpectedWithdrawals() *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - return &ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]{Call: _e.mock.On("ExpectedWithdrawals")} -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Run(run func()) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) Return(_a0 []WithdrawalT, _a1 error) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT]) RunAndReturn(run func() ([]WithdrawalT, error)) *ReadOnlyWithdrawals_ExpectedWithdrawals_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewReadOnlyWithdrawals creates a new instance of ReadOnlyWithdrawals. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewReadOnlyWithdrawals[WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *ReadOnlyWithdrawals[WithdrawalT] { - mock := &ReadOnlyWithdrawals[WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/validator.mock.go b/mod/state-transition/pkg/core/mocks/validator.mock.go deleted file mode 100644 index 9245a3de7a..0000000000 --- a/mod/state-transition/pkg/core/mocks/validator.mock.go +++ /dev/null @@ -1,500 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - crypto "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Validator is an autogenerated mock type for the Validator type -type Validator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - mock.Mock -} - -type Validator_Expecter[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - mock *mock.Mock -} - -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) EXPECT() *Validator_Expecter[ValidatorT, WithdrawalCredentialsT] { - return &Validator_Expecter[ValidatorT, WithdrawalCredentialsT]{mock: &_m.Mock} -} - -// GetEffectiveBalance provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetEffectiveBalance") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Validator_GetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEffectiveBalance' -type Validator_GetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetEffectiveBalance is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetEffectiveBalance() *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetEffectiveBalance")} -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Gwei) *Validator_GetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetPubkey provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetPubkey() crypto.BLSPubkey { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetPubkey") - } - - var r0 crypto.BLSPubkey - if rf, ok := ret.Get(0).(func() crypto.BLSPubkey); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(crypto.BLSPubkey) - } - } - - return r0 -} - -// Validator_GetPubkey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubkey' -type Validator_GetPubkey_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetPubkey is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetPubkey() *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetPubkey")} -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() crypto.BLSPubkey) *Validator_GetPubkey_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// GetWithdrawableEpoch provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() math.Epoch { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetWithdrawableEpoch") - } - - var r0 math.Epoch - if rf, ok := ret.Get(0).(func() math.Epoch); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Epoch) - } - - return r0 -} - -// Validator_GetWithdrawableEpoch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWithdrawableEpoch' -type Validator_GetWithdrawableEpoch_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// GetWithdrawableEpoch is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) GetWithdrawableEpoch() *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("GetWithdrawableEpoch")} -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() math.Epoch) *Validator_GetWithdrawableEpoch_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// Validator_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type Validator_HashTreeRoot_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) HashTreeRoot() *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() common.Root) *Validator_HashTreeRoot_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// IsSlashed provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) IsSlashed() bool { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for IsSlashed") - } - - var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Validator_IsSlashed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsSlashed' -type Validator_IsSlashed_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// IsSlashed is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) IsSlashed() *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("IsSlashed")} -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() bool) *Validator_IsSlashed_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// MarshalSSZ provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() ([]byte, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for MarshalSSZ") - } - - var r0 []byte - var r1 error - if rf, ok := ret.Get(0).(func() ([]byte, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []byte); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]byte) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Validator_MarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarshalSSZ' -type Validator_MarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// MarshalSSZ is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) MarshalSSZ() *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("MarshalSSZ")} -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 []byte, _a1 error) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() ([]byte, error)) *Validator_MarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// New provides a mock function with given fields: pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) New(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei) ValidatorT { - ret := _m.Called(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) - - if len(ret) == 0 { - panic("no return value specified for New") - } - - var r0 ValidatorT - if rf, ok := ret.Get(0).(func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT); ok { - r0 = rf(pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance) - } else { - r0 = ret.Get(0).(ValidatorT) - } - - return r0 -} - -// Validator_New_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'New' -type Validator_New_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// New is a helper method to define mock.On call -// - pubkey crypto.BLSPubkey -// - withdrawalCredentials WithdrawalCredentialsT -// - amount math.Gwei -// - effectiveBalanceIncrement math.Gwei -// - maxEffectiveBalance math.Gwei -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) New(pubkey interface{}, withdrawalCredentials interface{}, amount interface{}, effectiveBalanceIncrement interface{}, maxEffectiveBalance interface{}) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_New_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("New", pubkey, withdrawalCredentials, amount, effectiveBalanceIncrement, maxEffectiveBalance)} -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(pubkey crypto.BLSPubkey, withdrawalCredentials WithdrawalCredentialsT, amount math.Gwei, effectiveBalanceIncrement math.Gwei, maxEffectiveBalance math.Gwei)) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(crypto.BLSPubkey), args[1].(WithdrawalCredentialsT), args[2].(math.Gwei), args[3].(math.Gwei), args[4].(math.Gwei)) - }) - return _c -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_New_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(crypto.BLSPubkey, WithdrawalCredentialsT, math.Gwei, math.Gwei, math.Gwei) ValidatorT) *Validator_New_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// SetEffectiveBalance provides a mock function with given fields: _a0 -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 math.Gwei) { - _m.Called(_a0) -} - -// Validator_SetEffectiveBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEffectiveBalance' -type Validator_SetEffectiveBalance_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// SetEffectiveBalance is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SetEffectiveBalance(_a0 interface{}) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SetEffectiveBalance", _a0)} -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) Return() *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return() - return _c -} - -func (_c *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func(math.Gwei)) *Validator_SetEffectiveBalance_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// SizeSSZ provides a mock function with given fields: -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() uint32 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for SizeSSZ") - } - - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(uint32) - } - - return r0 -} - -// Validator_SizeSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SizeSSZ' -type Validator_SizeSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// SizeSSZ is a helper method to define mock.On call -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) SizeSSZ() *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("SizeSSZ")} -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func()) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func() uint32) *Validator_SizeSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// UnmarshalSSZ provides a mock function with given fields: _a0 -func (_m *Validator[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 []byte) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for UnmarshalSSZ") - } - - var r0 error - if rf, ok := ret.Get(0).(func([]byte) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Validator_UnmarshalSSZ_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnmarshalSSZ' -type Validator_UnmarshalSSZ_Call[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }] struct { - *mock.Call -} - -// UnmarshalSSZ is a helper method to define mock.On call -// - _a0 []byte -func (_e *Validator_Expecter[ValidatorT, WithdrawalCredentialsT]) UnmarshalSSZ(_a0 interface{}) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - return &Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]{Call: _e.mock.On("UnmarshalSSZ", _a0)} -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Run(run func(_a0 []byte)) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].([]byte)) - }) - return _c -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) Return(_a0 error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT]) RunAndReturn(run func([]byte) error) *Validator_UnmarshalSSZ_Call[ValidatorT, WithdrawalCredentialsT] { - _c.Call.Return(run) - return _c -} - -// NewValidator creates a new instance of Validator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidator[ValidatorT any, WithdrawalCredentialsT interface{ ~[32]byte }](t interface { - mock.TestingT - Cleanup(func()) -}) *Validator[ValidatorT, WithdrawalCredentialsT] { - mock := &Validator[ValidatorT, WithdrawalCredentialsT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/validators.mock.go b/mod/state-transition/pkg/core/mocks/validators.mock.go deleted file mode 100644 index 15a4fb46bc..0000000000 --- a/mod/state-transition/pkg/core/mocks/validators.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// Validators is an autogenerated mock type for the Validators type -type Validators struct { - mock.Mock -} - -type Validators_Expecter struct { - mock *mock.Mock -} - -func (_m *Validators) EXPECT() *Validators_Expecter { - return &Validators_Expecter{mock: &_m.Mock} -} - -// HashTreeRoot provides a mock function with given fields: -func (_m *Validators) HashTreeRoot() common.Root { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for HashTreeRoot") - } - - var r0 common.Root - if rf, ok := ret.Get(0).(func() common.Root); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.Root) - } - } - - return r0 -} - -// Validators_HashTreeRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeRoot' -type Validators_HashTreeRoot_Call struct { - *mock.Call -} - -// HashTreeRoot is a helper method to define mock.On call -func (_e *Validators_Expecter) HashTreeRoot() *Validators_HashTreeRoot_Call { - return &Validators_HashTreeRoot_Call{Call: _e.mock.On("HashTreeRoot")} -} - -func (_c *Validators_HashTreeRoot_Call) Run(run func()) *Validators_HashTreeRoot_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Validators_HashTreeRoot_Call) Return(_a0 common.Root) *Validators_HashTreeRoot_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *Validators_HashTreeRoot_Call) RunAndReturn(run func() common.Root) *Validators_HashTreeRoot_Call { - _c.Call.Return(run) - return _c -} - -// NewValidators creates a new instance of Validators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewValidators(t interface { - mock.TestingT - Cleanup(func()) -}) *Validators { - mock := &Validators{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go b/mod/state-transition/pkg/core/mocks/withdrawal.mock.go deleted file mode 100644 index e76e91136f..0000000000 --- a/mod/state-transition/pkg/core/mocks/withdrawal.mock.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// Withdrawal is an autogenerated mock type for the Withdrawal type -type Withdrawal[WithdrawalT any] struct { - mock.Mock -} - -type Withdrawal_Expecter[WithdrawalT any] struct { - mock *mock.Mock -} - -func (_m *Withdrawal[WithdrawalT]) EXPECT() *Withdrawal_Expecter[WithdrawalT] { - return &Withdrawal_Expecter[WithdrawalT]{mock: &_m.Mock} -} - -// Equals provides a mock function with given fields: _a0 -func (_m *Withdrawal[WithdrawalT]) Equals(_a0 WithdrawalT) bool { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Equals") - } - - var r0 bool - if rf, ok := ret.Get(0).(func(WithdrawalT) bool); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Withdrawal_Equals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Equals' -type Withdrawal_Equals_Call[WithdrawalT any] struct { - *mock.Call -} - -// Equals is a helper method to define mock.On call -// - _a0 WithdrawalT -func (_e *Withdrawal_Expecter[WithdrawalT]) Equals(_a0 interface{}) *Withdrawal_Equals_Call[WithdrawalT] { - return &Withdrawal_Equals_Call[WithdrawalT]{Call: _e.mock.On("Equals", _a0)} -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) Run(run func(_a0 WithdrawalT)) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(WithdrawalT)) - }) - return _c -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) Return(_a0 bool) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_Equals_Call[WithdrawalT]) RunAndReturn(run func(WithdrawalT) bool) *Withdrawal_Equals_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetAddress provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetAddress() common.ExecutionAddress { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAddress") - } - - var r0 common.ExecutionAddress - if rf, ok := ret.Get(0).(func() common.ExecutionAddress); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(common.ExecutionAddress) - } - } - - return r0 -} - -// Withdrawal_GetAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAddress' -type Withdrawal_GetAddress_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetAddress is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetAddress() *Withdrawal_GetAddress_Call[WithdrawalT] { - return &Withdrawal_GetAddress_Call[WithdrawalT]{Call: _e.mock.On("GetAddress")} -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) Return(_a0 common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetAddress_Call[WithdrawalT]) RunAndReturn(run func() common.ExecutionAddress) *Withdrawal_GetAddress_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetAmount provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetAmount() math.Gwei { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetAmount") - } - - var r0 math.Gwei - if rf, ok := ret.Get(0).(func() math.Gwei); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.Gwei) - } - - return r0 -} - -// Withdrawal_GetAmount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAmount' -type Withdrawal_GetAmount_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetAmount is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetAmount() *Withdrawal_GetAmount_Call[WithdrawalT] { - return &Withdrawal_GetAmount_Call[WithdrawalT]{Call: _e.mock.On("GetAmount")} -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) Return(_a0 math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetAmount_Call[WithdrawalT]) RunAndReturn(run func() math.Gwei) *Withdrawal_GetAmount_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetIndex provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetIndex() math.U64 { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetIndex") - } - - var r0 math.U64 - if rf, ok := ret.Get(0).(func() math.U64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.U64) - } - - return r0 -} - -// Withdrawal_GetIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetIndex' -type Withdrawal_GetIndex_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetIndex is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetIndex() *Withdrawal_GetIndex_Call[WithdrawalT] { - return &Withdrawal_GetIndex_Call[WithdrawalT]{Call: _e.mock.On("GetIndex")} -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) Return(_a0 math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetIndex_Call[WithdrawalT]) RunAndReturn(run func() math.U64) *Withdrawal_GetIndex_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// GetValidatorIndex provides a mock function with given fields: -func (_m *Withdrawal[WithdrawalT]) GetValidatorIndex() math.ValidatorIndex { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetValidatorIndex") - } - - var r0 math.ValidatorIndex - if rf, ok := ret.Get(0).(func() math.ValidatorIndex); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(math.ValidatorIndex) - } - - return r0 -} - -// Withdrawal_GetValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetValidatorIndex' -type Withdrawal_GetValidatorIndex_Call[WithdrawalT any] struct { - *mock.Call -} - -// GetValidatorIndex is a helper method to define mock.On call -func (_e *Withdrawal_Expecter[WithdrawalT]) GetValidatorIndex() *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - return &Withdrawal_GetValidatorIndex_Call[WithdrawalT]{Call: _e.mock.On("GetValidatorIndex")} -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Run(run func()) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) Return(_a0 math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *Withdrawal_GetValidatorIndex_Call[WithdrawalT]) RunAndReturn(run func() math.ValidatorIndex) *Withdrawal_GetValidatorIndex_Call[WithdrawalT] { - _c.Call.Return(run) - return _c -} - -// NewWithdrawal creates a new instance of Withdrawal. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWithdrawal[WithdrawalT any](t interface { - mock.TestingT - Cleanup(func()) -}) *Withdrawal[WithdrawalT] { - mock := &Withdrawal[WithdrawalT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go b/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go deleted file mode 100644 index 291d70a837..0000000000 --- a/mod/state-transition/pkg/core/mocks/withdrawals_constraint.mock.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - bytes "bytes" - - mock "github.com/stretchr/testify/mock" -) - -// WithdrawalsConstraint is an autogenerated mock type for the WithdrawalsConstraint type -type WithdrawalsConstraint struct { - mock.Mock -} - -type WithdrawalsConstraint_Expecter struct { - mock *mock.Mock -} - -func (_m *WithdrawalsConstraint) EXPECT() *WithdrawalsConstraint_Expecter { - return &WithdrawalsConstraint_Expecter{mock: &_m.Mock} -} - -// EncodeIndex provides a mock function with given fields: _a0, _a1 -func (_m *WithdrawalsConstraint) EncodeIndex(_a0 int, _a1 *bytes.Buffer) { - _m.Called(_a0, _a1) -} - -// WithdrawalsConstraint_EncodeIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EncodeIndex' -type WithdrawalsConstraint_EncodeIndex_Call struct { - *mock.Call -} - -// EncodeIndex is a helper method to define mock.On call -// - _a0 int -// - _a1 *bytes.Buffer -func (_e *WithdrawalsConstraint_Expecter) EncodeIndex(_a0 interface{}, _a1 interface{}) *WithdrawalsConstraint_EncodeIndex_Call { - return &WithdrawalsConstraint_EncodeIndex_Call{Call: _e.mock.On("EncodeIndex", _a0, _a1)} -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) Run(run func(_a0 int, _a1 *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int), args[1].(*bytes.Buffer)) - }) - return _c -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) Return() *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Return() - return _c -} - -func (_c *WithdrawalsConstraint_EncodeIndex_Call) RunAndReturn(run func(int, *bytes.Buffer)) *WithdrawalsConstraint_EncodeIndex_Call { - _c.Call.Return(run) - return _c -} - -// Len provides a mock function with given fields: -func (_m *WithdrawalsConstraint) Len() int { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for Len") - } - - var r0 int - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int) - } - - return r0 -} - -// WithdrawalsConstraint_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' -type WithdrawalsConstraint_Len_Call struct { - *mock.Call -} - -// Len is a helper method to define mock.On call -func (_e *WithdrawalsConstraint_Expecter) Len() *WithdrawalsConstraint_Len_Call { - return &WithdrawalsConstraint_Len_Call{Call: _e.mock.On("Len")} -} - -func (_c *WithdrawalsConstraint_Len_Call) Run(run func()) *WithdrawalsConstraint_Len_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *WithdrawalsConstraint_Len_Call) Return(_a0 int) *WithdrawalsConstraint_Len_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WithdrawalsConstraint_Len_Call) RunAndReturn(run func() int) *WithdrawalsConstraint_Len_Call { - _c.Call.Return(run) - return _c -} - -// NewWithdrawalsConstraint creates a new instance of WithdrawalsConstraint. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWithdrawalsConstraint(t interface { - mock.TestingT - Cleanup(func()) -}) *WithdrawalsConstraint { - mock := &WithdrawalsConstraint{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go b/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go deleted file mode 100644 index 677433b90c..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_beacon_state.mock.go +++ /dev/null @@ -1,919 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyBeaconState is an autogenerated mock type for the WriteOnlyBeaconState type -type WriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - mock.Mock -} - -type WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) EXPECT() *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidator_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyBeaconState_AddValidatorBartio_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// DecreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for DecreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_DecreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DecreaseBalance' -type WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// DecreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) DecreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("DecreaseBalance", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_DecreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// IncreaseBalance provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 math.ValidatorIndex, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for IncreaseBalance") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_IncreaseBalance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncreaseBalance' -type WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// IncreaseBalance is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) IncreaseBalance(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("IncreaseBalance", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 math.Gwei)) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, math.Gwei) error) *WriteOnlyBeaconState_IncreaseBalance_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1Data(_a0 interface{}) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyBeaconState_SetEth1Data_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetEth1DepositIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetFork provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 ForkT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetFork") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ForkT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetFork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFork' -type WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetFork is a helper method to define mock.On call -// - _a0 ForkT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetFork(_a0 interface{}) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetFork", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ForkT)) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ForkT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ForkT) error) *WriteOnlyBeaconState_SetFork_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetGenesisValidatorsRoot provides a mock function with given fields: root -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root common.Root) error { - ret := _m.Called(root) - - if len(ret) == 0 { - panic("no return value specified for SetGenesisValidatorsRoot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(common.Root) error); ok { - r0 = rf(root) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGenesisValidatorsRoot' -type WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetGenesisValidatorsRoot is a helper method to define mock.On call -// - root common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetGenesisValidatorsRoot(root interface{}) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetGenesisValidatorsRoot", root)} -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(root common.Root)) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(common.Root) error) *WriteOnlyBeaconState_SetGenesisValidatorsRoot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetLatestBlockHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 BeaconBlockHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestBlockHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(BeaconBlockHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetLatestBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestBlockHeader' -type WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetLatestBlockHeader is a helper method to define mock.On call -// - _a0 BeaconBlockHeaderT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestBlockHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestBlockHeader", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 BeaconBlockHeaderT)) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(BeaconBlockHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(BeaconBlockHeaderT) error) *WriteOnlyBeaconState_SetLatestBlockHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyBeaconState_SetLatestExecutionPayloadHeader_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetNextWithdrawalIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalIndex' -type WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetNextWithdrawalIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64)) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64) error) *WriteOnlyBeaconState_SetNextWithdrawalIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetNextWithdrawalValidatorIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 math.ValidatorIndex) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetNextWithdrawalValidatorIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextWithdrawalValidatorIndex' -type WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetNextWithdrawalValidatorIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetNextWithdrawalValidatorIndex(_a0 interface{}) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetNextWithdrawalValidatorIndex", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex)) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex) error) *WriteOnlyBeaconState_SetNextWithdrawalValidatorIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetSlot provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 math.Slot) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetSlot") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Slot) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetSlot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSlot' -type WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetSlot is a helper method to define mock.On call -// - _a0 math.Slot -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetSlot(_a0 interface{}) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetSlot", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Slot)) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Slot)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Slot) error) *WriteOnlyBeaconState_SetSlot_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// SetTotalSlashing provides a mock function with given fields: _a0 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 math.Gwei) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetTotalSlashing") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.Gwei) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_SetTotalSlashing_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTotalSlashing' -type WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// SetTotalSlashing is a helper method to define mock.On call -// - _a0 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) SetTotalSlashing(_a0 interface{}) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("SetTotalSlashing", _a0)} -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.Gwei)) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.Gwei) error) *WriteOnlyBeaconState_SetTotalSlashing_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateBlockRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateBlockRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateBlockRootAtIndex' -type WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateBlockRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateBlockRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateBlockRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateBlockRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyBeaconState_UpdateRandaoMixAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateSlashingAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 uint64, _a1 math.Gwei) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateSlashingAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, math.Gwei) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateSlashingAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateSlashingAtIndex' -type WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateSlashingAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 math.Gwei -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateSlashingAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateSlashingAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 math.Gwei)) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(math.Gwei)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, math.Gwei) error) *WriteOnlyBeaconState_UpdateSlashingAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyBeaconState_UpdateStateRootAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyBeaconState_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *WriteOnlyBeaconState_Expecter[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - return &WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) Return(_a0 error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyBeaconState_UpdateValidatorAtIndex_Call[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyBeaconState creates a new instance of WriteOnlyBeaconState. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyBeaconState[BeaconBlockHeaderT any, Eth1DataT any, ExecutionPayloadHeaderT any, ForkT any, ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT] { - mock := &WriteOnlyBeaconState[BeaconBlockHeaderT, Eth1DataT, ExecutionPayloadHeaderT, ForkT, ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go b/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go deleted file mode 100644 index a6020ec38b..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_eth_1_data.mock.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import mock "github.com/stretchr/testify/mock" - -// WriteOnlyEth1Data is an autogenerated mock type for the WriteOnlyEth1Data type -type WriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock.Mock -} - -type WriteOnlyEth1Data_Expecter[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) EXPECT() *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]{mock: &_m.Mock} -} - -// SetEth1Data provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 Eth1DataT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1Data") - } - - var r0 error - if rf, ok := ret.Get(0).(func(Eth1DataT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetEth1Data_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1Data' -type WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetEth1Data is a helper method to define mock.On call -// - _a0 Eth1DataT -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1Data(_a0 interface{}) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1Data", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 Eth1DataT)) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(Eth1DataT)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(Eth1DataT) error) *WriteOnlyEth1Data_SetEth1Data_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetEth1DepositIndex provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 uint64) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetEth1DepositIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetEth1DepositIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetEth1DepositIndex' -type WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetEth1DepositIndex is a helper method to define mock.On call -// - _a0 uint64 -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetEth1DepositIndex(_a0 interface{}) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetEth1DepositIndex", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 uint64)) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(uint64) error) *WriteOnlyEth1Data_SetEth1DepositIndex_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// SetLatestExecutionPayloadHeader provides a mock function with given fields: _a0 -func (_m *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 ExecutionPayloadHeaderT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for SetLatestExecutionPayloadHeader") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ExecutionPayloadHeaderT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetLatestExecutionPayloadHeader' -type WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT any, ExecutionPayloadHeaderT any] struct { - *mock.Call -} - -// SetLatestExecutionPayloadHeader is a helper method to define mock.On call -// - _a0 ExecutionPayloadHeaderT -func (_e *WriteOnlyEth1Data_Expecter[Eth1DataT, ExecutionPayloadHeaderT]) SetLatestExecutionPayloadHeader(_a0 interface{}) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - return &WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]{Call: _e.mock.On("SetLatestExecutionPayloadHeader", _a0)} -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Run(run func(_a0 ExecutionPayloadHeaderT)) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ExecutionPayloadHeaderT)) - }) - return _c -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) Return(_a0 error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT]) RunAndReturn(run func(ExecutionPayloadHeaderT) error) *WriteOnlyEth1Data_SetLatestExecutionPayloadHeader_Call[Eth1DataT, ExecutionPayloadHeaderT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyEth1Data creates a new instance of WriteOnlyEth1Data. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyEth1Data[Eth1DataT any, ExecutionPayloadHeaderT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT] { - mock := &WriteOnlyEth1Data[Eth1DataT, ExecutionPayloadHeaderT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go b/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go deleted file mode 100644 index 6cd16f7b52..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_randao_mixes.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyRandaoMixes is an autogenerated mock type for the WriteOnlyRandaoMixes type -type WriteOnlyRandaoMixes struct { - mock.Mock -} - -type WriteOnlyRandaoMixes_Expecter struct { - mock *mock.Mock -} - -func (_m *WriteOnlyRandaoMixes) EXPECT() *WriteOnlyRandaoMixes_Expecter { - return &WriteOnlyRandaoMixes_Expecter{mock: &_m.Mock} -} - -// UpdateRandaoMixAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyRandaoMixes) UpdateRandaoMixAtIndex(_a0 uint64, _a1 common.Bytes32) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateRandaoMixAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Bytes32) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRandaoMixAtIndex' -type WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call struct { - *mock.Call -} - -// UpdateRandaoMixAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Bytes32 -func (_e *WriteOnlyRandaoMixes_Expecter) UpdateRandaoMixAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - return &WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call{Call: _e.mock.On("UpdateRandaoMixAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Bytes32)) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Bytes32)) - }) - return _c -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) Return(_a0 error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call) RunAndReturn(run func(uint64, common.Bytes32) error) *WriteOnlyRandaoMixes_UpdateRandaoMixAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyRandaoMixes creates a new instance of WriteOnlyRandaoMixes. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyRandaoMixes(t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyRandaoMixes { - mock := &WriteOnlyRandaoMixes{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go b/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go deleted file mode 100644 index 7349015317..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_state_roots.mock.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - common "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyStateRoots is an autogenerated mock type for the WriteOnlyStateRoots type -type WriteOnlyStateRoots struct { - mock.Mock -} - -type WriteOnlyStateRoots_Expecter struct { - mock *mock.Mock -} - -func (_m *WriteOnlyStateRoots) EXPECT() *WriteOnlyStateRoots_Expecter { - return &WriteOnlyStateRoots_Expecter{mock: &_m.Mock} -} - -// UpdateStateRootAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyStateRoots) UpdateStateRootAtIndex(_a0 uint64, _a1 common.Root) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateStateRootAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(uint64, common.Root) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyStateRoots_UpdateStateRootAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateStateRootAtIndex' -type WriteOnlyStateRoots_UpdateStateRootAtIndex_Call struct { - *mock.Call -} - -// UpdateStateRootAtIndex is a helper method to define mock.On call -// - _a0 uint64 -// - _a1 common.Root -func (_e *WriteOnlyStateRoots_Expecter) UpdateStateRootAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - return &WriteOnlyStateRoots_UpdateStateRootAtIndex_Call{Call: _e.mock.On("UpdateStateRootAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Run(run func(_a0 uint64, _a1 common.Root)) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(common.Root)) - }) - return _c -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) Return(_a0 error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call) RunAndReturn(run func(uint64, common.Root) error) *WriteOnlyStateRoots_UpdateStateRootAtIndex_Call { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyStateRoots creates a new instance of WriteOnlyStateRoots. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyStateRoots(t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyStateRoots { - mock := &WriteOnlyStateRoots{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go b/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go deleted file mode 100644 index 3f4d7bfcac..0000000000 --- a/mod/state-transition/pkg/core/mocks/write_only_validators.mock.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by mockery v2.46.3. DO NOT EDIT. - -package mocks - -import ( - math "github.com/berachain/beacon-kit/mod/primitives/pkg/math" - mock "github.com/stretchr/testify/mock" -) - -// WriteOnlyValidators is an autogenerated mock type for the WriteOnlyValidators type -type WriteOnlyValidators[ValidatorT any] struct { - mock.Mock -} - -type WriteOnlyValidators_Expecter[ValidatorT any] struct { - mock *mock.Mock -} - -func (_m *WriteOnlyValidators[ValidatorT]) EXPECT() *WriteOnlyValidators_Expecter[ValidatorT] { - return &WriteOnlyValidators_Expecter[ValidatorT]{mock: &_m.Mock} -} - -// AddValidator provides a mock function with given fields: _a0 -func (_m *WriteOnlyValidators[ValidatorT]) AddValidator(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidator") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_AddValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidator' -type WriteOnlyValidators_AddValidator_Call[ValidatorT any] struct { - *mock.Call -} - -// AddValidator is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidator(_a0 interface{}) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - return &WriteOnlyValidators_AddValidator_Call[ValidatorT]{Call: _e.mock.On("AddValidator", _a0)} -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_AddValidator_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidator_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// AddValidatorBartio provides a mock function with given fields: _a0 -func (_m *WriteOnlyValidators[ValidatorT]) AddValidatorBartio(_a0 ValidatorT) error { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for AddValidatorBartio") - } - - var r0 error - if rf, ok := ret.Get(0).(func(ValidatorT) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_AddValidatorBartio_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddValidatorBartio' -type WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT any] struct { - *mock.Call -} - -// AddValidatorBartio is a helper method to define mock.On call -// - _a0 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) AddValidatorBartio(_a0 interface{}) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - return &WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]{Call: _e.mock.On("AddValidatorBartio", _a0)} -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Run(run func(_a0 ValidatorT)) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT]) RunAndReturn(run func(ValidatorT) error) *WriteOnlyValidators_AddValidatorBartio_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// UpdateValidatorAtIndex provides a mock function with given fields: _a0, _a1 -func (_m *WriteOnlyValidators[ValidatorT]) UpdateValidatorAtIndex(_a0 math.ValidatorIndex, _a1 ValidatorT) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for UpdateValidatorAtIndex") - } - - var r0 error - if rf, ok := ret.Get(0).(func(math.ValidatorIndex, ValidatorT) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// WriteOnlyValidators_UpdateValidatorAtIndex_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateValidatorAtIndex' -type WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT any] struct { - *mock.Call -} - -// UpdateValidatorAtIndex is a helper method to define mock.On call -// - _a0 math.ValidatorIndex -// - _a1 ValidatorT -func (_e *WriteOnlyValidators_Expecter[ValidatorT]) UpdateValidatorAtIndex(_a0 interface{}, _a1 interface{}) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - return &WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]{Call: _e.mock.On("UpdateValidatorAtIndex", _a0, _a1)} -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Run(run func(_a0 math.ValidatorIndex, _a1 ValidatorT)) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(math.ValidatorIndex), args[1].(ValidatorT)) - }) - return _c -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) Return(_a0 error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Return(_a0) - return _c -} - -func (_c *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT]) RunAndReturn(run func(math.ValidatorIndex, ValidatorT) error) *WriteOnlyValidators_UpdateValidatorAtIndex_Call[ValidatorT] { - _c.Call.Return(run) - return _c -} - -// NewWriteOnlyValidators creates a new instance of WriteOnlyValidators. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewWriteOnlyValidators[ValidatorT any](t interface { - mock.TestingT - Cleanup(func()) -}) *WriteOnlyValidators[ValidatorT] { - mock := &WriteOnlyValidators[ValidatorT]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 354f0c723a..a37cca2a1e 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,12 +28,11 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -80,13 +79,8 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := mocks.NewExecutionEngine[ - *types.ExecutionPayload, - *types.ExecutionPayloadHeader, - engineprimitives.Withdrawals, - ](t) - - mocksSigner := &cryptomocks.Blssigner{} + execEngine := &testExecutionEngine{} + mocksSigner := &mocks.BLSSigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 6edcb5a71b..5a359344d3 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -173,18 +173,15 @@ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } -// WithdrawalsConstraint is the interface for withdrawals constraint. -type WithdrawalsConstraint interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) -} - // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT WithdrawalsConstraint, + WithdrawalsT interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) + }, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. diff --git a/mod/storage/pkg/filedb/range_db_test.go b/mod/storage/pkg/filedb/range_db_test.go index b0e33eddf2..51334ce806 100644 --- a/mod/storage/pkg/filedb/range_db_test.go +++ b/mod/storage/pkg/filedb/range_db_test.go @@ -197,11 +197,11 @@ func TestExtractIndex(t *testing.T) { func TestRangeDB_DeleteRange_NotSupported(t *testing.T) { tests := []struct { name string - db *mocks.Db + db *mocks.DB }{ { name: "DeleteRangeNotSupported", - db: new(mocks.Db), + db: new(mocks.DB), }, } diff --git a/mod/storage/pkg/interfaces/mocks/db.mock.go b/mod/storage/pkg/interfaces/mocks/db.mock.go index e076d6ed35..97c0431b20 100644 --- a/mod/storage/pkg/interfaces/mocks/db.mock.go +++ b/mod/storage/pkg/interfaces/mocks/db.mock.go @@ -4,21 +4,21 @@ package mocks import mock "github.com/stretchr/testify/mock" -// Db is an autogenerated mock type for the DB type -type Db struct { +// DB is an autogenerated mock type for the DB type +type DB struct { mock.Mock } -type Db_Expecter struct { +type DB_Expecter struct { mock *mock.Mock } -func (_m *Db) EXPECT() *Db_Expecter { - return &Db_Expecter{mock: &_m.Mock} +func (_m *DB) EXPECT() *DB_Expecter { + return &DB_Expecter{mock: &_m.Mock} } // Delete provides a mock function with given fields: key -func (_m *Db) Delete(key []byte) error { +func (_m *DB) Delete(key []byte) error { ret := _m.Called(key) if len(ret) == 0 { @@ -35,36 +35,36 @@ func (_m *Db) Delete(key []byte) error { return r0 } -// Db_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' -type Db_Delete_Call struct { +// DB_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type DB_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Delete(key interface{}) *Db_Delete_Call { - return &Db_Delete_Call{Call: _e.mock.On("Delete", key)} +func (_e *DB_Expecter) Delete(key interface{}) *DB_Delete_Call { + return &DB_Delete_Call{Call: _e.mock.On("Delete", key)} } -func (_c *Db_Delete_Call) Run(run func(key []byte)) *Db_Delete_Call { +func (_c *DB_Delete_Call) Run(run func(key []byte)) *DB_Delete_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Delete_Call) Return(_a0 error) *Db_Delete_Call { +func (_c *DB_Delete_Call) Return(_a0 error) *DB_Delete_Call { _c.Call.Return(_a0) return _c } -func (_c *Db_Delete_Call) RunAndReturn(run func([]byte) error) *Db_Delete_Call { +func (_c *DB_Delete_Call) RunAndReturn(run func([]byte) error) *DB_Delete_Call { _c.Call.Return(run) return _c } // Get provides a mock function with given fields: key -func (_m *Db) Get(key []byte) ([]byte, error) { +func (_m *DB) Get(key []byte) ([]byte, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -93,36 +93,36 @@ func (_m *Db) Get(key []byte) ([]byte, error) { return r0, r1 } -// Db_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' -type Db_Get_Call struct { +// DB_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type DB_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Get(key interface{}) *Db_Get_Call { - return &Db_Get_Call{Call: _e.mock.On("Get", key)} +func (_e *DB_Expecter) Get(key interface{}) *DB_Get_Call { + return &DB_Get_Call{Call: _e.mock.On("Get", key)} } -func (_c *Db_Get_Call) Run(run func(key []byte)) *Db_Get_Call { +func (_c *DB_Get_Call) Run(run func(key []byte)) *DB_Get_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Get_Call) Return(_a0 []byte, _a1 error) *Db_Get_Call { +func (_c *DB_Get_Call) Return(_a0 []byte, _a1 error) *DB_Get_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Db_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *Db_Get_Call { +func (_c *DB_Get_Call) RunAndReturn(run func([]byte) ([]byte, error)) *DB_Get_Call { _c.Call.Return(run) return _c } // Has provides a mock function with given fields: key -func (_m *Db) Has(key []byte) (bool, error) { +func (_m *DB) Has(key []byte) (bool, error) { ret := _m.Called(key) if len(ret) == 0 { @@ -149,36 +149,36 @@ func (_m *Db) Has(key []byte) (bool, error) { return r0, r1 } -// Db_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' -type Db_Has_Call struct { +// DB_Has_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Has' +type DB_Has_Call struct { *mock.Call } // Has is a helper method to define mock.On call // - key []byte -func (_e *Db_Expecter) Has(key interface{}) *Db_Has_Call { - return &Db_Has_Call{Call: _e.mock.On("Has", key)} +func (_e *DB_Expecter) Has(key interface{}) *DB_Has_Call { + return &DB_Has_Call{Call: _e.mock.On("Has", key)} } -func (_c *Db_Has_Call) Run(run func(key []byte)) *Db_Has_Call { +func (_c *DB_Has_Call) Run(run func(key []byte)) *DB_Has_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *Db_Has_Call) Return(_a0 bool, _a1 error) *Db_Has_Call { +func (_c *DB_Has_Call) Return(_a0 bool, _a1 error) *DB_Has_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Db_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *Db_Has_Call { +func (_c *DB_Has_Call) RunAndReturn(run func([]byte) (bool, error)) *DB_Has_Call { _c.Call.Return(run) return _c } // Set provides a mock function with given fields: key, value -func (_m *Db) Set(key []byte, value []byte) error { +func (_m *DB) Set(key []byte, value []byte) error { ret := _m.Called(key, value) if len(ret) == 0 { @@ -195,42 +195,42 @@ func (_m *Db) Set(key []byte, value []byte) error { return r0 } -// Db_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' -type Db_Set_Call struct { +// DB_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' +type DB_Set_Call struct { *mock.Call } // Set is a helper method to define mock.On call // - key []byte // - value []byte -func (_e *Db_Expecter) Set(key interface{}, value interface{}) *Db_Set_Call { - return &Db_Set_Call{Call: _e.mock.On("Set", key, value)} +func (_e *DB_Expecter) Set(key interface{}, value interface{}) *DB_Set_Call { + return &DB_Set_Call{Call: _e.mock.On("Set", key, value)} } -func (_c *Db_Set_Call) Run(run func(key []byte, value []byte)) *Db_Set_Call { +func (_c *DB_Set_Call) Run(run func(key []byte, value []byte)) *DB_Set_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte), args[1].([]byte)) }) return _c } -func (_c *Db_Set_Call) Return(_a0 error) *Db_Set_Call { +func (_c *DB_Set_Call) Return(_a0 error) *DB_Set_Call { _c.Call.Return(_a0) return _c } -func (_c *Db_Set_Call) RunAndReturn(run func([]byte, []byte) error) *Db_Set_Call { +func (_c *DB_Set_Call) RunAndReturn(run func([]byte, []byte) error) *DB_Set_Call { _c.Call.Return(run) return _c } -// NewDb creates a new instance of Db. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewDB creates a new instance of DB. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewDb(t interface { +func NewDB(t interface { mock.TestingT Cleanup(func()) -}) *Db { - mock := &Db{} +}) *DB { + mock := &DB{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) From 9818c7e0830cd3685d1a8640bcb7feb8bb9bca9f Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 13:49:34 +0530 Subject: [PATCH 10/77] tests with only mock for execution engine Signed-off-by: nidhi-singh02 --- .mockery.yaml | 5 ++ mod/state-transition/pkg/core/helpers_test.go | 43 ++++++++-- .../pkg/core/mocks/execution_engine.mock.go | 86 +++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 11 ++- mod/state-transition/pkg/core/types.go | 9 +- 5 files changed, 138 insertions(+), 16 deletions(-) create mode 100644 mod/state-transition/pkg/core/mocks/execution_engine.mock.go diff --git a/.mockery.yaml b/.mockery.yaml index 6062236306..d1b168a550 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -68,3 +68,8 @@ packages: recursive: False with-expecter: true all: True + github.com/berachain/beacon-kit/mod/state-transition/pkg/core: + config: + recursive: False + with-expecter: true + include-regex: ExecutionEngine \ No newline at end of file diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 1631830784..b982800a67 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,6 +23,7 @@ package core_test import ( "context" "fmt" + "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -32,24 +33,48 @@ import ( "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + "github.com/berachain/beacon-kit/mod/primitives/pkg/common" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" ) -// TODO: replace with proper mock -type testExecutionEngine struct{} - -func (tee *testExecutionEngine) VerifyAndNotifyNewPayload( - _ context.Context, - _ *engineprimitives.NewPayloadRequest[ +func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { + mockEngine := mocks.NewExecutionEngine[ *types.ExecutionPayload, + *types.ExecutionPayloadHeader, engineprimitives.Withdrawals, - ], -) error { - return nil + ](t) + + t.Run("successful verification with complete payload", func(t *testing.T) { + req := &engineprimitives.NewPayloadRequest[ + *types.ExecutionPayload, + engineprimitives.Withdrawals, + ]{ + ExecutionPayload: &types.ExecutionPayload{}, + VersionedHashes: []common.ExecutionHash{ + {0x1}, + {0x2}, + }, + ParentBeaconBlockRoot: &common.Root{0x3}, + Optimistic: false, + } + + // Set up expectation for successful verification + mockEngine.EXPECT(). + VerifyAndNotifyNewPayload( + context.Background(), + req, + ). + Return(nil) + + err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) + require.NoError(t, err) + }) } type testKVStoreService struct { diff --git a/mod/state-transition/pkg/core/mocks/execution_engine.mock.go b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go new file mode 100644 index 0000000000..18e35998eb --- /dev/null +++ b/mod/state-transition/pkg/core/mocks/execution_engine.mock.go @@ -0,0 +1,86 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" + core "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + + mock "github.com/stretchr/testify/mock" +) + +// ExecutionEngine is an autogenerated mock type for the ExecutionEngine type +type ExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + mock.Mock +} + +type ExecutionEngine_Expecter[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + mock *mock.Mock +} + +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) EXPECT() *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{mock: &_m.Mock} +} + +// VerifyAndNotifyNewPayload provides a mock function with given fields: ctx, req +func (_m *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error { + ret := _m.Called(ctx, req) + + if len(ret) == 0 { + panic("no return value specified for VerifyAndNotifyNewPayload") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error); ok { + r0 = rf(ctx, req) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// ExecutionEngine_VerifyAndNotifyNewPayload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyAndNotifyNewPayload' +type ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals] struct { + *mock.Call +} + +// VerifyAndNotifyNewPayload is a helper method to define mock.On call +// - ctx context.Context +// - req *engineprimitives.NewPayloadRequest[ExecutionPayloadT,WithdrawalsT] +func (_e *ExecutionEngine_Expecter[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) VerifyAndNotifyNewPayload(ctx interface{}, req interface{}) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + return &ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{Call: _e.mock.On("VerifyAndNotifyNewPayload", ctx, req)} +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Run(run func(ctx context.Context, req *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT])) + }) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) Return(_a0 error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(_a0) + return _c +} + +func (_c *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]) RunAndReturn(run func(context.Context, *engineprimitives.NewPayloadRequest[ExecutionPayloadT, WithdrawalsT]) error) *ExecutionEngine_VerifyAndNotifyNewPayload_Call[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + _c.Call.Return(run) + return _c +} + +// NewExecutionEngine creates a new instance of ExecutionEngine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutionEngine[ExecutionPayloadT core.ExecutionPayload[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, WithdrawalsT core.Withdrawals](t interface { + mock.TestingT + Cleanup(func()) +}) *ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT] { + mock := &ExecutionEngine[ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index a37cca2a1e..20996901ea 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -28,11 +28,12 @@ import ( engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" - "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" + cryptomocks "github.com/berachain/beacon-kit/mod/primitives/pkg/crypto/mocks" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" + "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" @@ -79,8 +80,12 @@ type ( func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() - execEngine := &testExecutionEngine{} - mocksSigner := &mocks.BLSSigner{} + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} sp := core.NewStateProcessor[ *types.BeaconBlock, diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 5a359344d3..ab05bd3c0c 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -172,16 +172,17 @@ type ExecutionPayload[ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } +type Withdrawals interface { + Len() int + EncodeIndex(int, *stdbytes.Buffer) +} // ExecutionEngine is the interface for the execution engine. type ExecutionEngine[ ExecutionPayloadT ExecutionPayload[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT], ExecutionPayloadHeaderT any, - WithdrawalsT interface { - Len() int - EncodeIndex(int, *stdbytes.Buffer) - }, + WithdrawalsT Withdrawals, ] interface { // VerifyAndNotifyNewPayload verifies the new payload and notifies the // execution client. From 160cc8865cc7be4202713db2ccaafa819137ec36 Mon Sep 17 00:00:00 2001 From: nidhi-singh02 Date: Wed, 30 Oct 2024 14:16:11 +0530 Subject: [PATCH 11/77] removed test for VerifyAndNotifyNewPayload Signed-off-by: nidhi-singh02 --- .mockery.yaml | 2 +- mod/state-transition/pkg/core/helpers_test.go | 39 ------------------- mod/state-transition/pkg/core/types.go | 2 + 3 files changed, 3 insertions(+), 40 deletions(-) diff --git a/.mockery.yaml b/.mockery.yaml index d1b168a550..e4efc43af5 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -72,4 +72,4 @@ packages: config: recursive: False with-expecter: true - include-regex: ExecutionEngine \ No newline at end of file + include-regex: ExecutionEngine diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index b982800a67..ceba3b6432 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -23,7 +23,6 @@ package core_test import ( "context" "fmt" - "testing" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" @@ -31,52 +30,14 @@ import ( "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" dbm "github.com/cosmos/cosmos-db" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) -func TestExecutionEngine_VerifyAndNotifyNewPayload(t *testing.T) { - mockEngine := mocks.NewExecutionEngine[ - *types.ExecutionPayload, - *types.ExecutionPayloadHeader, - engineprimitives.Withdrawals, - ](t) - - t.Run("successful verification with complete payload", func(t *testing.T) { - req := &engineprimitives.NewPayloadRequest[ - *types.ExecutionPayload, - engineprimitives.Withdrawals, - ]{ - ExecutionPayload: &types.ExecutionPayload{}, - VersionedHashes: []common.ExecutionHash{ - {0x1}, - {0x2}, - }, - ParentBeaconBlockRoot: &common.Root{0x3}, - Optimistic: false, - } - - // Set up expectation for successful verification - mockEngine.EXPECT(). - VerifyAndNotifyNewPayload( - context.Background(), - req, - ). - Return(nil) - - err := mockEngine.VerifyAndNotifyNewPayload(context.Background(), req) - require.NoError(t, err) - }) -} - type testKVStoreService struct { ctx sdk.Context } diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index ab05bd3c0c..26ef877923 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -172,6 +172,8 @@ type ExecutionPayload[ type ExecutionPayloadHeader interface { GetBlockHash() common.ExecutionHash } + +// Withdrawals defines the interface for managing withdrawal operations. type Withdrawals interface { Len() int EncodeIndex(int, *stdbytes.Buffer) From 4a9fe1c8453740555f9b52d310c28f23ac282eb4 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 12:36:49 +0100 Subject: [PATCH 12/77] nit --- mod/state-transition/pkg/core/helpers_test.go | 39 +++++++++++++++++++ .../pkg/core/state_processor_genesis_test.go | 39 ------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index ceba3b6432..25b71c2035 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -30,7 +30,9 @@ import ( "cosmossdk.io/store/metrics" storetypes "cosmossdk.io/store/types" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" + engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" "github.com/berachain/beacon-kit/mod/node-core/pkg/components" + statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/berachain/beacon-kit/mod/storage/pkg/db" "github.com/berachain/beacon-kit/mod/storage/pkg/encoding" @@ -38,6 +40,43 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type ( + TestBeaconStateMarshallableT = types.BeaconState[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.BeaconBlockHeader, + types.Eth1Data, + types.ExecutionPayloadHeader, + types.Fork, + types.Validator, + ] + + TestKVStoreT = beacondb.KVStore[ + *types.BeaconBlockHeader, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *types.Validator, + types.Validators, + ] + + TestBeaconStateT = statedb.StateDB[ + *types.BeaconBlockHeader, + *TestBeaconStateMarshallableT, + *types.Eth1Data, + *types.ExecutionPayloadHeader, + *types.Fork, + *TestKVStoreT, + *types.Validator, + types.Validators, + *engineprimitives.Withdrawal, + types.WithdrawalCredentials, + ] +) + type testKVStoreService struct { ctx sdk.Context } diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 20996901ea..9177f7d300 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -34,49 +34,10 @@ import ( "github.com/berachain/beacon-kit/mod/primitives/pkg/version" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core" "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/mocks" - statedb "github.com/berachain/beacon-kit/mod/state-transition/pkg/core/state" - "github.com/berachain/beacon-kit/mod/storage/pkg/beacondb" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) -type ( - TestBeaconStateMarshallableT = types.BeaconState[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.BeaconBlockHeader, - types.Eth1Data, - types.ExecutionPayloadHeader, - types.Fork, - types.Validator, - ] - - TestKVStoreT = beacondb.KVStore[ - *types.BeaconBlockHeader, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *types.Validator, - types.Validators, - ] - - TestBeaconStateT = statedb.StateDB[ - *types.BeaconBlockHeader, - *TestBeaconStateMarshallableT, - *types.Eth1Data, - *types.ExecutionPayloadHeader, - *types.Fork, - *TestKVStoreT, - *types.Validator, - types.Validators, - *engineprimitives.Withdrawal, - types.WithdrawalCredentials, - ] -) - func TestInitialize(t *testing.T) { // Create state processor to test cs := spec.TestnetChainSpec() From e048be4dce1b0caa6dbc559e4ad4f134369b2730 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 13:49:56 +0100 Subject: [PATCH 13/77] improved unit tests asserts --- .../pkg/core/state_processor_genesis_test.go | 76 ++++++++++++++----- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 9177f7d300..d528c849fd 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -23,6 +23,7 @@ package core_test import ( "testing" + "github.com/berachain/beacon-kit/mod/chain-spec/pkg/chain" "github.com/berachain/beacon-kit/mod/config/pkg/spec" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" @@ -94,9 +95,23 @@ func TestInitialize(t *testing.T) { Amount: math.Gwei(cs.EffectiveBalanceIncrement()), Index: uint64(2), }, + { + Pubkey: [48]byte{0x04}, + Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Index: uint64(3), + }, + { + Pubkey: [48]byte{0x05}, + Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Index: uint64(4), + }, } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() - genesisVersion = version.FromUint32[common.Version](version.Deneb) + fork = &types.Fork{ + PreviousVersion: version.FromUint32[common.Version](version.Deneb), + CurrentVersion: version.FromUint32[common.Version](version.Deneb), + Epoch: math.Epoch(constants.GenesisEpoch), + } ) // define mocks expectations @@ -110,7 +125,7 @@ func TestInitialize(t *testing.T) { beaconState, deposits, executionPayloadHeader, - genesisVersion, + fork.CurrentVersion, ) // check outputs @@ -124,24 +139,49 @@ func TestInitialize(t *testing.T) { resFork, err := beaconState.GetFork() require.NoError(t, err) - require.Equal(t, - &types.Fork{ - PreviousVersion: genesisVersion, - CurrentVersion: genesisVersion, - Epoch: math.Epoch(constants.GenesisEpoch), - }, - resFork) + require.Equal(t, fork, resFork) for _, dep := range deposits { - var idx math.U64 - idx, err = beaconState.ValidatorIndexByPubkey(dep.Pubkey) - require.NoError(t, err) - require.Equal(t, math.U64(dep.Index), idx) - - var val *types.Validator - val, err = beaconState.ValidatorByIndex(idx) - require.NoError(t, err) - require.Equal(t, dep.Pubkey, val.Pubkey) + checkValidator(t, cs, beaconState, dep) + } +} + +func checkValidator( + t *testing.T, + cs chain.Spec[ + common.DomainType, + math.Epoch, + common.ExecutionAddress, + math.Slot, + any, + ], + bs *TestBeaconStateT, + dep *types.Deposit, +) { + t.Helper() + + idx, err := bs.ValidatorIndexByPubkey(dep.Pubkey) + require.NoError(t, err) + require.Equal(t, math.U64(dep.Index), idx) + + var val *types.Validator + val, err = bs.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, dep.Pubkey, val.Pubkey) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + ) + switch { + case dep.Amount >= maxBalance: + require.Equal(t, maxBalance, val.EffectiveBalance) + case dep.Amount >= minBalance && dep.Amount < maxBalance: require.Equal(t, dep.Amount, val.EffectiveBalance) + + // validator balance must be multiple of EffectiveBalanceIncrement + require.True(t, val.EffectiveBalance%minBalance == 0) + case dep.Amount < minBalance: + require.Equal(t, math.Gwei(0), val.EffectiveBalance) } } From 8bf34dbf6093bbde3a5b9ab82888f51b63557df8 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 14:57:30 +0100 Subject: [PATCH 14/77] appease linter --- .../pkg/core/state_processor_genesis_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index d528c849fd..8bc42db628 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -164,8 +164,7 @@ func checkValidator( require.NoError(t, err) require.Equal(t, math.U64(dep.Index), idx) - var val *types.Validator - val, err = bs.ValidatorByIndex(idx) + val, err := bs.ValidatorByIndex(idx) require.NoError(t, err) require.Equal(t, dep.Pubkey, val.Pubkey) @@ -180,7 +179,7 @@ func checkValidator( require.Equal(t, dep.Amount, val.EffectiveBalance) // validator balance must be multiple of EffectiveBalanceIncrement - require.True(t, val.EffectiveBalance%minBalance == 0) + require.Equal(t, math.U64(0), val.EffectiveBalance%minBalance) case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } From d90a95a7fffafdd8bfe28bac7a2acc8e3ee3c48c Mon Sep 17 00:00:00 2001 From: Alberto Benegiamo Date: Thu, 31 Oct 2024 15:48:23 +0100 Subject: [PATCH 15/77] fix(state-transition): fix deposit index upon genesis processing (#2116) --- .../pkg/core/state_processor.go | 4 +++ .../pkg/core/state_processor_genesis.go | 34 ++++++++++++------- .../pkg/core/state_processor_genesis_test.go | 5 +++ .../pkg/core/state_processor_staking.go | 19 +++++++---- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 439cf3895f..df473e6ebc 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -85,6 +85,10 @@ type StateProcessor[ executionEngine ExecutionEngine[ ExecutionPayloadT, ExecutionPayloadHeaderT, WithdrawalsT, ] + + // processingGenesis allows initializing correctly + // eth1 deposit index upon genesis + processingGenesis bool } // NewStateProcessor creates a new state processor. diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index a142950598..9e7502b0df 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -47,6 +47,11 @@ func (sp *StateProcessor[ executionPayloadHeader ExecutionPayloadHeaderT, genesisVersion common.Version, ) (transition.ValidatorUpdates, error) { + sp.processingGenesis = true + defer func() { + sp.processingGenesis = false + }() + var ( blkHeader BeaconBlockHeaderT blkBody BeaconBlockBodyT @@ -67,25 +72,28 @@ func (sp *StateProcessor[ return nil, err } - if err := st.SetEth1DepositIndex(0); err != nil { - return nil, err - } + // Eth1DepositIndex will be set in processDeposit - if err := st.SetEth1Data(eth1Data.New( - common.Root{}, - 0, - executionPayloadHeader.GetBlockHash(), - )); err != nil { + if err := st.SetEth1Data( + eth1Data.New( + common.Root{}, + 0, + executionPayloadHeader.GetBlockHash(), + )); err != nil { return nil, err } // TODO: we need to handle common.Version vs // uint32 better. - bodyRoot := blkBody.Empty( - version.ToUint32(genesisVersion)).HashTreeRoot() - if err := st.SetLatestBlockHeader(blkHeader.New( - 0, 0, common.Root{}, common.Root{}, bodyRoot, - )); err != nil { + bodyRoot := blkBody.Empty(version.ToUint32(genesisVersion)).HashTreeRoot() + if err := st.SetLatestBlockHeader( + blkHeader.New( + 0, // slot + 0, // proposer index + common.Root{}, // parent block root + common.Root{}, // state root + bodyRoot, + )); err != nil { return nil, err } diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index 8bc42db628..f784add974 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -183,4 +183,9 @@ func checkValidator( case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } + + // check that validator index is duly set + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(deposits)-1), latestValIdx) } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index fc336908da..a798b1fcfc 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -21,6 +21,8 @@ package core import ( + "fmt" + "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" @@ -83,14 +85,19 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - depositIndex, err := st.GetEth1DepositIndex() - if err != nil { - return err + var nextDepositIndex uint64 + switch depositIndex, err := st.GetEth1DepositIndex(); { + case err == nil: + nextDepositIndex = depositIndex + 1 + case sp.processingGenesis && err != nil: + // Eth1DepositIndex may have not been set yet + nextDepositIndex = 0 + default: + // Failed retrieving Eth1DepositIndex outside genesis is an error + return fmt.Errorf("failed retrieving eth1 deposit index: %w", err) } - if err = st.SetEth1DepositIndex( - depositIndex + 1, - ); err != nil { + if err := st.SetEth1DepositIndex(nextDepositIndex); err != nil { return err } From e17d29c20402fb9ec127517ba5182b45b65530a9 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 31 Oct 2024 17:47:36 +0100 Subject: [PATCH 16/77] fixed bad merge --- .../pkg/core/state_processor_genesis_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis_test.go b/mod/state-transition/pkg/core/state_processor_genesis_test.go index f784add974..1c4994747c 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -144,6 +144,11 @@ func TestInitialize(t *testing.T) { for _, dep := range deposits { checkValidator(t, cs, beaconState, dep) } + + // check that validator index is duly set + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(deposits)-1), latestValIdx) } func checkValidator( @@ -183,9 +188,4 @@ func checkValidator( case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } - - // check that validator index is duly set - latestValIdx, err := beaconState.GetEth1DepositIndex() - require.NoError(t, err) - require.Equal(t, uint64(len(deposits)-1), latestValIdx) } From 92d494f4d845251681124028224e369b198078fa Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 10:09:43 +0100 Subject: [PATCH 17/77] added UTs to show no withdrawals are made when unnecessary --- .../pkg/core/state_processor_staking_test.go | 183 ++++++++++++++++++ 1 file changed, 183 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_test.go b/mod/state-transition/pkg/core/state_processor_staking_test.go new file mode 100644 index 0000000000..2d20b9f947 --- /dev/null +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -0,0 +1,183 @@ +// 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" +) + +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{} + + 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, + mocksSigner, + ) + + kvStore, err := initTestStore() + require.NoError(t, err) + beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + 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: genDeposits[0].Index, + }, + } + ) + + // here we duly update state root, similarly to what we do in processSlot + genBlockHeader, err := beaconState.GetLatestBlockHeader() + require.NoError(t, err) + genStateRoot := beaconState.HashTreeRoot() + genBlockHeader.SetStateRoot(genStateRoot) + + 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{}, // no withdrawals + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: 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) +} From b395ac227314ffb3cc9eb3d26a199f76fd04de81 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 10:50:00 +0100 Subject: [PATCH 18/77] added validator set cap size to chain specs --- mod/chain-spec/pkg/chain/chain_spec.go | 8 ++++++++ mod/chain-spec/pkg/chain/data.go | 3 +++ mod/config/pkg/spec/testnet.go | 1 + 3 files changed, 12 insertions(+) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 5d65f45e2c..b2e81858df 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -183,6 +183,8 @@ type Spec[ // GetCometBFTConfigForSlot retrieves the CometBFT config for a specific // slot. GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT + + GetValidatorsSetCapSize() uint32 } // chainSpec is a concrete implementation of the ChainSpec interface, holding @@ -476,3 +478,9 @@ func (c chainSpec[ ]) GetCometBFTConfigForSlot(_ SlotT) CometBFTConfigT { return c.Data.CometValues } + +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) GetValidatorsSetCapSize() uint32 { + return c.Data.ValidatorSetCapSize +} diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index 3c3ae2a637..66c6b2074f 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -146,4 +146,7 @@ type SpecData[ // CometValues CometValues CometBFTConfigT `mapstructure:"comet-bft-config"` + + // Validators Set config + ValidatorSetCapSize uint32 `mapstructure:"validator-set-cap-size"` } diff --git a/mod/config/pkg/spec/testnet.go b/mod/config/pkg/spec/testnet.go index a9d2970506..dde1ccad6e 100644 --- a/mod/config/pkg/spec/testnet.go +++ b/mod/config/pkg/spec/testnet.go @@ -123,5 +123,6 @@ func BaseSpec() chain.SpecData[ BytesPerBlob: 131072, KZGCommitmentInclusionProofDepth: 17, CometValues: cmtConsensusParams, + ValidatorSetCapSize: 256, } } From 36fe7749b3ca3b2b799fdb7cad0c409ebebc904a Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 11:03:17 +0100 Subject: [PATCH 19/77] enforce validator set size cap on genesis --- mod/state-transition/pkg/core/errors.go | 4 ++++ .../pkg/core/state_processor_genesis.go | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index a29026a795..6ed702a61e 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -23,6 +23,10 @@ package core import "github.com/berachain/beacon-kit/mod/errors" var ( + // ErrBlockSlotTooLow is returned when we try and add a validator + // that would breach validator set size cap. + ErrHitValidatorsSetCap = errors.New("hit validator set size cap") + // ErrBlockSlotTooLow is returned when the block slot is too low. ErrBlockSlotTooLow = errors.New("block slot too low") diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 9e7502b0df..c93c169127 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -21,6 +21,8 @@ package core import ( + "fmt" + "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/encoding/hex" @@ -106,6 +108,14 @@ func (sp *StateProcessor[ } } + if uint32(len(deposits)) > sp.cs.GetValidatorsSetCapSize() { + return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", + sp.cs.GetValidatorsSetCapSize(), + len(deposits), + ErrHitValidatorsSetCap, + ) + } + for _, deposit := range deposits { if err := sp.processDeposit(st, deposit); err != nil { return nil, err From e64bc749f181a481127533e18a31a0e6e2ea99fc Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 11:13:01 +0100 Subject: [PATCH 20/77] appease gosec --- mod/state-transition/pkg/core/state_processor.go | 11 ++--------- .../pkg/core/state_processor_genesis.go | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index df473e6ebc..62999c31e9 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -282,22 +282,15 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { - // process the freshly created header. if err := sp.processBlockHeader(st, blk); err != nil { return err } - // process the execution payload. - if err := sp.processExecutionPayload( - ctx, st, blk, - ); err != nil { + if err := sp.processExecutionPayload(ctx, st, blk); err != nil { return err } - // process the withdrawals. - if err := sp.processWithdrawals( - st, blk.GetBody(), - ); err != nil { + if err := sp.processWithdrawals(st, blk.GetBody()); err != nil { return err } diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index c93c169127..e003b36aa4 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -108,6 +108,7 @@ func (sp *StateProcessor[ } } + //#nosec:G701 // can't overflow. if uint32(len(deposits)) > sp.cs.GetValidatorsSetCapSize() { return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", sp.cs.GetValidatorsSetCapSize(), From c6c68c3b26ab064a8ce86e5ae9bca53b703abafc Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 12:17:14 +0100 Subject: [PATCH 21/77] mark extra validators as withdrawable --- mod/consensus-types/pkg/types/validator.go | 4 +++ .../pkg/core/state_processor_staking.go | 32 ++++++++++++++++--- mod/state-transition/pkg/core/types.go | 2 ++ 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/mod/consensus-types/pkg/types/validator.go b/mod/consensus-types/pkg/types/validator.go index 21c25287aa..a0e4640dc0 100644 --- a/mod/consensus-types/pkg/types/validator.go +++ b/mod/consensus-types/pkg/types/validator.go @@ -313,6 +313,10 @@ func (v *Validator) SetEffectiveBalance(balance math.Gwei) { v.EffectiveBalance = balance } +func (v *Validator) SetWithdrawableEpoch(e math.Epoch) { + v.WithdrawableEpoch = e +} + // GetWithdrawableEpoch returns the epoch when the validator can withdraw. func (v Validator) GetWithdrawableEpoch() math.Epoch { return v.WithdrawableEpoch diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a798b1fcfc..d784aa6edb 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -191,16 +191,38 @@ func (sp *StateProcessor[ math.Gwei(sp.cs.MaxEffectiveBalance()), ) - // TODO: This is a bug that lives on bArtio. Delete this eventually. - if sp.cs.DepositEth1ChainID() == bArtioChainID { - if err := st.AddValidatorBartio(val); err != nil { + // BeaconKit enforces a cap on the validator set size. If a deposit is made + // that would breach the cap, we mark the validator as immediately + // withdrawable, so that it will be evicted in the next block along with + // the amount deposited. + validators, err := st.GetValidators() + if err != nil { + return err + } + + //#nosec:G701 // can't overflow. + if uint32(len(validators)) >= sp.cs.GetValidatorsSetCapSize() { + var slot math.Slot + slot, err = st.GetSlot() + if err != nil { return err } - } else if err := st.AddValidator(val); err != nil { + + epoch := sp.cs.SlotToEpoch(slot) + val.SetWithdrawableEpoch(epoch) + } + + // TODO: This is a bug that lives on bArtio. Delete this eventually. + if sp.cs.DepositEth1ChainID() == bArtioChainID { + return st.AddValidatorBartio(val) + } + + if err = st.AddValidator(val); err != nil { return err } - idx, err := st.ValidatorIndexByPubkey(val.GetPubkey()) + var idx math.U64 + idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) if err != nil { return err } diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index 26ef877923..a3fc31e96f 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -232,6 +232,8 @@ type Validator[ SetEffectiveBalance(math.Gwei) // GetWithdrawableEpoch returns the epoch when the validator can withdraw. GetWithdrawableEpoch() math.Epoch + + SetWithdrawableEpoch(math.Epoch) } type Validators interface { From 37542a099423f7cf95224d383cb4a9cf39a54291 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 12:26:15 +0100 Subject: [PATCH 22/77] nit --- mod/state-transition/pkg/core/state_processor_genesis.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index e003b36aa4..9dd0128640 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -108,6 +108,8 @@ func (sp *StateProcessor[ } } + // BeaconKit enforces a cap on the validator set size. + // If genesis deposits breaches the cap we return an error. //#nosec:G701 // can't overflow. if uint32(len(deposits)) > sp.cs.GetValidatorsSetCapSize() { return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", From ea69a3566373e5cc87fc873bfb92ecdede6caa7d Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 12:50:50 +0100 Subject: [PATCH 23/77] avoid double validators set cap checks on genesis --- .../pkg/core/state_processor_staking.go | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index d784aa6edb..37893ecfda 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -191,25 +191,27 @@ func (sp *StateProcessor[ math.Gwei(sp.cs.MaxEffectiveBalance()), ) - // BeaconKit enforces a cap on the validator set size. If a deposit is made - // that would breach the cap, we mark the validator as immediately - // withdrawable, so that it will be evicted in the next block along with - // the amount deposited. - validators, err := st.GetValidators() - if err != nil { - return err - } - - //#nosec:G701 // can't overflow. - if uint32(len(validators)) >= sp.cs.GetValidatorsSetCapSize() { - var slot math.Slot - slot, err = st.GetSlot() + if !sp.processingGenesis { + // BeaconKit enforces a cap on the validator set size. If a deposit is made + // that would breach the cap, we mark the validator as immediately + // withdrawable, so that it will be evicted in the next block along with + // the amount deposited. + validators, err := st.GetValidators() if err != nil { return err } - epoch := sp.cs.SlotToEpoch(slot) - val.SetWithdrawableEpoch(epoch) + //#nosec:G701 // can't overflow. + if uint32(len(validators)) >= sp.cs.GetValidatorsSetCapSize() { + var slot math.Slot + slot, err = st.GetSlot() + if err != nil { + return err + } + + epoch := sp.cs.SlotToEpoch(slot) + val.SetWithdrawableEpoch(epoch) + } } // TODO: This is a bug that lives on bArtio. Delete this eventually. @@ -217,12 +219,11 @@ func (sp *StateProcessor[ return st.AddValidatorBartio(val) } - if err = st.AddValidator(val); err != nil { + if err := st.AddValidator(val); err != nil { return err } - var idx math.U64 - idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) + idx, err := st.ValidatorIndexByPubkey(val.GetPubkey()) if err != nil { return err } From af43b9374b1e4bcbfb0ba743c3bac8527a68c093 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 13:46:50 +0100 Subject: [PATCH 24/77] add UT showing extra validator is added ready for withdrawal --- .../pkg/core/state_processor_staking_test.go | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) 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 2d20b9f947..7eba43fae5 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -21,11 +21,13 @@ package core_test import ( + "strconv" "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/bytes" "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" @@ -181,3 +183,157 @@ func TestTransitionUpdateValidators(t *testing.T) { require.NoError(t, err) require.Equal(t, uint64(len(genDeposits)), latestValIdx) } + +func TestTransitionHittingValidatorsCap(t *testing.T) { + // Create state processor to test + cs := spec.BetnetChainSpec() + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} + + 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, + mocksSigner, + ) + + kvStore, err := initTestStore() + require.NoError(t, err) + beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + 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 = make([]*types.Deposit, 0, cs.GetValidatorsSetCapSize()) + valPKSeed = 2024 // seed used to generate unique PK for validators + genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genVersion = version.FromUint32[common.Version](version.Deneb) + ) + + // let genesis define all available validators + for idx := range cs.GetValidatorsSetCapSize() { + var key bytes.B48 + key, valPKSeed = generateTestPK(t, valPKSeed) + + genDeposits = append(genDeposits, + &types.Deposit{ + Pubkey: key, + Credentials: emptyCredentials, + Amount: maxBalance, + Index: uint64(idx), + }, + ) + } + + 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 + extraValKey, _ := generateTestPK(t, valPKSeed) + var ( + ctx = &transition.Context{ + SkipPayloadVerification: true, + SkipValidateResult: true, + } + blkDeposits = []*types.Deposit{ + { + Pubkey: extraValKey, + Credentials: emptyCredentials, + Amount: minBalance, // avoid breaching maxBalance + Index: genDeposits[0].Index, + }, + } + ) + + // here we duly update state root, similarly to what we do in processSlot + genBlockHeader, err := beaconState.GetLatestBlockHeader() + require.NoError(t, err) + genStateRoot := beaconState.HashTreeRoot() + genBlockHeader.SetStateRoot(genStateRoot) + + 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{}, // no withdrawals + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: blkDeposits, + }, + } + + // run the test + vals, err := sp.Transition(ctx, beaconState, blk) + + // check outputs + require.NoError(t, err) + require.Zero(t, vals) // no new validators (with minimal weight) + + // check extra validator is added with Withdraw epoch duly set + idx, err := beaconState.ValidatorIndexByPubkey(blkDeposits[0].Pubkey) + require.NoError(t, err) + val, err := beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, blkDeposits[0].Pubkey, val.Pubkey) + require.Equal(t, blkDeposits[0].Amount, val.EffectiveBalance) + require.Equal(t, math.Slot(0), val.WithdrawableEpoch) + + // TODO: Add next block and show withdrawals for extra validator are added +} + +func generateTestPK(t *testing.T, valPKSeed int) (bytes.B48, int) { + t.Helper() + keyStr := strconv.Itoa(valPKSeed) + keyBytes := bytes.ExtendToSize([]byte(keyStr), bytes.B48Size) + key, err := bytes.ToBytes48(keyBytes) + require.NoError(t, err) + valPKSeed++ + return key, valPKSeed +} From a728bcbf6a999b967469726ccf7c8cd96e158d1b Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 14:12:11 +0100 Subject: [PATCH 25/77] extend UT to show extra validator deposit is withdrawn --- .../pkg/core/state/statedb.go | 9 +- .../pkg/core/state_processor_staking_test.go | 132 +++++++++++++----- 2 files changed, 100 insertions(+), 41 deletions(-) diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 9edb37d595..18e4988ed0 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -251,6 +251,9 @@ func (s *StateDB[ withdrawalAddress, balance, )) + + // Increment the withdrawal index to process the next withdrawal. + withdrawalIndex++ } else if validator.IsPartiallyWithdrawable( balance, math.Gwei(s.cs.MaxEffectiveBalance()), ) { @@ -260,10 +263,10 @@ func (s *StateDB[ withdrawalAddress, balance-math.Gwei(s.cs.MaxEffectiveBalance()), )) - } - // Increment the withdrawal index to process the next withdrawal. - withdrawalIndex++ + // Increment the withdrawal index to process the next withdrawal. + withdrawalIndex++ + } // Cap the number of withdrawals to the maximum allowed per payload. //#nosec:G701 // won't overflow in practice. 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 7eba43fae5..0749bcdf7d 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -39,6 +39,8 @@ import ( "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() @@ -136,12 +138,7 @@ func TestTransitionUpdateValidators(t *testing.T) { } ) - // here we duly update state root, similarly to what we do in processSlot - genBlockHeader, err := beaconState.GetLatestBlockHeader() - require.NoError(t, err) - genStateRoot := beaconState.HashTreeRoot() - genBlockHeader.SetStateRoot(genStateRoot) - + genBlockHeader := updateStateRootForLatestBlock(t, beaconState) blk := &types.BeaconBlock{ Slot: genBlockHeader.GetSlot() + 1, ProposerIndex: genBlockHeader.GetProposerIndex(), @@ -184,6 +181,9 @@ func TestTransitionUpdateValidators(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) } +// TestTransitionHittingValidatorsCap shows that no extra +// validators are added when validators set is at cap and +// that deposit of the extra validator are withdrawed. func TestTransitionHittingValidatorsCap(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -220,35 +220,35 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { kvStore, err := initTestStore() require.NoError(t, err) - beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) + bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) - emptyAddress = common.ExecutionAddress{} - emptyCredentials = types.NewCredentialsFromExecutionAddress( - emptyAddress, - ) + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + rndSeed = 2024 // seed used to generate unique random value ) // Setup initial state via genesis // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorsSetCapSize()) - valPKSeed = 2024 // seed used to generate unique PK for validators genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators for idx := range cs.GetValidatorsSetCapSize() { - var key bytes.B48 - key, valPKSeed = generateTestPK(t, valPKSeed) + var ( + key bytes.B48 + creds types.WithdrawalCredentials + ) + key, rndSeed = generateTestPK(t, rndSeed) + creds, _, rndSeed = generateTestExecutionAddress(t, rndSeed) genDeposits = append(genDeposits, &types.Deposit{ Pubkey: key, - Credentials: emptyCredentials, + Credentials: creds, Amount: maxBalance, Index: uint64(idx), }, @@ -261,7 +261,7 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { ).Return(nil) _, err = sp.InitializePreminedBeaconStateFromEth1( - beaconState, + bs, genDeposits, genPayloadHeader, genVersion, @@ -269,7 +269,8 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { require.NoError(t, err) // create test inputs - extraValKey, _ := generateTestPK(t, valPKSeed) + extraValKey, rndSeed := generateTestPK(t, rndSeed) + extraValCreds, extraValAddr, _ := generateTestExecutionAddress(t, rndSeed) var ( ctx = &transition.Context{ SkipPayloadVerification: true, @@ -278,20 +279,15 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { blkDeposits = []*types.Deposit{ { Pubkey: extraValKey, - Credentials: emptyCredentials, + Credentials: extraValCreds, Amount: minBalance, // avoid breaching maxBalance Index: genDeposits[0].Index, }, } ) - // here we duly update state root, similarly to what we do in processSlot - genBlockHeader, err := beaconState.GetLatestBlockHeader() - require.NoError(t, err) - genStateRoot := beaconState.HashTreeRoot() - genBlockHeader.SetStateRoot(genStateRoot) - - blk := &types.BeaconBlock{ + genBlockHeader := updateStateRootForLatestBlock(t, bs) + blk1 := &types.BeaconBlock{ Slot: genBlockHeader.GetSlot() + 1, ProposerIndex: genBlockHeader.GetProposerIndex(), ParentRoot: genBlockHeader.HashTreeRoot(), @@ -310,30 +306,90 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { } // run the test - vals, err := sp.Transition(ctx, beaconState, blk) + vals1, err := sp.Transition(ctx, bs, blk1) // check outputs require.NoError(t, err) - require.Zero(t, vals) // no new validators (with minimal weight) + require.Zero(t, vals1) // no new validators (with minimal weight) // check extra validator is added with Withdraw epoch duly set - idx, err := beaconState.ValidatorIndexByPubkey(blkDeposits[0].Pubkey) + extraValIdx, err := bs.ValidatorIndexByPubkey(blkDeposits[0].Pubkey) require.NoError(t, err) - val, err := beaconState.ValidatorByIndex(idx) + extraVal, err := bs.ValidatorByIndex(extraValIdx) require.NoError(t, err) - require.Equal(t, blkDeposits[0].Pubkey, val.Pubkey) - require.Equal(t, blkDeposits[0].Amount, val.EffectiveBalance) - require.Equal(t, math.Slot(0), val.WithdrawableEpoch) + require.Equal(t, blkDeposits[0].Pubkey, extraVal.Pubkey) + require.Equal(t, blkDeposits[0].Amount, extraVal.EffectiveBalance) + require.Equal(t, math.Slot(0), extraVal.WithdrawableEpoch) // TODO: Add next block and show withdrawals for extra validator are added + blk1Header := updateStateRootForLatestBlock(t, bs) + blk2 := &types.BeaconBlock{ + Slot: blk1Header.GetSlot() + 1, + ProposerIndex: blk1Header.GetProposerIndex(), + ParentRoot: blk1Header.HashTreeRoot(), + StateRoot: common.Root{}, + Body: &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: extraValIdx, + Address: extraValAddr, + Amount: extraVal.EffectiveBalance, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: blkDeposits, + }, + } + + // run the test + vals2, err := sp.Transition(ctx, bs, blk2) + require.NoError(t, err) + require.Zero(t, vals2) // no new validators +} + +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 +} + +func generateTestExecutionAddress( + t *testing.T, + rndSeed int, +) (types.WithdrawalCredentials, common.ExecutionAddress, int) { + t.Helper() + + addrStr := strconv.Itoa(rndSeed) + addrBytes := bytes.ExtendToSize([]byte(addrStr), bytes.B20Size) + execAddr, err := bytes.ToBytes20(addrBytes) + require.NoError(t, err) + rndSeed++ + return types.NewCredentialsFromExecutionAddress( + common.ExecutionAddress(execAddr), + ), common.ExecutionAddress(execAddr), rndSeed } -func generateTestPK(t *testing.T, valPKSeed int) (bytes.B48, int) { +func generateTestPK(t *testing.T, rndSeed int) (bytes.B48, int) { t.Helper() - keyStr := strconv.Itoa(valPKSeed) + keyStr := strconv.Itoa(rndSeed) keyBytes := bytes.ExtendToSize([]byte(keyStr), bytes.B48Size) key, err := bytes.ToBytes48(keyBytes) require.NoError(t, err) - valPKSeed++ - return key, valPKSeed + rndSeed++ + return key, rndSeed } From 97fba5c10bc789a42659adb1048e509a00f2c862 Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 14:56:26 +0100 Subject: [PATCH 26/77] fix withdrawal index update --- mod/state-transition/pkg/core/state/statedb.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/state/statedb.go b/mod/state-transition/pkg/core/state/statedb.go index 9edb37d595..18e4988ed0 100644 --- a/mod/state-transition/pkg/core/state/statedb.go +++ b/mod/state-transition/pkg/core/state/statedb.go @@ -251,6 +251,9 @@ func (s *StateDB[ withdrawalAddress, balance, )) + + // Increment the withdrawal index to process the next withdrawal. + withdrawalIndex++ } else if validator.IsPartiallyWithdrawable( balance, math.Gwei(s.cs.MaxEffectiveBalance()), ) { @@ -260,10 +263,10 @@ func (s *StateDB[ withdrawalAddress, balance-math.Gwei(s.cs.MaxEffectiveBalance()), )) - } - // Increment the withdrawal index to process the next withdrawal. - withdrawalIndex++ + // Increment the withdrawal index to process the next withdrawal. + withdrawalIndex++ + } // Cap the number of withdrawals to the maximum allowed per payload. //#nosec:G701 // won't overflow in practice. From af8c5e0cda68b29d22de20d9a3c26dd692f5b6ab Mon Sep 17 00:00:00 2001 From: gummy Date: Fri, 1 Nov 2024 11:16:26 -0400 Subject: [PATCH 27/77] fix(build): erigon repo --- build/scripts/testing.mk | 4 ++-- kurtosis/beaconkit-all.yaml | 2 +- kurtosis/beaconkit-base-gcp.yaml | 2 +- kurtosis/src/nodes/nodes.star | 2 +- testing/e2e/config/config.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/scripts/testing.mk b/build/scripts/testing.mk index 4606bcb27e..63aa559979 100644 --- a/build/scripts/testing.mk +++ b/build/scripts/testing.mk @@ -202,7 +202,7 @@ start-erigon: ## start an ephemeral `erigon` node docker run \ --rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \ -v $(PWD)/.tmp:/.tmp \ - thorax/erigon:latest init \ + erigontech/erigon:latest init \ --datadir .tmp/erigon \ ${ETH_GENESIS_PATH} @@ -212,7 +212,7 @@ start-erigon: ## start an ephemeral `erigon` node -p 8551:8551 \ --rm -v $(PWD)/${TESTAPP_FILES_DIR}:/${TESTAPP_FILES_DIR} \ -v $(PWD)/.tmp:/.tmp \ - thorax/erigon:latest \ + erigontech/erigon:latest \ --http \ --http.addr 0.0.0.0 \ --http.api eth,net \ diff --git a/kurtosis/beaconkit-all.yaml b/kurtosis/beaconkit-all.yaml index 51ec2c25b8..ca38639165 100644 --- a/kurtosis/beaconkit-all.yaml +++ b/kurtosis/beaconkit-all.yaml @@ -93,7 +93,7 @@ node_settings: max_memory: 2048 images: besu: hyperledger/besu:24.5.4 - erigon: thorax/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.1 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/beaconkit-base-gcp.yaml b/kurtosis/beaconkit-base-gcp.yaml index 8fe056d0ee..a2229d4971 100644 --- a/kurtosis/beaconkit-base-gcp.yaml +++ b/kurtosis/beaconkit-base-gcp.yaml @@ -88,7 +88,7 @@ node_settings: max_memory: 32768 images: besu: hyperledger/besu:latest - erigon: thorax/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.1 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/src/nodes/nodes.star b/kurtosis/src/nodes/nodes.star index 705f0b2339..cae4d7233c 100644 --- a/kurtosis/src/nodes/nodes.star +++ b/kurtosis/src/nodes/nodes.star @@ -33,7 +33,7 @@ EXECUTION_DEFAULT_SETTINGS = { }, "images": { "besu": "hyperledger/besu:latest", - "erigon": "thorax/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.1", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:latest", "nethermind": "nethermind/nethermind:latest", diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index ae93473c43..9af5cc858f 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -272,7 +272,7 @@ func defaultExecutionSettings() ExecutionSettings { }, Images: map[string]string{ "besu": "hyperledger/besu:24.5.4", - "erigon": "thorax/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.1", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:stable", "nethermind": "nethermind/nethermind:latest", From 023ebfdf3f1be0ce53129ed5cc88c66961c20f97 Mon Sep 17 00:00:00 2001 From: gummy Date: Fri, 1 Nov 2024 11:49:56 -0400 Subject: [PATCH 28/77] fix(build): bump erigon to recent version --- kurtosis/beaconkit-all.yaml | 2 +- kurtosis/beaconkit-base-gcp.yaml | 2 +- kurtosis/src/nodes/nodes.star | 2 +- testing/e2e/config/config.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kurtosis/beaconkit-all.yaml b/kurtosis/beaconkit-all.yaml index ca38639165..83ce38a2a4 100644 --- a/kurtosis/beaconkit-all.yaml +++ b/kurtosis/beaconkit-all.yaml @@ -93,7 +93,7 @@ node_settings: max_memory: 2048 images: besu: hyperledger/besu:24.5.4 - erigon: erigontech/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.9 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/beaconkit-base-gcp.yaml b/kurtosis/beaconkit-base-gcp.yaml index a2229d4971..5692730acd 100644 --- a/kurtosis/beaconkit-base-gcp.yaml +++ b/kurtosis/beaconkit-base-gcp.yaml @@ -88,7 +88,7 @@ node_settings: max_memory: 32768 images: besu: hyperledger/besu:latest - erigon: erigontech/erigon:v2.60.1 + erigon: erigontech/erigon:v2.60.9 ethereumjs: ethpandaops/ethereumjs:stable geth: ethereum/client-go:latest nethermind: nethermind/nethermind:latest diff --git a/kurtosis/src/nodes/nodes.star b/kurtosis/src/nodes/nodes.star index cae4d7233c..cd2d7a07a3 100644 --- a/kurtosis/src/nodes/nodes.star +++ b/kurtosis/src/nodes/nodes.star @@ -33,7 +33,7 @@ EXECUTION_DEFAULT_SETTINGS = { }, "images": { "besu": "hyperledger/besu:latest", - "erigon": "erigontech/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.9", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:latest", "nethermind": "nethermind/nethermind:latest", diff --git a/testing/e2e/config/config.go b/testing/e2e/config/config.go index 9af5cc858f..00b99de235 100644 --- a/testing/e2e/config/config.go +++ b/testing/e2e/config/config.go @@ -272,7 +272,7 @@ func defaultExecutionSettings() ExecutionSettings { }, Images: map[string]string{ "besu": "hyperledger/besu:24.5.4", - "erigon": "erigontech/erigon:v2.60.1", + "erigon": "erigontech/erigon:v2.60.9", "ethereumjs": "ethpandaops/ethereumjs:stable", "geth": "ethereum/client-go:stable", "nethermind": "nethermind/nethermind:latest", From d66b2983bdc6ff91ebe11dabbf74bbc00caab64f Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 1 Nov 2024 18:32:21 +0100 Subject: [PATCH 29/77] nits from code review --- mod/state-transition/pkg/core/state_processor_staking.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index a798b1fcfc..3f5b044f31 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -88,13 +88,18 @@ func (sp *StateProcessor[ var nextDepositIndex uint64 switch depositIndex, err := st.GetEth1DepositIndex(); { case err == nil: + // just increment the deposit index if no error nextDepositIndex = depositIndex + 1 case sp.processingGenesis && err != nil: - // Eth1DepositIndex may have not been set yet + // If errored and still processing genesis, + // Eth1DepositIndex may have not been set yet. nextDepositIndex = 0 default: // Failed retrieving Eth1DepositIndex outside genesis is an error - return fmt.Errorf("failed retrieving eth1 deposit index: %w", err) + return fmt.Errorf( + "failed retrieving eth1 deposit index outside of processing genesis: %w", + err, + ) } if err := st.SetEth1DepositIndex(nextDepositIndex); err != nil { From d8a267e54deac666c294dfe4d6a56781ca5930ee Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 4 Nov 2024 15:18:39 +0100 Subject: [PATCH 30/77] hacked fix for withdrawals SSZ serialization --- mod/consensus-types/pkg/types/payload.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/consensus-types/pkg/types/payload.go b/mod/consensus-types/pkg/types/payload.go index 83cb2a3ec9..b2ba081cbc 100644 --- a/mod/consensus-types/pkg/types/payload.go +++ b/mod/consensus-types/pkg/types/payload.go @@ -128,6 +128,11 @@ func (p *ExecutionPayload) DefineSSZ(codec *ssz.Codec) { constants.MaxBytesPerTx, ) ssz.DefineSliceOfStaticObjectsContent(codec, &p.Withdrawals, 16) + + // TODO: hack to avoid failure of EL checks on withdrawals + if p.Withdrawals == nil { + p.Withdrawals = make([]*engineprimitives.Withdrawal, 0) + } } // MarshalSSZ serializes the ExecutionPayload object into a slice of bytes. From 32fbbbc02c8c9544739f1271717f85fc9c6de1ee Mon Sep 17 00:00:00 2001 From: aBear Date: Tue, 5 Nov 2024 00:13:59 +0100 Subject: [PATCH 31/77] nits --- mod/chain-spec/pkg/chain/chain_spec.go | 4 ++++ mod/consensus-types/pkg/types/validator.go | 1 + mod/state-transition/pkg/core/errors.go | 2 +- mod/state-transition/pkg/core/types.go | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index b2e81858df..fdb379c0f4 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -184,6 +184,8 @@ type Spec[ // slot. GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT + // GetValidatorSetCap retrieves the maximum number of validators + // allowed in the active set. GetValidatorsSetCapSize() uint32 } @@ -479,6 +481,8 @@ func (c chainSpec[ return c.Data.CometValues } +// GetValidatorSetCap retrieves the maximum number of validators +// allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, ]) GetValidatorsSetCapSize() uint32 { diff --git a/mod/consensus-types/pkg/types/validator.go b/mod/consensus-types/pkg/types/validator.go index a0e4640dc0..3357dc9655 100644 --- a/mod/consensus-types/pkg/types/validator.go +++ b/mod/consensus-types/pkg/types/validator.go @@ -313,6 +313,7 @@ func (v *Validator) SetEffectiveBalance(balance math.Gwei) { v.EffectiveBalance = balance } +// SetWithdrawableEpoch sets the epoch when the validator can withdraw. func (v *Validator) SetWithdrawableEpoch(e math.Epoch) { v.WithdrawableEpoch = e } diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index 6ed702a61e..6b39d43b7a 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -23,7 +23,7 @@ package core import "github.com/berachain/beacon-kit/mod/errors" var ( - // ErrBlockSlotTooLow is returned when we try and add a validator + // ErrValidatorSetCapHit is returned when we try and add a validator // that would breach validator set size cap. ErrHitValidatorsSetCap = errors.New("hit validator set size cap") diff --git a/mod/state-transition/pkg/core/types.go b/mod/state-transition/pkg/core/types.go index a3fc31e96f..8ef7ed8eef 100644 --- a/mod/state-transition/pkg/core/types.go +++ b/mod/state-transition/pkg/core/types.go @@ -232,7 +232,7 @@ type Validator[ SetEffectiveBalance(math.Gwei) // GetWithdrawableEpoch returns the epoch when the validator can withdraw. GetWithdrawableEpoch() math.Epoch - + // SetWithdrawableEpoch sets the epoch when the validator can withdraw. SetWithdrawableEpoch(math.Epoch) } From ebff958b6f7c68451d6fd30d5b041a3581ab4e33 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 12:48:45 +0100 Subject: [PATCH 32/77] nit --- mod/chain-spec/pkg/chain/chain_spec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index fdb379c0f4..3b6b763020 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -184,7 +184,7 @@ type Spec[ // slot. GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT - // GetValidatorSetCap retrieves the maximum number of validators + // GetValidatorsSetCapSize retrieves the maximum number of validators // allowed in the active set. GetValidatorsSetCapSize() uint32 } @@ -481,7 +481,7 @@ func (c chainSpec[ return c.Data.CometValues } -// GetValidatorSetCap retrieves the maximum number of validators +// GetValidatorsSetCapSize retrieves the maximum number of validators // allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, From f51b15711f808409dfba67b1e55269cf69b60be1 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 15:42:02 +0100 Subject: [PATCH 33/77] renamed GetValidatorSetCapSize --- mod/chain-spec/pkg/chain/chain_spec.go | 8 ++++---- mod/state-transition/pkg/core/state_processor_genesis.go | 4 ++-- mod/state-transition/pkg/core/state_processor_staking.go | 2 +- .../pkg/core/state_processor_staking_test.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 3b6b763020..f0cf409522 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -184,9 +184,9 @@ type Spec[ // slot. GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT - // GetValidatorsSetCapSize retrieves the maximum number of validators + // GetValidatorSetCapSize retrieves the maximum number of validators // allowed in the active set. - GetValidatorsSetCapSize() uint32 + GetValidatorSetCapSize() uint32 } // chainSpec is a concrete implementation of the ChainSpec interface, holding @@ -481,10 +481,10 @@ func (c chainSpec[ return c.Data.CometValues } -// GetValidatorsSetCapSize retrieves the maximum number of validators +// GetValidatorSetCapSize retrieves the maximum number of validators // allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, -]) GetValidatorsSetCapSize() uint32 { +]) GetValidatorSetCapSize() uint32 { return c.Data.ValidatorSetCapSize } diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 9dd0128640..9bf8da485b 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -111,9 +111,9 @@ func (sp *StateProcessor[ // BeaconKit enforces a cap on the validator set size. // If genesis deposits breaches the cap we return an error. //#nosec:G701 // can't overflow. - if uint32(len(deposits)) > sp.cs.GetValidatorsSetCapSize() { + if uint32(len(deposits)) > sp.cs.GetValidatorSetCapSize() { return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", - sp.cs.GetValidatorsSetCapSize(), + sp.cs.GetValidatorSetCapSize(), len(deposits), ErrHitValidatorsSetCap, ) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 3c66b0eb10..bbb40bf999 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -215,7 +215,7 @@ func (sp *StateProcessor[ } //#nosec:G701 // can't overflow. - if uint32(len(validators)) >= sp.cs.GetValidatorsSetCapSize() { + if uint32(len(validators)) >= sp.cs.GetValidatorSetCapSize() { var slot math.Slot slot, err = st.GetSlot() if err != nil { 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 74aa3fb075..651e9f860e 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -245,13 +245,13 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { // Setup initial state via genesis // TODO: consider instead setting state artificially var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorsSetCapSize()) + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators - for idx := range cs.GetValidatorsSetCapSize() { + for idx := range cs.GetValidatorSetCapSize() { var ( key bytes.B48 creds types.WithdrawalCredentials From 5e38855808acc3126fd0f12d488efdee2394157c Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 15:52:59 +0100 Subject: [PATCH 34/77] nits --- .../pkg/core/state_processor_staking_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 651e9f860e..2301ebda7e 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -242,7 +242,7 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { rndSeed = 2024 // seed used to generate unique random value ) - // Setup initial state via genesis + // STEP 1: Setup genesis with GetValidatorSetCapSize validators // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) @@ -282,7 +282,7 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { ) require.NoError(t, err) - // create test inputs + // STEP 2: Try and add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) extraValCreds, extraValAddr, _ := generateTestExecutionAddress(t, rndSeed) var ( @@ -336,7 +336,8 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { require.Equal(t, blkDeposits[0].Amount, extraVal.EffectiveBalance) require.Equal(t, math.Slot(0), extraVal.WithdrawableEpoch) - // TODO: Add next block and show withdrawals for extra validator are added + // STEP 3: show that following block must contain withdrawals for + // the rejected validator blk1Header := updateStateRootForLatestBlock(t, bs) blk2 := &types.BeaconBlock{ Slot: blk1Header.GetSlot() + 1, From bc26a85f31ac7857e099ade9c0fcadc43e2c0205 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 20:48:08 +0100 Subject: [PATCH 35/77] wip: evicting smallest validator rathen than latest --- .../pkg/core/state_processor_staking.go | 129 +++++++++++++++--- 1 file changed, 109 insertions(+), 20 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index bbb40bf999..60f0cbeebb 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -21,7 +21,9 @@ package core import ( + "bytes" "fmt" + "slices" "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "github.com/berachain/beacon-kit/mod/errors" @@ -204,29 +206,116 @@ func (sp *StateProcessor[ math.Gwei(sp.cs.MaxEffectiveBalance()), ) - if !sp.processingGenesis { - // BeaconKit enforces a cap on the validator set size. If a deposit is made - // that would breach the cap, we mark the validator as immediately - // withdrawable, so that it will be evicted in the next block along with - // the amount deposited. - validators, err := st.GetValidators() - if err != nil { - return err - } + // BeaconKit enforces a cap on the validator set size. If the deposit + // breaches the cap, we find the validator with the smallest stake and + // mark it as withdrawable so that it will be eventually evicted and + // its deposits returned. + capHit, err := sp.isValidatorCapHit(st) + if err != nil { + return err + } + if !capHit { + return sp.addValidatorInternal(st, val, dep.GetAmount()) + } - //#nosec:G701 // can't overflow. - if uint32(len(validators)) >= sp.cs.GetValidatorSetCapSize() { - var slot math.Slot - slot, err = st.GetSlot() - if err != nil { - return err - } + // Adding the validator would breach the cap. Find the validator + // with the smallest stake among current and candidate validators + // and kit it out. + var currSmallestVal ValidatorT + currSmallestVal, err = sp.findSmallestValidator(st) + if err != nil { + return err + } - epoch := sp.cs.SlotToEpoch(slot) - val.SetWithdrawableEpoch(epoch) - } + var slot math.Slot + slot, err = st.GetSlot() + if err != nil { + return err + } + epoch := sp.cs.SlotToEpoch(slot) + + if val.GetEffectiveBalance() <= currSmallestVal.GetEffectiveBalance() { + // in case of tie-break among candidate validator we prefer + // existing one so we mark candidate as withdrawable + val.SetWithdrawableEpoch(epoch) + return sp.addValidatorInternal(st, val, dep.GetAmount()) + } + + // mark exiting validator for eviction and add candidate + currSmallestVal.SetWithdrawableEpoch(epoch) + var idx math.U64 + idx, err = st.ValidatorIndexByPubkey(currSmallestVal.GetPubkey()) + if err != nil { + return err + } + if err = st.UpdateValidatorAtIndex(idx, currSmallestVal); err != nil { + return err + } + return sp.addValidatorInternal(st, val, dep.GetAmount()) +} + +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, +]) isValidatorCapHit(st BeaconStateT) (bool, error) { + if sp.processingGenesis { + // minor optimization: we do check in Genesis that + // validators do no exceed cap. So hitting cap here + // should never happen + return false, nil + } + validators, err := st.GetValidators() + if err != nil { + return false, err + } + return uint32(len(validators)) >= sp.cs.GetValidatorSetCapSize(), nil +} + +// TODO: consider moving this to BeaconState directly +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, DepositT, _, _, _, _, _, _, ValidatorT, _, _, _, _, +]) findSmallestValidator(st BeaconStateT) ( + ValidatorT, + error, +) { + var smallestVal ValidatorT + + // candidateVal would breach the cap. Find the validator with the + // smallest stake among current and candidate validators. + currentVals, err := st.GetValidatorsByEffectiveBalance() + if err != nil { + return smallestVal, err } + // TODO: consider heapifying slice instead. We only care about the smallest + slices.SortFunc(currentVals, func(lhs, rhs ValidatorT) int { + var ( + val1Stake = lhs.GetEffectiveBalance() + val2Stake = rhs.GetEffectiveBalance() + ) + switch { + case val1Stake < val2Stake: + return -1 + case val1Stake > val2Stake: + return 1 + default: + // validators pks are guaranteed to be different + var ( + val1Pk = lhs.GetPubkey() + val2Pk = rhs.GetPubkey() + ) + return bytes.Compare(val1Pk[:], val2Pk[:]) + } + }) + return currentVals[0], nil +} + +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, +]) addValidatorInternal( + st BeaconStateT, + val ValidatorT, + depositAmount math.Gwei, +) error { // TODO: This is a bug that lives on bArtio. Delete this eventually. if sp.cs.DepositEth1ChainID() == bArtioChainID { // Note in AddValidatorBartio we implicitly increase @@ -241,7 +330,7 @@ func (sp *StateProcessor[ if err != nil { return err } - return st.IncreaseBalance(idx, dep.GetAmount()) + return st.IncreaseBalance(idx, depositAmount) } // processWithdrawals as per the Ethereum 2.0 specification. From 401ab1ae4159a962b11336ca0fb0f9412d3883bf Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 22:04:33 +0100 Subject: [PATCH 36/77] improved UTs --- .../pkg/core/state_processor_staking_test.go | 243 ++++++++++++++++-- 1 file changed, 215 insertions(+), 28 deletions(-) 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 2301ebda7e..19db58b9a1 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -29,6 +29,7 @@ import ( 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" + "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/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" @@ -163,11 +164,8 @@ func TestTransitionUpdateValidators(t *testing.T) { } // run the test - vals, err := sp.Transition(ctx, beaconState, blk) - - // check outputs + _, err = sp.Transition(ctx, beaconState, blk) 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 @@ -191,10 +189,11 @@ func TestTransitionUpdateValidators(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) } -// TestTransitionHittingValidatorsCap shows that no extra -// validators are added when validators set is at cap and -// that deposit of the extra validator are withdrawed. -func TestTransitionHittingValidatorsCap(t *testing.T) { +// TestTransitionHittingValidatorsCap shows that the extra +// validator added when validators set is at cap is immediately +// scheduled for withdrawal along with its deposit if it does not +// improve staked amount. +func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() execEngine := mocks.NewExecutionEngine[ @@ -238,7 +237,6 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { var ( maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) rndSeed = 2024 // seed used to generate unique random value ) @@ -291,13 +289,11 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { SkipValidateResult: true, ProposerAddress: dummyProposerAddr, } - blkDeposits = []*types.Deposit{ - { - Pubkey: extraValKey, - Credentials: extraValCreds, - Amount: minBalance, // avoid breaching maxBalance - Index: genDeposits[0].Index, - }, + extraValDeposit = &types.Deposit{ + Pubkey: extraValKey, + Credentials: extraValCreds, + Amount: maxBalance, + Index: uint64(len(genDeposits)), } ) @@ -316,26 +312,26 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { BaseFeePerGas: math.NewU256(0), }, Eth1Data: &types.Eth1Data{}, - Deposits: blkDeposits, + Deposits: []*types.Deposit{extraValDeposit}, }, } // run the test - vals1, err := sp.Transition(ctx, bs, blk1) - - // check outputs + _, err = sp.Transition(ctx, bs, blk1) require.NoError(t, err) - require.Zero(t, vals1) // no new validators (with minimal weight) // check extra validator is added with Withdraw epoch duly set - extraValIdx, err := bs.ValidatorIndexByPubkey(blkDeposits[0].Pubkey) + extraValIdx, err := bs.ValidatorIndexByPubkey(extraValDeposit.Pubkey) require.NoError(t, err) extraVal, err := bs.ValidatorByIndex(extraValIdx) require.NoError(t, err) - require.Equal(t, blkDeposits[0].Pubkey, extraVal.Pubkey) - require.Equal(t, blkDeposits[0].Amount, extraVal.EffectiveBalance) + require.Equal(t, extraValDeposit.Pubkey, extraVal.Pubkey) require.Equal(t, math.Slot(0), extraVal.WithdrawableEpoch) + extraValBalance, err := bs.GetBalance(extraValIdx) + require.NoError(t, err) + require.Equal(t, extraValDeposit.Amount, extraValBalance) + // STEP 3: show that following block must contain withdrawals for // the rejected validator blk1Header := updateStateRootForLatestBlock(t, bs) @@ -354,20 +350,211 @@ func TestTransitionHittingValidatorsCap(t *testing.T) { Index: 0, Validator: extraValIdx, Address: extraValAddr, - Amount: extraVal.EffectiveBalance, + Amount: extraValDeposit.Amount, }, }, BaseFeePerGas: math.NewU256(0), }, Eth1Data: &types.Eth1Data{}, - Deposits: blkDeposits, + Deposits: []*types.Deposit{}, + }, + } + + // run the test + _, err = sp.Transition(ctx, bs, blk2) + require.NoError(t, err) +} + +// TestTransitionHittingValidatorsCap shows that if the extra +// validator added when validators set is at cap improves amount staked +// an existing validator is immediately scheduled for withdrawal +// along with its deposit. +func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { + // Create state processor to test + cs := spec.BetnetChainSpec() + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} + dummyProposerAddr := []byte{0xff} + + 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, + mocksSigner, + func(bytes.B48) ([]byte, error) { + return dummyProposerAddr, nil + }, + ) + + kvStore, err := initTestStore() + require.NoError(t, err) + bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + rndSeed = 2024 // seed used to generate unique random value + ) + + // STEP 1: Setup genesis with GetValidatorSetCapSize validators + // TODO: consider instead setting state artificially + var ( + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) + genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genVersion = version.FromUint32[common.Version](version.Deneb) + ) + + // let genesis define all available validators + genAddresses := make([]common.ExecutionAddress, 0) + for idx := range cs.GetValidatorSetCapSize() { + var ( + key bytes.B48 + creds types.WithdrawalCredentials + addr common.ExecutionAddress + ) + key, rndSeed = generateTestPK(t, rndSeed) + creds, addr, rndSeed = generateTestExecutionAddress(t, rndSeed) + + genDeposits = append(genDeposits, + &types.Deposit{ + Pubkey: key, + Credentials: creds, + Amount: maxBalance, + Index: uint64(idx), + }, + ) + genAddresses = append(genAddresses, addr) + } + // make a deposit small to be ready for eviction + genDeposits[0].Amount = maxBalance - minBalance + smallestVal := genDeposits[0] + smallestValAddr := genAddresses[0] + + mocksSigner.On( + "VerifySignature", + mock.Anything, mock.Anything, mock.Anything, + ).Return(nil) + + _, err = sp.InitializePreminedBeaconStateFromEth1( + bs, + genDeposits, + genPayloadHeader, + genVersion, + ) + require.NoError(t, err) + + // STEP 2: Add an extra validator + extraValKey, rndSeed := generateTestPK(t, rndSeed) + extraValCreds, _, _ := generateTestExecutionAddress(t, rndSeed) + var ( + ctx = &transition.Context{ + SkipPayloadVerification: true, + SkipValidateResult: true, + ProposerAddress: dummyProposerAddr, + } + extraValDeposit = &types.Deposit{ + Pubkey: extraValKey, + Credentials: extraValCreds, + Amount: maxBalance, + Index: uint64(len(genDeposits)), + } + ) + + genBlockHeader := updateStateRootForLatestBlock(t, bs) + blk1 := &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{}, // no withdrawals + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraValDeposit}, + }, + } + + // run the test + _, err = sp.Transition(ctx, bs, blk1) + require.NoError(t, err) + + // check smallest validator is updated with Withdraw epoch duly set + smallValIdx, err := bs.ValidatorIndexByPubkey(smallestVal.Pubkey) + require.NoError(t, err) + smallVal, err := bs.ValidatorByIndex(smallValIdx) + require.NoError(t, err) + require.Equal(t, math.Slot(0), smallVal.WithdrawableEpoch) + + smallestValBalance, err := bs.GetBalance(smallValIdx) + require.NoError(t, err) + require.Equal(t, smallestVal.Amount, smallestValBalance) + + // check that extra validator is added + extraValIdx, err := bs.ValidatorIndexByPubkey(extraValKey) + require.NoError(t, err) + extraVal, err := bs.ValidatorByIndex(extraValIdx) + require.NoError(t, err) + require.Equal(t, + math.Epoch(constants.FarFutureEpoch), extraVal.WithdrawableEpoch, + ) + + // STEP 3: show that following block must contain withdrawals for + // the evicted, smallest validator + blk1Header := updateStateRootForLatestBlock(t, bs) + blk2 := &types.BeaconBlock{ + Slot: blk1Header.GetSlot() + 1, + ProposerIndex: blk1Header.GetProposerIndex(), + ParentRoot: blk1Header.HashTreeRoot(), + StateRoot: common.Root{}, + Body: &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: smallValIdx, + Address: smallestValAddr, + Amount: smallestVal.Amount, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, } // run the test - vals2, err := sp.Transition(ctx, bs, blk2) + _, err = sp.Transition(ctx, bs, blk2) require.NoError(t, err) - require.Zero(t, vals2) // no new validators } func updateStateRootForLatestBlock( From 9100d91fc5a7d861d6a66504cf7cf6773255c0f2 Mon Sep 17 00:00:00 2001 From: aBear Date: Wed, 6 Nov 2024 22:48:24 +0100 Subject: [PATCH 37/77] leftover --- mod/state-transition/pkg/core/state_processor_staking.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 60f0cbeebb..cafd94e7bf 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -267,6 +267,8 @@ func (sp *StateProcessor[ if err != nil { return false, err } + + //#nosec:G701 // no overflow risk here return uint32(len(validators)) >= sp.cs.GetValidatorSetCapSize(), nil } From 9a7c057e12d54c97bb8e53b976311d90964c3a30 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 09:47:12 +0100 Subject: [PATCH 38/77] consolidated UTs --- mod/state-transition/pkg/core/helpers_test.go | 85 +++++++++- .../pkg/core/state_processor_genesis_test.go | 46 +----- .../pkg/core/state_processor_staking_test.go | 146 ++++-------------- 3 files changed, 119 insertions(+), 158 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 25b71c2035..18734da91e 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,12 +33,17 @@ 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/primitives/pkg/crypto" + "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" "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" ) type ( @@ -77,6 +83,60 @@ type ( ] ) +func testCreateStateProcessor( + cs common.ChainSpec, + execEngine core.ExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ], + signer crypto.BLSSigner, + fGetAddressFromPubKey func(crypto.BLSPubkey) ([]byte, error), +) *core.StateProcessor[ + *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, +] { + return 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, + signer, + fGetAddressFromPubKey, + ) +} + type testKVStoreService struct { ctx sdk.Context } @@ -93,7 +153,7 @@ var ( testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} ) -func initTestStore() ( +func testInitStore() ( *beacondb.KVStore[ *types.BeaconBlockHeader, *types.Eth1Data, @@ -136,3 +196,26 @@ func initTestStore() ( testCodec, ), nil } + +func testBuildNextBlock( + t *testing.T, + beaconState *TestBeaconStateT, + nextBlkBody *types.BeaconBlockBody, +) *types.BeaconBlock { + t.Helper() + + // first update state root, similarly to what we do in processSlot + parentBlkHeader, err := beaconState.GetLatestBlockHeader() + require.NoError(t, err) + root := beaconState.HashTreeRoot() + parentBlkHeader.SetStateRoot(root) + + // finally build the block + return &types.BeaconBlock{ + Slot: parentBlkHeader.GetSlot() + 1, + ProposerIndex: parentBlkHeader.GetProposerIndex(), + ParentRoot: parentBlkHeader.HashTreeRoot(), + StateRoot: common.Root{}, + Body: nextBlkBody, + } +} 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 05bd247be1..537efe0c93 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -32,9 +32,7 @@ import ( "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/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" @@ -50,25 +48,7 @@ func TestInitialize(t *testing.T) { ](t) mocksSigner := &cryptomocks.BLSSigner{} - 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, - ]( + sp := testCreateStateProcessor( cs, execEngine, mocksSigner, @@ -76,7 +56,7 @@ func TestInitialize(t *testing.T) { ) // create test inputs - kvStore, err := initTestStore() + kvStore, err := testInitStore() require.NoError(t, err) var ( @@ -189,25 +169,7 @@ func TestInitializeBartio(t *testing.T) { ](t) mocksSigner := &cryptomocks.BLSSigner{} - 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, - ]( + sp := testCreateStateProcessor( cs, execEngine, mocksSigner, @@ -215,7 +177,7 @@ func TestInitializeBartio(t *testing.T) { ) // create test inputs - kvStore, err := initTestStore() + kvStore, err := testInitStore() require.NoError(t, err) var ( 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 19db58b9a1..4959871c3e 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -34,7 +34,6 @@ import ( "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" @@ -53,25 +52,7 @@ func TestTransitionUpdateValidators(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - 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, - ]( + sp := testCreateStateProcessor( cs, execEngine, mocksSigner, @@ -80,7 +61,7 @@ func TestTransitionUpdateValidators(t *testing.T) { }, ) - kvStore, err := initTestStore() + kvStore, err := testInitStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -144,13 +125,10 @@ func TestTransitionUpdateValidators(t *testing.T) { } ) - genBlockHeader := updateStateRootForLatestBlock(t, beaconState) - blk := &types.BeaconBlock{ - Slot: genBlockHeader.GetSlot() + 1, - ProposerIndex: genBlockHeader.GetProposerIndex(), - ParentRoot: genBlockHeader.HashTreeRoot(), - StateRoot: common.Root{}, - Body: &types.BeaconBlockBody{ + blk := testBuildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ ExecutionPayload: &types.ExecutionPayload{ Timestamp: 10, ExtraData: []byte("testing"), @@ -161,7 +139,7 @@ func TestTransitionUpdateValidators(t *testing.T) { Eth1Data: &types.Eth1Data{}, Deposits: blkDeposits, }, - } + ) // run the test _, err = sp.Transition(ctx, beaconState, blk) @@ -204,25 +182,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - 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, - ]( + sp := testCreateStateProcessor( cs, execEngine, mocksSigner, @@ -231,7 +191,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { }, ) - kvStore, err := initTestStore() + kvStore, err := testInitStore() require.NoError(t, err) bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -297,13 +257,10 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { } ) - genBlockHeader := updateStateRootForLatestBlock(t, bs) - blk1 := &types.BeaconBlock{ - Slot: genBlockHeader.GetSlot() + 1, - ProposerIndex: genBlockHeader.GetProposerIndex(), - ParentRoot: genBlockHeader.HashTreeRoot(), - StateRoot: common.Root{}, - Body: &types.BeaconBlockBody{ + blk1 := testBuildNextBlock( + t, + bs, + &types.BeaconBlockBody{ ExecutionPayload: &types.ExecutionPayload{ Timestamp: 10, ExtraData: []byte("testing"), @@ -314,7 +271,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { Eth1Data: &types.Eth1Data{}, Deposits: []*types.Deposit{extraValDeposit}, }, - } + ) // run the test _, err = sp.Transition(ctx, bs, blk1) @@ -334,13 +291,10 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // STEP 3: show that following block must contain withdrawals for // the rejected validator - blk1Header := updateStateRootForLatestBlock(t, bs) - blk2 := &types.BeaconBlock{ - Slot: blk1Header.GetSlot() + 1, - ProposerIndex: blk1Header.GetProposerIndex(), - ParentRoot: blk1Header.HashTreeRoot(), - StateRoot: common.Root{}, - Body: &types.BeaconBlockBody{ + blk2 := testBuildNextBlock( + t, + bs, + &types.BeaconBlockBody{ ExecutionPayload: &types.ExecutionPayload{ Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, ExtraData: []byte("testing"), @@ -358,7 +312,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { Eth1Data: &types.Eth1Data{}, Deposits: []*types.Deposit{}, }, - } + ) // run the test _, err = sp.Transition(ctx, bs, blk2) @@ -380,25 +334,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - 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, - ]( + sp := testCreateStateProcessor( cs, execEngine, mocksSigner, @@ -407,7 +343,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { }, ) - kvStore, err := initTestStore() + kvStore, err := testInitStore() require.NoError(t, err) bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -481,13 +417,10 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { } ) - genBlockHeader := updateStateRootForLatestBlock(t, bs) - blk1 := &types.BeaconBlock{ - Slot: genBlockHeader.GetSlot() + 1, - ProposerIndex: genBlockHeader.GetProposerIndex(), - ParentRoot: genBlockHeader.HashTreeRoot(), - StateRoot: common.Root{}, - Body: &types.BeaconBlockBody{ + blk1 := testBuildNextBlock( + t, + bs, + &types.BeaconBlockBody{ ExecutionPayload: &types.ExecutionPayload{ Timestamp: 10, ExtraData: []byte("testing"), @@ -498,7 +431,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { Eth1Data: &types.Eth1Data{}, Deposits: []*types.Deposit{extraValDeposit}, }, - } + ) // run the test _, err = sp.Transition(ctx, bs, blk1) @@ -526,13 +459,10 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // STEP 3: show that following block must contain withdrawals for // the evicted, smallest validator - blk1Header := updateStateRootForLatestBlock(t, bs) - blk2 := &types.BeaconBlock{ - Slot: blk1Header.GetSlot() + 1, - ProposerIndex: blk1Header.GetProposerIndex(), - ParentRoot: blk1Header.HashTreeRoot(), - StateRoot: common.Root{}, - Body: &types.BeaconBlockBody{ + blk2 := testBuildNextBlock( + t, + bs, + &types.BeaconBlockBody{ ExecutionPayload: &types.ExecutionPayload{ Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, ExtraData: []byte("testing"), @@ -550,27 +480,13 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { Eth1Data: &types.Eth1Data{}, Deposits: []*types.Deposit{}, }, - } + ) // run the test _, err = sp.Transition(ctx, bs, blk2) require.NoError(t, err) } -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 -} - func generateTestExecutionAddress( t *testing.T, rndSeed int, From 089242156e74ab392ef6ca5dcece035fd0ae8247 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 10:33:42 +0100 Subject: [PATCH 39/77] minor test helpers renaming --- mod/state-transition/pkg/core/helpers_test.go | 6 ++--- .../pkg/core/state_processor_genesis_test.go | 8 +++---- .../pkg/core/state_processor_staking_test.go | 22 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 18734da91e..2b84fcbd56 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -83,7 +83,7 @@ type ( ] ) -func testCreateStateProcessor( +func createStateProcessor( cs common.ChainSpec, execEngine core.ExecutionEngine[ *types.ExecutionPayload, @@ -153,7 +153,7 @@ var ( testCodec = &encoding.SSZInterfaceCodec[*types.ExecutionPayloadHeader]{} ) -func testInitStore() ( +func initStore() ( *beacondb.KVStore[ *types.BeaconBlockHeader, *types.Eth1Data, @@ -197,7 +197,7 @@ func testInitStore() ( ), nil } -func testBuildNextBlock( +func buildNextBlock( t *testing.T, beaconState *TestBeaconStateT, nextBlkBody *types.BeaconBlockBody, 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 537efe0c93..08ed24f2f1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -48,7 +48,7 @@ func TestInitialize(t *testing.T) { ](t) mocksSigner := &cryptomocks.BLSSigner{} - sp := testCreateStateProcessor( + sp := createStateProcessor( cs, execEngine, mocksSigner, @@ -56,7 +56,7 @@ func TestInitialize(t *testing.T) { ) // create test inputs - kvStore, err := testInitStore() + kvStore, err := initStore() require.NoError(t, err) var ( @@ -169,7 +169,7 @@ func TestInitializeBartio(t *testing.T) { ](t) mocksSigner := &cryptomocks.BLSSigner{} - sp := testCreateStateProcessor( + sp := createStateProcessor( cs, execEngine, mocksSigner, @@ -177,7 +177,7 @@ func TestInitializeBartio(t *testing.T) { ) // create test inputs - kvStore, err := testInitStore() + kvStore, err := initStore() require.NoError(t, err) var ( 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 4959871c3e..ef70b1adba 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -52,7 +52,7 @@ func TestTransitionUpdateValidators(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - sp := testCreateStateProcessor( + sp := createStateProcessor( cs, execEngine, mocksSigner, @@ -61,7 +61,7 @@ func TestTransitionUpdateValidators(t *testing.T) { }, ) - kvStore, err := testInitStore() + kvStore, err := initStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -125,7 +125,7 @@ func TestTransitionUpdateValidators(t *testing.T) { } ) - blk := testBuildNextBlock( + blk := buildNextBlock( t, beaconState, &types.BeaconBlockBody{ @@ -182,7 +182,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - sp := testCreateStateProcessor( + sp := createStateProcessor( cs, execEngine, mocksSigner, @@ -191,7 +191,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { }, ) - kvStore, err := testInitStore() + kvStore, err := initStore() require.NoError(t, err) bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -257,7 +257,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { } ) - blk1 := testBuildNextBlock( + blk1 := buildNextBlock( t, bs, &types.BeaconBlockBody{ @@ -291,7 +291,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // STEP 3: show that following block must contain withdrawals for // the rejected validator - blk2 := testBuildNextBlock( + blk2 := buildNextBlock( t, bs, &types.BeaconBlockBody{ @@ -334,7 +334,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { mocksSigner := &cryptomocks.BLSSigner{} dummyProposerAddr := []byte{0xff} - sp := testCreateStateProcessor( + sp := createStateProcessor( cs, execEngine, mocksSigner, @@ -343,7 +343,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { }, ) - kvStore, err := testInitStore() + kvStore, err := initStore() require.NoError(t, err) bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) @@ -417,7 +417,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { } ) - blk1 := testBuildNextBlock( + blk1 := buildNextBlock( t, bs, &types.BeaconBlockBody{ @@ -459,7 +459,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // STEP 3: show that following block must contain withdrawals for // the evicted, smallest validator - blk2 := testBuildNextBlock( + blk2 := buildNextBlock( t, bs, &types.BeaconBlockBody{ From 174229a0cdd7ffd406d50a6f1ad3c0cf6f6b8faf Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 11:31:51 +0100 Subject: [PATCH 40/77] improving checks on validator set cap --- .../pkg/core/state_processor_staking_test.go | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) 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 666a61c2dc..d6ace98423 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -392,13 +392,15 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { mock.Anything, mock.Anything, mock.Anything, ).Return(nil) - _, err = sp.InitializePreminedBeaconStateFromEth1( + var genVals transition.ValidatorUpdates + genVals, err = sp.InitializePreminedBeaconStateFromEth1( bs, genDeposits, genPayloadHeader, genVersion, ) require.NoError(t, err) + require.Len(t, genVals, len(genDeposits)) // STEP 2: Add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) @@ -434,8 +436,10 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { ) // run the test - _, err = sp.Transition(ctx, bs, blk1) + var vals transition.ValidatorUpdates + vals, err = sp.Transition(ctx, bs, blk1) require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch // check smallest validator is updated with Withdraw epoch duly set smallValIdx, err := bs.ValidatorIndexByPubkey(smallestVal.Pubkey) @@ -483,8 +487,55 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { ) // run the test - _, err = sp.Transition(ctx, bs, blk2) + vals, err = sp.Transition(ctx, bs, blk2) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + + // STEP 4: moving chain forward to next epoch to see extra validator + // be activated, just replaced + var blk = blk2 + for i := 2; i < int(cs.SlotsPerEpoch())-1; i++ { + blk = buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + vals, err = sp.Transition(ctx, bs, blk) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + } + + blk = buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + vals, err = sp.Transition(ctx, bs, blk) require.NoError(t, err) + require.Less(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) + require.Len(t, vals, len(genDeposits)) // just replaced one validator } func generateTestExecutionAddress( From 3cca1f3697202801a244587ad22018e0095871d2 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 12:51:35 +0100 Subject: [PATCH 41/77] added processEffectiveBalanceUpdates --- .../pkg/core/state_processor.go | 59 +++++++++++++ .../pkg/core/state_processor_committee.go | 11 ++- .../pkg/core/state_processor_genesis_test.go | 84 +++++++++++-------- .../pkg/core/state_processor_staking_test.go | 2 +- 4 files changed, 121 insertions(+), 35 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 34e92d6be7..747dda3c55 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -23,6 +23,7 @@ package core import ( "bytes" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" @@ -336,6 +337,9 @@ func (sp *StateProcessor[ if err := sp.processRewardsAndPenalties(st); err != nil { return nil, err } + if err := sp.processEffectiveBalanceUpdates(st); err != nil { + return nil, err + } if err := sp.processSlashingsReset(st); err != nil { return nil, err } @@ -516,3 +520,58 @@ func (sp *StateProcessor[ return nil } + +// processEffectiveBalanceUpdates as defined in the Ethereum 2.0 specification. +// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#effective-balances-updates +// +//nolint:lll +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, +]) processEffectiveBalanceUpdates( + st BeaconStateT, +) error { + // Update effective balances with hysteresis + validators, err := st.GetValidators() + if err != nil { + return err + } + // TODO: add to cs + // HYSTERESIS_QUOTIENT + // HYSTERESIS_DOWNWARD_MULTIPLIER + // HYSTERESIS_UPWARD_MULTIPLIER + hysteresysQuotient := math.U64(1) + hysteresysDownwardMultiplier := math.U64(1) + hysteresysUpwardMultiplier := math.U64(1) + + histeresysIncrement := math.U64(sp.cs.EffectiveBalanceIncrement()) / hysteresysQuotient + downwardThreshold := histeresysIncrement * hysteresysDownwardMultiplier + upwardThreshold := histeresysIncrement * hysteresysUpwardMultiplier + + for _, val := range validators { + var idx math.U64 + idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) + if err != nil { + return err + } + + var balance math.Gwei + balance, err = st.GetBalance(idx) + if err != nil { + return err + } + + if balance+downwardThreshold < val.GetEffectiveBalance() || + val.GetEffectiveBalance()+upwardThreshold < balance { + updatedBalance := types.ComputeEffectiveBalance( + balance, + math.U64(sp.cs.EffectiveBalanceIncrement()), + math.U64(sp.cs.MaxEffectiveBalance()), + ) + val.SetEffectiveBalance(updatedBalance) + if err = st.UpdateValidatorAtIndex(idx, val); err != nil { + return err + } + } + } + return nil +} diff --git a/mod/state-transition/pkg/core/state_processor_committee.go b/mod/state-transition/pkg/core/state_processor_committee.go index 073371a807..2bcc794e4f 100644 --- a/mod/state-transition/pkg/core/state_processor_committee.go +++ b/mod/state-transition/pkg/core/state_processor_committee.go @@ -21,6 +21,7 @@ package core import ( + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/sourcegraph/conc/iter" ) @@ -36,8 +37,16 @@ func (sp *StateProcessor[ return nil, err } + // filter out validators whose effective balance is not sufficient to validate + activeVals := make([]ValidatorT, 0, len(vals)) + for _, val := range vals { + if val.GetEffectiveBalance() > math.U64(sp.cs.EjectionBalance()) { + activeVals = append(activeVals, val) + } + } + return iter.MapErr( - vals, + activeVals, func(val *ValidatorT) (*transition.ValidatorUpdate, error) { v := (*val) return &transition.ValidatorUpdate{ 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 95a88c0272..f5da46a549 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -55,39 +55,48 @@ func TestInitialize(t *testing.T) { dummyProposerAddressVerifier, ) - // create test inputs kvStore, err := initStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - deposits = []*types.Deposit{ + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + ) + + // create test inputs + var ( + goodDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(cs.MaxEffectiveBalance()), + Amount: maxBalance, Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), + Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x03}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement()), - Index: uint64(2), - }, { Pubkey: [48]byte{0x04}, - Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Amount: 2 * maxBalance, Index: uint64(3), }, + } + badDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x03}, + Amount: minBalance, + Index: uint64(2), + }, { Pubkey: [48]byte{0x05}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Amount: minBalance * 2 / 3, Index: uint64(4), }, } + genDeposits = append(goodDeposits, badDeposits...) executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -105,14 +114,14 @@ func TestInitialize(t *testing.T) { // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, - deposits, + genDeposits, executionPayloadHeader, fork.CurrentVersion, ) // check outputs require.NoError(t, err) - require.Len(t, vals, len(deposits)) + require.Len(t, vals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() @@ -123,14 +132,14 @@ func TestInitialize(t *testing.T) { require.NoError(t, err) require.Equal(t, fork, resFork) - for _, dep := range deposits { + for _, dep := range goodDeposits { checkValidatorNonBartio(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) + require.Equal(t, uint64(len(genDeposits)-1), latestValIdx) } func checkValidatorNonBartio( @@ -176,39 +185,48 @@ func TestInitializeBartio(t *testing.T) { dummyProposerAddressVerifier, ) - // create test inputs kvStore, err := initStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - deposits = []*types.Deposit{ + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + ) + + // create test inputs + var ( + goodDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(cs.MaxEffectiveBalance()), + Amount: maxBalance, Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), + Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x03}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement()), - Index: uint64(2), - }, { Pubkey: [48]byte{0x04}, - Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Amount: 2 * maxBalance, Index: uint64(3), }, + } + badDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x03}, + Amount: minBalance, + Index: uint64(2), + }, { Pubkey: [48]byte{0x05}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Amount: minBalance * 2 / 3, Index: uint64(4), }, } + genDeposits = append(goodDeposits, badDeposits...) executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -226,14 +244,14 @@ func TestInitializeBartio(t *testing.T) { // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, - deposits, + genDeposits, executionPayloadHeader, fork.CurrentVersion, ) // check outputs require.NoError(t, err) - require.Len(t, vals, len(deposits)) + require.Len(t, vals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() @@ -244,14 +262,14 @@ func TestInitializeBartio(t *testing.T) { require.NoError(t, err) require.Equal(t, fork, resFork) - for _, dep := range deposits { + for _, dep := range goodDeposits { checkValidatorBartio(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) + require.Equal(t, uint64(len(genDeposits)-1), latestValIdx) } func checkValidatorBartio( @@ -298,7 +316,6 @@ func commonChecksValidators( idx, err := bs.ValidatorIndexByPubkey(dep.Pubkey) require.NoError(t, err) - require.Equal(t, math.U64(dep.Index), idx) val, err := bs.ValidatorByIndex(idx) require.NoError(t, err) @@ -306,7 +323,8 @@ func commonChecksValidators( var ( maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) switch { case dep.Amount >= maxBalance: @@ -315,7 +333,7 @@ func commonChecksValidators( require.Equal(t, dep.Amount, val.EffectiveBalance) // validator balance must be multiple of EffectiveBalanceIncrement - require.Equal(t, math.U64(0), val.EffectiveBalance%minBalance) + require.Equal(t, math.U64(0), val.EffectiveBalance%increment) case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } 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 d6ace98423..ae2c1c5a60 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -534,7 +534,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { vals, err = sp.Transition(ctx, bs, blk) require.NoError(t, err) - require.Less(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) + require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) require.Len(t, vals, len(genDeposits)) // just replaced one validator } From 0ae0c7d25b23fc94d21dabbc871a456b02f6d77a Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 13:10:35 +0100 Subject: [PATCH 42/77] updated chain specs --- mod/chain-spec/pkg/chain/chain_spec.go | 24 +++++++++++++++++++ mod/chain-spec/pkg/chain/data.go | 6 +++++ mod/config/pkg/spec/testnet.go | 11 +++++---- .../pkg/core/state_processor.go | 19 +++++---------- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index f0cf409522..9a4b3738be 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -45,6 +45,12 @@ type Spec[ // calculations. EffectiveBalanceIncrement() uint64 + HysteresisQuotient() uint64 + + HysteresisDownwardMultiplier() uint64 + + HysteresisUpwardMultiplier() uint64 + // Time parameters constants. // SlotsPerEpoch returns the number of slots in an epoch. @@ -249,6 +255,24 @@ func (c chainSpec[ return c.Data.EffectiveBalanceIncrement } +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisQuotient() uint64 { + return c.Data.HysteresisQuotient +} + +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisDownwardMultiplier() uint64 { + return c.Data.HysteresisDownwardMultiplier +} + +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisUpwardMultiplier() uint64 { + return c.Data.HysteresisUpwardMultiplier +} + // SlotsPerEpoch returns the number of slots per epoch. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index 66c6b2074f..73afa0e3d3 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -43,6 +43,12 @@ type SpecData[ // EffectiveBalanceIncrement is the effective balance increment. EffectiveBalanceIncrement uint64 `mapstructure:"effective-balance-increment"` + HysteresisQuotient uint64 `mapstructure:"hysteresis-quotient"` + + HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"` + + HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"` + // Time parameters constants. // // SlotsPerEpoch is the number of slots per epoch. diff --git a/mod/config/pkg/spec/testnet.go b/mod/config/pkg/spec/testnet.go index dde1ccad6e..358021660d 100644 --- a/mod/config/pkg/spec/testnet.go +++ b/mod/config/pkg/spec/testnet.go @@ -60,10 +60,13 @@ func BaseSpec() chain.SpecData[ any, ]{ // // Gwei value constants. - MinDepositAmount: uint64(1e9), - MaxEffectiveBalance: uint64(32e9), - EjectionBalance: uint64(16e9), - EffectiveBalanceIncrement: uint64(1e9), + MinDepositAmount: uint64(1e9), + MaxEffectiveBalance: uint64(32e9), + EjectionBalance: uint64(16e9), + EffectiveBalanceIncrement: uint64(1e9), + HysteresisQuotient: uint64(4), + HysteresisDownwardMultiplier: uint64(1), + HysteresisUpwardMultiplier: uint64(5), // Time parameters constants. SlotsPerEpoch: 32, MinEpochsToInactivityPenalty: 4, diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 747dda3c55..702cb2dceb 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -535,17 +535,10 @@ func (sp *StateProcessor[ if err != nil { return err } - // TODO: add to cs - // HYSTERESIS_QUOTIENT - // HYSTERESIS_DOWNWARD_MULTIPLIER - // HYSTERESIS_UPWARD_MULTIPLIER - hysteresysQuotient := math.U64(1) - hysteresysDownwardMultiplier := math.U64(1) - hysteresysUpwardMultiplier := math.U64(1) - - histeresysIncrement := math.U64(sp.cs.EffectiveBalanceIncrement()) / hysteresysQuotient - downwardThreshold := histeresysIncrement * hysteresysDownwardMultiplier - upwardThreshold := histeresysIncrement * hysteresysUpwardMultiplier + + histeresysIncrement := sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() + downwardThreshold := histeresysIncrement * sp.cs.HysteresisDownwardMultiplier() + upwardThreshold := histeresysIncrement * sp.cs.HysteresisUpwardMultiplier() for _, val := range validators { var idx math.U64 @@ -560,8 +553,8 @@ func (sp *StateProcessor[ return err } - if balance+downwardThreshold < val.GetEffectiveBalance() || - val.GetEffectiveBalance()+upwardThreshold < balance { + if balance+math.Gwei(downwardThreshold) < val.GetEffectiveBalance() || + val.GetEffectiveBalance()+math.Gwei(upwardThreshold) < balance { updatedBalance := types.ComputeEffectiveBalance( balance, math.U64(sp.cs.EffectiveBalanceIncrement()), From 3df7fc74e9fa0b0ba2084f0119b208d99ebe5498 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 13:22:25 +0100 Subject: [PATCH 43/77] nits --- mod/state-transition/pkg/core/state_processor_staking.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index cafd94e7bf..8486eec2dc 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -221,14 +221,12 @@ func (sp *StateProcessor[ // Adding the validator would breach the cap. Find the validator // with the smallest stake among current and candidate validators // and kit it out. - var currSmallestVal ValidatorT - currSmallestVal, err = sp.findSmallestValidator(st) + currSmallestVal, err := sp.findSmallestValidator(st) if err != nil { return err } - var slot math.Slot - slot, err = st.GetSlot() + slot, err := st.GetSlot() if err != nil { return err } @@ -243,8 +241,7 @@ func (sp *StateProcessor[ // mark exiting validator for eviction and add candidate currSmallestVal.SetWithdrawableEpoch(epoch) - var idx math.U64 - idx, err = st.ValidatorIndexByPubkey(currSmallestVal.GetPubkey()) + idx, err := st.ValidatorIndexByPubkey(currSmallestVal.GetPubkey()) if err != nil { return err } From 4d3de74376774c10c1a9ab8ab4872955fbcce3e0 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 13:26:53 +0100 Subject: [PATCH 44/77] nit --- mod/state-transition/pkg/core/state_processor_staking.go | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 8486eec2dc..7b7fcffa7e 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -134,6 +134,7 @@ func (sp *StateProcessor[ } // TODO: Modify balance here and then effective balance once per epoch. + // Note: balance processing per epoch done, this could be dropped updatedBalance := types.ComputeEffectiveBalance( val.GetEffectiveBalance()+dep.GetAmount(), math.Gwei(sp.cs.EffectiveBalanceIncrement()), From 77f49c6224193865f1c7d3c845e0589539c50b22 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 13:48:13 +0100 Subject: [PATCH 45/77] further UT extension --- mod/state-transition/pkg/core/helpers_test.go | 17 +++++++++++++++++ .../pkg/core/state_processor.go | 6 ++---- .../pkg/core/state_processor_staking_test.go | 10 ++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 2b84fcbd56..d5b4132289 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -219,3 +219,20 @@ func buildNextBlock( Body: nextBlkBody, } } + +// ValUpdatesDiff returns elements of slice a that are not in b. +func ValUpdatesDiff( + a, b []*transition.ValidatorUpdate, +) []*transition.ValidatorUpdate { + mb := make(map[string]struct{}, len(b)) + for _, v := range b { + mb[v.Pubkey.String()] = struct{}{} + } + var diff []*transition.ValidatorUpdate + for _, x := range a { + if _, found := mb[x.Pubkey.String()]; !found { + diff = append(diff, x) + } + } + return diff +} diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 702cb2dceb..ebebea7a4a 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -198,10 +198,7 @@ func (sp *StateProcessor[ ]) ProcessSlots( st BeaconStateT, slot math.Slot, ) (transition.ValidatorUpdates, error) { - var ( - validatorUpdates transition.ValidatorUpdates - epochValidatorUpdates transition.ValidatorUpdates - ) + var validatorUpdates transition.ValidatorUpdates stateSlot, err := st.GetSlot() if err != nil { @@ -218,6 +215,7 @@ func (sp *StateProcessor[ // Process the Epoch Boundary. boundary := (stateSlot.Unwrap()+1)%sp.cs.SlotsPerEpoch() == 0 if boundary { + var epochValidatorUpdates transition.ValidatorUpdates if epochValidatorUpdates, err = sp.processEpoch(st); err != nil { return nil, 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 ae2c1c5a60..a3d9856454 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -536,6 +536,16 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { require.NoError(t, err) require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) require.Len(t, vals, len(genDeposits)) // just replaced one validator + + // check that we removed the smallest validator at the epoch turn + removedVals := ValUpdatesDiff(genVals, vals) + require.Len(t, removedVals, 1) + require.Equal(t, smallVal.Pubkey, removedVals[0].Pubkey) + + // check that we added the incoming validator at the epoch turn + addedVals := ValUpdatesDiff(vals, genVals) + require.Len(t, addedVals, 1) + require.Equal(t, extraVal.Pubkey, addedVals[0].Pubkey) } func generateTestExecutionAddress( From b96f776c5adc4357181a127cf756e70d7f46fbf7 Mon Sep 17 00:00:00 2001 From: aBear Date: Thu, 7 Nov 2024 13:49:47 +0100 Subject: [PATCH 46/77] fixed typo --- mod/state-transition/pkg/core/state_processor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index ebebea7a4a..234ff399c7 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -534,9 +534,9 @@ func (sp *StateProcessor[ return err } - histeresysIncrement := sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() - downwardThreshold := histeresysIncrement * sp.cs.HysteresisDownwardMultiplier() - upwardThreshold := histeresysIncrement * sp.cs.HysteresisUpwardMultiplier() + hysteresisIncrement := sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() + downwardThreshold := hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier() + upwardThreshold := hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier() for _, val := range validators { var idx math.U64 From 882b91e3eccd30fed78c852dff489259dad3171f Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 8 Nov 2024 23:11:53 +0100 Subject: [PATCH 47/77] added processEffectiveBalanceUpdates --- mod/chain-spec/pkg/chain/chain_spec.go | 24 +++++++ mod/chain-spec/pkg/chain/data.go | 5 ++ .../pkg/core/state_processor.go | 70 +++++++++++++++---- 3 files changed, 86 insertions(+), 13 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 5d65f45e2c..2e76c60ae0 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -45,6 +45,12 @@ type Spec[ // calculations. EffectiveBalanceIncrement() uint64 + HysteresisQuotient() uint64 + + HysteresisDownwardMultiplier() uint64 + + HysteresisUpwardMultiplier() uint64 + // Time parameters constants. // SlotsPerEpoch returns the number of slots in an epoch. @@ -245,6 +251,24 @@ func (c chainSpec[ return c.Data.EffectiveBalanceIncrement } +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisQuotient() uint64 { + return c.Data.HysteresisQuotient +} + +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisDownwardMultiplier() uint64 { + return c.Data.HysteresisDownwardMultiplier +} + +func (c chainSpec[ + DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, +]) HysteresisUpwardMultiplier() uint64 { + return c.Data.HysteresisUpwardMultiplier +} + // SlotsPerEpoch returns the number of slots per epoch. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index 3c3ae2a637..b8eefc34e6 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -43,6 +43,11 @@ type SpecData[ // EffectiveBalanceIncrement is the effective balance increment. EffectiveBalanceIncrement uint64 `mapstructure:"effective-balance-increment"` + HysteresisQuotient uint64 `mapstructure:"hysteresis-quotient"` + + HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"` + + HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"` // Time parameters constants. // // SlotsPerEpoch is the number of slots per epoch. diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 34e92d6be7..1e5a97ff61 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -23,6 +23,7 @@ package core import ( "bytes" + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "github.com/berachain/beacon-kit/mod/errors" "github.com/berachain/beacon-kit/mod/primitives/pkg/common" "github.com/berachain/beacon-kit/mod/primitives/pkg/constants" @@ -197,11 +198,7 @@ func (sp *StateProcessor[ ]) ProcessSlots( st BeaconStateT, slot math.Slot, ) (transition.ValidatorUpdates, error) { - var ( - validatorUpdates transition.ValidatorUpdates - epochValidatorUpdates transition.ValidatorUpdates - ) - + var res transition.ValidatorUpdates stateSlot, err := st.GetSlot() if err != nil { return nil, err @@ -209,7 +206,6 @@ func (sp *StateProcessor[ // Iterate until we are "caught up". for ; stateSlot < slot; stateSlot++ { - // Process the slot if err = sp.processSlot(st); err != nil { return nil, err } @@ -217,14 +213,11 @@ func (sp *StateProcessor[ // Process the Epoch Boundary. boundary := (stateSlot.Unwrap()+1)%sp.cs.SlotsPerEpoch() == 0 if boundary { - if epochValidatorUpdates, err = - sp.processEpoch(st); err != nil { + var epochUpdates transition.ValidatorUpdates + if epochUpdates, err = sp.processEpoch(st); err != nil { return nil, err } - validatorUpdates = append( - validatorUpdates, - epochValidatorUpdates..., - ) + res = append(res, epochUpdates...) } // We update on the state because we need to @@ -234,7 +227,7 @@ func (sp *StateProcessor[ } } - return validatorUpdates, nil + return res, nil } // processSlot is run when a slot is missed. @@ -336,6 +329,9 @@ func (sp *StateProcessor[ if err := sp.processRewardsAndPenalties(st); err != nil { return nil, err } + if err := sp.processEffectiveBalanceUpdates(st); err != nil { + return nil, err + } if err := sp.processSlashingsReset(st); err != nil { return nil, err } @@ -516,3 +512,51 @@ func (sp *StateProcessor[ return nil } + +// processEffectiveBalanceUpdates as defined in the Ethereum 2.0 specification. +// https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#effective-balances-updates +// +//nolint:lll +func (sp *StateProcessor[ + _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, +]) processEffectiveBalanceUpdates( + st BeaconStateT, +) error { + // Update effective balances with hysteresis + validators, err := st.GetValidators() + if err != nil { + return err + } + + hysteresisIncrement := sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() + downwardThreshold := hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier() + upwardThreshold := hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier() + + for _, val := range validators { + var idx math.U64 + idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) + if err != nil { + return err + } + + var balance math.Gwei + balance, err = st.GetBalance(idx) + if err != nil { + return err + } + + if balance+math.Gwei(downwardThreshold) < val.GetEffectiveBalance() || + val.GetEffectiveBalance()+math.Gwei(upwardThreshold) < balance { + updatedBalance := types.ComputeEffectiveBalance( + balance, + math.U64(sp.cs.EffectiveBalanceIncrement()), + math.U64(sp.cs.MaxEffectiveBalance()), + ) + val.SetEffectiveBalance(updatedBalance) + if err = st.UpdateValidatorAtIndex(idx, val); err != nil { + return err + } + } + } + return nil +} From ebcf8b471804a8211fb8a6cda23583f813897b4f Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 8 Nov 2024 23:24:44 +0100 Subject: [PATCH 48/77] wip: update validator set returned to consensus --- .../pkg/core/state_processor_committee.go | 11 ++- .../pkg/core/state_processor_genesis_test.go | 84 +++++++++++-------- 2 files changed, 61 insertions(+), 34 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_committee.go b/mod/state-transition/pkg/core/state_processor_committee.go index 073371a807..2bcc794e4f 100644 --- a/mod/state-transition/pkg/core/state_processor_committee.go +++ b/mod/state-transition/pkg/core/state_processor_committee.go @@ -21,6 +21,7 @@ package core import ( + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/sourcegraph/conc/iter" ) @@ -36,8 +37,16 @@ func (sp *StateProcessor[ return nil, err } + // filter out validators whose effective balance is not sufficient to validate + activeVals := make([]ValidatorT, 0, len(vals)) + for _, val := range vals { + if val.GetEffectiveBalance() > math.U64(sp.cs.EjectionBalance()) { + activeVals = append(activeVals, val) + } + } + return iter.MapErr( - vals, + activeVals, func(val *ValidatorT) (*transition.ValidatorUpdate, error) { v := (*val) return &transition.ValidatorUpdate{ 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 95a88c0272..f5da46a549 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -55,39 +55,48 @@ func TestInitialize(t *testing.T) { dummyProposerAddressVerifier, ) - // create test inputs kvStore, err := initStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - deposits = []*types.Deposit{ + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + ) + + // create test inputs + var ( + goodDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(cs.MaxEffectiveBalance()), + Amount: maxBalance, Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), + Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x03}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement()), - Index: uint64(2), - }, { Pubkey: [48]byte{0x04}, - Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Amount: 2 * maxBalance, Index: uint64(3), }, + } + badDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x03}, + Amount: minBalance, + Index: uint64(2), + }, { Pubkey: [48]byte{0x05}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Amount: minBalance * 2 / 3, Index: uint64(4), }, } + genDeposits = append(goodDeposits, badDeposits...) executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -105,14 +114,14 @@ func TestInitialize(t *testing.T) { // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, - deposits, + genDeposits, executionPayloadHeader, fork.CurrentVersion, ) // check outputs require.NoError(t, err) - require.Len(t, vals, len(deposits)) + require.Len(t, vals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() @@ -123,14 +132,14 @@ func TestInitialize(t *testing.T) { require.NoError(t, err) require.Equal(t, fork, resFork) - for _, dep := range deposits { + for _, dep := range goodDeposits { checkValidatorNonBartio(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) + require.Equal(t, uint64(len(genDeposits)-1), latestValIdx) } func checkValidatorNonBartio( @@ -176,39 +185,48 @@ func TestInitializeBartio(t *testing.T) { dummyProposerAddressVerifier, ) - // create test inputs kvStore, err := initStore() require.NoError(t, err) beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - deposits = []*types.Deposit{ + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + ) + + // create test inputs + var ( + goodDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, - Amount: math.Gwei(cs.MaxEffectiveBalance()), + Amount: maxBalance, Index: uint64(0), }, { Pubkey: [48]byte{0x02}, - Amount: math.Gwei(cs.MaxEffectiveBalance() / 2), + Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x03}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement()), - Index: uint64(2), - }, { Pubkey: [48]byte{0x04}, - Amount: math.Gwei(2 * cs.MaxEffectiveBalance()), + Amount: 2 * maxBalance, Index: uint64(3), }, + } + badDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x03}, + Amount: minBalance, + Index: uint64(2), + }, { Pubkey: [48]byte{0x05}, - Amount: math.Gwei(cs.EffectiveBalanceIncrement() * 2 / 3), + Amount: minBalance * 2 / 3, Index: uint64(4), }, } + genDeposits = append(goodDeposits, badDeposits...) executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -226,14 +244,14 @@ func TestInitializeBartio(t *testing.T) { // run test vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, - deposits, + genDeposits, executionPayloadHeader, fork.CurrentVersion, ) // check outputs require.NoError(t, err) - require.Len(t, vals, len(deposits)) + require.Len(t, vals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() @@ -244,14 +262,14 @@ func TestInitializeBartio(t *testing.T) { require.NoError(t, err) require.Equal(t, fork, resFork) - for _, dep := range deposits { + for _, dep := range goodDeposits { checkValidatorBartio(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) + require.Equal(t, uint64(len(genDeposits)-1), latestValIdx) } func checkValidatorBartio( @@ -298,7 +316,6 @@ func commonChecksValidators( idx, err := bs.ValidatorIndexByPubkey(dep.Pubkey) require.NoError(t, err) - require.Equal(t, math.U64(dep.Index), idx) val, err := bs.ValidatorByIndex(idx) require.NoError(t, err) @@ -306,7 +323,8 @@ func commonChecksValidators( var ( maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) switch { case dep.Amount >= maxBalance: @@ -315,7 +333,7 @@ func commonChecksValidators( require.Equal(t, dep.Amount, val.EffectiveBalance) // validator balance must be multiple of EffectiveBalanceIncrement - require.Equal(t, math.U64(0), val.EffectiveBalance%minBalance) + require.Equal(t, math.U64(0), val.EffectiveBalance%increment) case dep.Amount < minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } From d4ec3e7f087fad1d2ab78032f7999d99ce350b9a Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 8 Nov 2024 23:55:27 +0100 Subject: [PATCH 49/77] nit --- .../pkg/core/state_processor_genesis_test.go | 44 ++++++++++--------- .../pkg/core/state_processor_staking_test.go | 27 +++++++----- 2 files changed, 41 insertions(+), 30 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 f5da46a549..ed694e00b8 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -67,7 +67,7 @@ func TestInitialize(t *testing.T) { // create test inputs var ( - goodDeposits = []*types.Deposit{ + genDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, Amount: maxBalance, @@ -78,25 +78,27 @@ func TestInitialize(t *testing.T) { Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x04}, - Amount: 2 * maxBalance, - Index: uint64(3), - }, - } - badDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x03}, Amount: minBalance, Index: uint64(2), }, + { + Pubkey: [48]byte{0x04}, + Amount: 2 * maxBalance, + Index: uint64(3), + }, { Pubkey: [48]byte{0x05}, Amount: minBalance * 2 / 3, Index: uint64(4), }, } - genDeposits = append(goodDeposits, badDeposits...) + goodDeposits = []*types.Deposit{ + genDeposits[0], + genDeposits[1], + genDeposits[3], + } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -197,7 +199,7 @@ func TestInitializeBartio(t *testing.T) { // create test inputs var ( - goodDeposits = []*types.Deposit{ + genDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x01}, Amount: maxBalance, @@ -208,25 +210,27 @@ func TestInitializeBartio(t *testing.T) { Amount: minBalance + increment, Index: uint64(1), }, - { - Pubkey: [48]byte{0x04}, - Amount: 2 * maxBalance, - Index: uint64(3), - }, - } - badDeposits = []*types.Deposit{ { Pubkey: [48]byte{0x03}, Amount: minBalance, Index: uint64(2), }, + { + Pubkey: [48]byte{0x04}, + Amount: 2 * maxBalance, + Index: uint64(3), + }, { Pubkey: [48]byte{0x05}, Amount: minBalance * 2 / 3, Index: uint64(4), }, } - genDeposits = append(goodDeposits, badDeposits...) + goodDeposits = []*types.Deposit{ + genDeposits[0], + genDeposits[1], + genDeposits[3], + } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ PreviousVersion: version.FromUint32[common.Version](version.Deneb), @@ -329,12 +333,12 @@ func commonChecksValidators( switch { case dep.Amount >= maxBalance: require.Equal(t, maxBalance, val.EffectiveBalance) - case dep.Amount >= minBalance && dep.Amount < maxBalance: + case dep.Amount > minBalance && dep.Amount < maxBalance: require.Equal(t, dep.Amount, val.EffectiveBalance) // validator balance must be multiple of EffectiveBalanceIncrement require.Equal(t, math.U64(0), val.EffectiveBalance%increment) - case dep.Amount < minBalance: + case dep.Amount <= minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } } 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 8ed6c99b9c..162d5afbb7 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -37,6 +37,8 @@ import ( "github.com/stretchr/testify/require" ) +// TestTransitionUpdateValidators shows that when validator is +// updated (increasing amount), corresponding balance is updated. func TestTransitionUpdateValidators(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -63,7 +65,8 @@ func TestTransitionUpdateValidators(t *testing.T) { var ( maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) emptyAddress = common.ExecutionAddress{} emptyCredentials = types.NewCredentialsFromExecutionAddress( emptyAddress, @@ -77,15 +80,21 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: [48]byte{0x01}, Credentials: emptyCredentials, - Amount: maxBalance - 3*minBalance, + Amount: maxBalance - 3*increment, Index: uint64(0), }, { Pubkey: [48]byte{0x02}, Credentials: emptyCredentials, - Amount: maxBalance - 6*minBalance, + Amount: maxBalance - 6*increment, Index: uint64(1), }, + { + Pubkey: [48]byte{0x03}, + Credentials: emptyCredentials, + Amount: minBalance + increment, + Index: uint64(2), + }, } genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) @@ -96,13 +105,14 @@ func TestTransitionUpdateValidators(t *testing.T) { mock.Anything, mock.Anything, mock.Anything, ).Return(nil) - _, err = sp.InitializePreminedBeaconStateFromEth1( + vals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, genDeposits, genPayloadHeader, genVersion, ) require.NoError(t, err) + require.Len(t, vals, len(genDeposits)) // create test inputs var ( @@ -115,8 +125,8 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: genDeposits[0].Pubkey, Credentials: emptyCredentials, - Amount: minBalance, // avoid breaching maxBalance - Index: genDeposits[0].Index, + Amount: increment, // avoid breaching maxBalance + Index: uint64(len(genDeposits)), }, } ) @@ -138,11 +148,8 @@ func TestTransitionUpdateValidators(t *testing.T) { ) // run the test - vals, err := sp.Transition(ctx, beaconState, blk) - - // check outputs + _, err = sp.Transition(ctx, beaconState, blk) 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 From 3245f96c5cb59cf0fcbbca3543d14c0957081bfb Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 00:09:50 +0100 Subject: [PATCH 50/77] nit --- mod/state-transition/pkg/core/state_processor.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index 1e5a97ff61..e5498ceaf5 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -528,18 +528,21 @@ func (sp *StateProcessor[ return err } - hysteresisIncrement := sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() - downwardThreshold := hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier() - upwardThreshold := hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier() + var ( + hysteresisIncrement = sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() + downwardThreshold = hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier() + upwardThreshold = hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier() + + idx math.U64 + balance math.Gwei + ) for _, val := range validators { - var idx math.U64 idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) if err != nil { return err } - var balance math.Gwei balance, err = st.GetBalance(idx) if err != nil { return err From bfca9712fb0a9a28868f9d6abc378776129a8993 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 00:46:08 +0100 Subject: [PATCH 51/77] added cases for genesis initialization UTs --- .../pkg/core/state_processor_genesis_test.go | 57 +++++++++++++++---- 1 file changed, 45 insertions(+), 12 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 ed694e00b8..a1eb6f6091 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -90,14 +90,28 @@ func TestInitialize(t *testing.T) { }, { Pubkey: [48]byte{0x05}, - Amount: minBalance * 2 / 3, + Amount: minBalance - increment, Index: uint64(4), }, + { + Pubkey: [48]byte{0x06}, + Amount: minBalance + increment*3/2, + Index: uint64(5), + }, + { + Pubkey: [48]byte{0x07}, + Amount: maxBalance + increment/10, + Index: uint64(6), + }, + { + Pubkey: [48]byte{0x08}, + Amount: minBalance + increment*99/100, + Index: uint64(7), + }, } goodDeposits = []*types.Deposit{ - genDeposits[0], - genDeposits[1], - genDeposits[3], + genDeposits[0], genDeposits[1], genDeposits[3], + genDeposits[5], genDeposits[6], } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ @@ -222,14 +236,28 @@ func TestInitializeBartio(t *testing.T) { }, { Pubkey: [48]byte{0x05}, - Amount: minBalance * 2 / 3, + Amount: minBalance - increment, Index: uint64(4), }, + { + Pubkey: [48]byte{0x06}, + Amount: minBalance + increment*3/2, + Index: uint64(5), + }, + { + Pubkey: [48]byte{0x07}, + Amount: maxBalance + increment/10, + Index: uint64(6), + }, + { + Pubkey: [48]byte{0x08}, + Amount: minBalance + increment*99/100, + Index: uint64(7), + }, } goodDeposits = []*types.Deposit{ - genDeposits[0], - genDeposits[1], - genDeposits[3], + genDeposits[0], genDeposits[1], genDeposits[3], + genDeposits[5], genDeposits[6], } executionPayloadHeader = new(types.ExecutionPayloadHeader).Empty() fork = &types.Fork{ @@ -334,10 +362,15 @@ func commonChecksValidators( 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.Equal(t, math.U64(0), val.EffectiveBalance%increment) + // Effective balance must be a multiple of increment. + // If balance is not, effective balance is rounded down + if dep.Amount%increment == 0 { + require.Equal(t, dep.Amount, val.EffectiveBalance) + } else { + require.Less(t, val.EffectiveBalance, dep.Amount) + require.Greater(t, val.EffectiveBalance, dep.Amount-increment) + require.Zero(t, val.EffectiveBalance%increment) + } case dep.Amount <= minBalance: require.Equal(t, math.Gwei(0), val.EffectiveBalance) } From b89878820cbe7fbb5e7970247b324324f97392ee Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 10:14:04 +0100 Subject: [PATCH 52/77] made process deposits closer to eth 2.0 specs --- .../pkg/core/state_processor.go | 37 ++++++----------- .../pkg/core/state_processor_staking.go | 41 ++++++------------- 2 files changed, 25 insertions(+), 53 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index e5498ceaf5..d15ab8e5a3 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -358,13 +358,12 @@ func (sp *StateProcessor[ } if blk.GetSlot() != slot { return errors.Wrapf( - ErrSlotMismatch, - "expected: %d, got: %d", + ErrSlotMismatch, "expected: %d, got: %d", slot, blk.GetSlot(), ) } - // Verify the parent block root is correct. + // Verify that the block is newer than latest block header latestBlockHeader, err := st.GetLatestBlockHeader() if err != nil { return err @@ -376,14 +375,6 @@ func (sp *StateProcessor[ ) } - parentBlockRoot := latestBlockHeader.HashTreeRoot() - if parentBlockRoot != blk.GetParentBlockRoot() { - return errors.Wrapf(ErrParentRootMismatch, - "expected: %s, got: %s", - parentBlockRoot.String(), blk.GetParentBlockRoot().String(), - ) - } - // Verify that proposer matches with what consensus declares as proposer proposer, err := st.ValidatorByIndex(blk.GetProposerIndex()) if err != nil { @@ -400,26 +391,24 @@ func (sp *StateProcessor[ ) } - // Check to make sure the proposer isn't slashed. - if proposer.IsSlashed() { + // Verify that the parent matches + parentBlockRoot := latestBlockHeader.HashTreeRoot() + if parentBlockRoot != blk.GetParentBlockRoot() { return errors.Wrapf( - ErrSlashedProposer, - "index: %d", - blk.GetProposerIndex(), + ErrParentRootMismatch, "expected: %s, got: %s", + parentBlockRoot.String(), blk.GetParentBlockRoot().String(), ) } - // Ensure the block is within the acceptable range. - // TODO: move this is in the wrong spot. - deposits := blk.GetBody().GetDeposits() - if uint64(len(deposits)) > sp.cs.MaxDepositsPerBlock() { - return errors.Wrapf(ErrExceedsBlockDepositLimit, - "expected: %d, got: %d", - sp.cs.MaxDepositsPerBlock(), len(deposits), + // Verify proposer is not slashed + if proposer.IsSlashed() { + return errors.Wrapf( + ErrSlashedProposer, "index: %d", + blk.GetProposerIndex(), ) } - // Calculate the body root to place on the header. + // Cache current block as the new latest block bodyRoot := blk.GetBody().HashTreeRoot() var lbh BeaconBlockHeaderT lbh = lbh.New( diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index e6387c41bb..1cfb8fe90b 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -39,38 +39,21 @@ func (sp *StateProcessor[ st BeaconStateT, blk BeaconBlockT, ) error { - // Verify that outstanding deposits are processed up to the maximum number - // of deposits. + // Verify that outstanding deposits are processed + // up to the maximum number of deposits + + // TODO we should assert here that + // len(body.deposits) == min(MAX_DEPOSITS, + // state.eth1_data.deposit_count - state.eth1_deposit_index) + // Until we fix eth1Data we do a partial check deposits := blk.GetBody().GetDeposits() - index, err := st.GetEth1DepositIndex() - if err != nil { - return err - } - eth1Data, err := st.GetEth1Data() - if err != nil { - return err + if uint64(len(deposits)) > sp.cs.MaxDepositsPerBlock() { + return errors.Wrapf( + ErrExceedsBlockDepositLimit, "expected: %d, got: %d", + sp.cs.MaxDepositsPerBlock(), len(deposits), + ) } - 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") - // } - 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 34ea814d609ddb7b2d966810727e6a8aa04eebd8 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 10:32:29 +0100 Subject: [PATCH 53/77] nit --- mod/state-transition/pkg/core/state_processor.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index d15ab8e5a3..c85b27f762 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -519,8 +519,8 @@ func (sp *StateProcessor[ var ( hysteresisIncrement = sp.cs.EffectiveBalanceIncrement() / sp.cs.HysteresisQuotient() - downwardThreshold = hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier() - upwardThreshold = hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier() + downwardThreshold = math.Gwei(hysteresisIncrement * sp.cs.HysteresisDownwardMultiplier()) + upwardThreshold = math.Gwei(hysteresisIncrement * sp.cs.HysteresisUpwardMultiplier()) idx math.U64 balance math.Gwei @@ -537,8 +537,8 @@ func (sp *StateProcessor[ return err } - if balance+math.Gwei(downwardThreshold) < val.GetEffectiveBalance() || - val.GetEffectiveBalance()+math.Gwei(upwardThreshold) < balance { + if balance+downwardThreshold < val.GetEffectiveBalance() || + val.GetEffectiveBalance()+upwardThreshold < balance { updatedBalance := types.ComputeEffectiveBalance( balance, math.U64(sp.cs.EffectiveBalanceIncrement()), From e2962ac250a74ad6395b37cdfb0bc0a86da55a8d Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 14:46:00 +0100 Subject: [PATCH 54/77] fixed expectations in UTs --- mod/config/pkg/spec/testnet.go | 11 ++- .../pkg/core/state_processor_genesis_test.go | 8 +- .../pkg/core/state_processor_staking_test.go | 98 +++++++++++++++---- 3 files changed, 92 insertions(+), 25 deletions(-) diff --git a/mod/config/pkg/spec/testnet.go b/mod/config/pkg/spec/testnet.go index a9d2970506..29d3072949 100644 --- a/mod/config/pkg/spec/testnet.go +++ b/mod/config/pkg/spec/testnet.go @@ -60,10 +60,13 @@ func BaseSpec() chain.SpecData[ any, ]{ // // Gwei value constants. - MinDepositAmount: uint64(1e9), - MaxEffectiveBalance: uint64(32e9), - EjectionBalance: uint64(16e9), - EffectiveBalanceIncrement: uint64(1e9), + MinDepositAmount: uint64(1e9), + MaxEffectiveBalance: uint64(32e9), + EjectionBalance: uint64(16e9), + EffectiveBalanceIncrement: uint64(1e9), + HysteresisQuotient: uint64(4), + HysteresisDownwardMultiplier: uint64(1), + HysteresisUpwardMultiplier: uint64(5), // Time parameters constants. SlotsPerEpoch: 32, MinEpochsToInactivityPenalty: 4, 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 a1eb6f6091..66737dceb9 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis_test.go +++ b/mod/state-transition/pkg/core/state_processor_genesis_test.go @@ -128,7 +128,7 @@ func TestInitialize(t *testing.T) { ).Return(nil) // run test - vals, err := sp.InitializePreminedBeaconStateFromEth1( + genVals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, genDeposits, executionPayloadHeader, @@ -137,7 +137,7 @@ func TestInitialize(t *testing.T) { // check outputs require.NoError(t, err) - require.Len(t, vals, len(goodDeposits)) + require.Len(t, genVals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() @@ -274,7 +274,7 @@ func TestInitializeBartio(t *testing.T) { ).Return(nil) // run test - vals, err := sp.InitializePreminedBeaconStateFromEth1( + genVals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, genDeposits, executionPayloadHeader, @@ -283,7 +283,7 @@ func TestInitializeBartio(t *testing.T) { // check outputs require.NoError(t, err) - require.Len(t, vals, len(goodDeposits)) + require.Len(t, genVals, len(goodDeposits)) // check beacon state changes resSlot, err := beaconState.GetSlot() 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 162d5afbb7..072c8829f6 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -73,8 +73,7 @@ func TestTransitionUpdateValidators(t *testing.T) { ) ) - // Setup initial state via genesis - // TODO: consider instead setting state artificially + // STEP 0: Setup initial state via genesis var ( genDeposits = []*types.Deposit{ { @@ -105,16 +104,16 @@ func TestTransitionUpdateValidators(t *testing.T) { mock.Anything, mock.Anything, mock.Anything, ).Return(nil) - vals, err := sp.InitializePreminedBeaconStateFromEth1( + genVals, err := sp.InitializePreminedBeaconStateFromEth1( beaconState, genDeposits, genPayloadHeader, genVersion, ) require.NoError(t, err) - require.Len(t, vals, len(genDeposits)) + require.Len(t, genVals, len(genDeposits)) - // create test inputs + // STEP 1: top up a genesis validator balance var ( ctx = &transition.Context{ SkipPayloadVerification: true, @@ -131,7 +130,7 @@ func TestTransitionUpdateValidators(t *testing.T) { } ) - blk := buildNextBlock( + blk1 := buildNextBlock( t, beaconState, &types.BeaconBlockBody{ @@ -148,27 +147,92 @@ func TestTransitionUpdateValidators(t *testing.T) { ) // run the test - _, err = sp.Transition(ctx, beaconState, blk) + updatedVals, err := sp.Transition(ctx, beaconState, blk1) require.NoError(t, err) + require.Empty(t, updatedVals) // validators set updates only at epoch turn - // check validator is duly updated - expectedValBalance := genDeposits[0].Amount + blkDeposits[0].Amount + // check validator balances are duly updated, that is: + // - balance is updated immediately + // - effective balance is updated only at the epoch turn + expectedBalance := genDeposits[0].Amount + blkDeposits[0].Amount + expectedEffectiveBalance := genDeposits[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) + balance, err := beaconState.GetBalance(idx) require.NoError(t, err) - require.Equal(t, genDeposits[0].Pubkey, val.Pubkey) - require.Equal(t, expectedValBalance, val.EffectiveBalance) + require.Equal(t, expectedBalance, balance) - // check validator balance is updated - valBal, err := beaconState.GetBalance(idx) + val, err := beaconState.ValidatorByIndex(idx) require.NoError(t, err) - require.Equal(t, expectedValBalance, valBal) + require.Equal(t, expectedEffectiveBalance, val.EffectiveBalance) - // check that validator index is duly set (1-indexed here, to be fixed) + // check that validator index is still correct latestValIdx, err := beaconState.GetEth1DepositIndex() require.NoError(t, err) require.Equal(t, uint64(len(genDeposits)), latestValIdx) + + // STEP 2: check that effective balance is updated once next epoch arrives + var blk = blk1 + for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { + blk = buildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + updatedVals, err = sp.Transition(ctx, beaconState, blk) + require.NoError(t, err) + require.Empty(t, updatedVals) // validators set updates only at epoch + } + + // finally the block turning epoch + blk = buildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + nextEpochVals, err := sp.Transition(ctx, beaconState, blk) + require.NoError(t, err) + require.Len(t, nextEpochVals, len(genDeposits)) // just topped up one validator + + // Assuming genesis order is preserved here which is not necessary + // TODO: remove this assumption + + // all genesis validators other than the first are unchanged + for i := 1; i < len(genDeposits); i++ { + require.Equal(t, genVals[1], nextEpochVals[1]) + } + + expectedBalance = genDeposits[0].Amount + blkDeposits[0].Amount + expectedEffectiveBalance = expectedBalance + + balance, err = beaconState.GetBalance(idx) + require.NoError(t, err) + require.Equal(t, expectedBalance, balance) + + val, err = beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, expectedEffectiveBalance, val.EffectiveBalance) } From 0cdb569e00a2c7c306cd64063696752b284dd1a2 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 15:55:46 +0100 Subject: [PATCH 55/77] fixed validators balance update --- .../pkg/core/state_processor_committee.go | 3 ++ .../pkg/core/state_processor_genesis.go | 31 ++++++++++++++++--- .../pkg/core/state_processor_staking.go | 22 ++----------- .../pkg/core/state_processor_staking_test.go | 2 +- 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_committee.go b/mod/state-transition/pkg/core/state_processor_committee.go index 2bcc794e4f..70487a0acd 100644 --- a/mod/state-transition/pkg/core/state_processor_committee.go +++ b/mod/state-transition/pkg/core/state_processor_committee.go @@ -45,6 +45,9 @@ func (sp *StateProcessor[ } } + // TODO: a more efficient handling would be to only send back to consensus + // updated validators (including evicted ones), rather than the full list + return iter.MapErr( activeVals, func(val *ValidatorT) (*transition.ValidatorUpdate, error) { diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 9e7502b0df..1b6d51c7b1 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -21,6 +21,7 @@ package core import ( + "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "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/encoding/hex" @@ -106,17 +107,41 @@ func (sp *StateProcessor[ } } + // Process deposits for _, deposit := range deposits { if err := sp.processDeposit(st, deposit); err != nil { return nil, err } } - // TODO: process activations. + // Process activations validators, err := st.GetValidators() if err != nil { return nil, err } + for _, val := range validators { + var idx math.ValidatorIndex + idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) + if err != nil { + return nil, err + } + + var balance math.Gwei + balance, err = st.GetBalance(idx) + if err != nil { + return nil, err + } + + updatedBalance := types.ComputeEffectiveBalance( + balance, + math.Gwei(sp.cs.EffectiveBalanceIncrement()), + math.Gwei(sp.cs.MaxEffectiveBalance()), + ) + val.SetEffectiveBalance(updatedBalance) + if err = st.UpdateValidatorAtIndex(idx, val); err != nil { + return nil, err + } + } // Handle special case bartio genesis. if sp.cs.DepositEth1ChainID() == bArtioChainID { @@ -150,9 +175,7 @@ func (sp *StateProcessor[ return nil, err } - if err = st.SetNextWithdrawalValidatorIndex( - 0, - ); err != nil { + if err = st.SetNextWithdrawalValidatorIndex(0); 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 1cfb8fe90b..a055dff262 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -23,7 +23,6 @@ package core import ( "fmt" - "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "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" @@ -103,27 +102,12 @@ func (sp *StateProcessor[ idx, err := st.ValidatorIndexByPubkey(dep.GetPubkey()) if err != nil { // If the validator does not exist, we add the validator. - // Add the validator to the registry. + // TODO: improve error handling by distinguishing + // validator not found from other kind of errors return sp.createValidator(st, dep) } - // If the validator already exists, we update the balance. - var val ValidatorT - val, err = st.ValidatorByIndex(idx) - if err != nil { - return err - } - - // TODO: Modify balance here and then effective balance once per epoch. - updatedBalance := types.ComputeEffectiveBalance( - val.GetEffectiveBalance()+dep.GetAmount(), - math.Gwei(sp.cs.EffectiveBalanceIncrement()), - math.Gwei(sp.cs.MaxEffectiveBalance()), - ) - val.SetEffectiveBalance(updatedBalance) - if err = st.UpdateValidatorAtIndex(idx, val); err != nil { - return err - } + // if validator exist, just update its balance return st.IncreaseBalance(idx, dep.GetAmount()) } 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 072c8829f6..b1f82e12c7 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -124,7 +124,7 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: genDeposits[0].Pubkey, Credentials: emptyCredentials, - Amount: increment, // avoid breaching maxBalance + Amount: 2 * increment, // twice to account for hysteresis Index: uint64(len(genDeposits)), }, } From 3f3d4ebcf0c512136612bcee21c95be750d8bb45 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 16:21:06 +0100 Subject: [PATCH 56/77] nits --- .../pkg/core/state_processor_genesis.go | 69 ++++++++----------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 1b6d51c7b1..502447f21c 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -45,7 +45,7 @@ func (sp *StateProcessor[ ]) InitializePreminedBeaconStateFromEth1( st BeaconStateT, deposits []DepositT, - executionPayloadHeader ExecutionPayloadHeaderT, + execPayloadHeader ExecutionPayloadHeaderT, genesisVersion common.Version, ) (transition.ValidatorUpdates, error) { sp.processingGenesis = true @@ -53,55 +53,53 @@ func (sp *StateProcessor[ sp.processingGenesis = false }() - var ( - blkHeader BeaconBlockHeaderT - blkBody BeaconBlockBodyT - fork ForkT - eth1Data Eth1DataT - ) + if err := st.SetSlot(0); err != nil { + return nil, err + } + + var fork ForkT fork = fork.New( genesisVersion, genesisVersion, math.U64(constants.GenesisEpoch), ) - - if err := st.SetSlot(0); err != nil { - return nil, err - } - if err := st.SetFork(fork); err != nil { return nil, err } // Eth1DepositIndex will be set in processDeposit - if err := st.SetEth1Data( - eth1Data.New( - common.Root{}, - 0, - executionPayloadHeader.GetBlockHash(), - )); err != nil { + var eth1Data Eth1DataT + eth1Data = eth1Data.New( + common.Root{}, + 0, + execPayloadHeader.GetBlockHash(), + ) + if err := st.SetEth1Data(eth1Data); 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, // slot - 0, // proposer index - common.Root{}, // parent block root - common.Root{}, // state root - bodyRoot, - )); err != nil { + // TODO: we need to handle common.Version vs uint32 better. + var blkBody BeaconBlockBodyT + blkBody = blkBody.Empty(version.ToUint32(genesisVersion)) + + var blkHeader BeaconBlockHeaderT + blkHeader = blkHeader.New( + 0, // slot + 0, // proposer index + common.Root{}, // parent block root + common.Root{}, // state root + blkBody.HashTreeRoot(), // body root + + ) + if err := st.SetLatestBlockHeader(blkHeader); err != nil { return nil, err } for i := range sp.cs.EpochsPerHistoricalVector() { if err := st.UpdateRandaoMixAtIndex( i, - common.Bytes32(executionPayloadHeader.GetBlockHash()), + common.Bytes32(execPayloadHeader.GetBlockHash()), ); err != nil { return nil, err } @@ -154,9 +152,7 @@ func (sp *StateProcessor[ return nil, err } - if err = st.SetLatestExecutionPayloadHeader( - executionPayloadHeader, - ); err != nil { + if err = st.SetLatestExecutionPayloadHeader(execPayloadHeader); err != nil { return nil, err } @@ -183,10 +179,5 @@ func (sp *StateProcessor[ return nil, err } - var updates transition.ValidatorUpdates - updates, err = sp.processSyncCommitteeUpdates(st) - if err != nil { - return nil, err - } - return updates, nil + return sp.processSyncCommitteeUpdates(st) } From 3d9e3abb0a15edf694908eb581099b2c571a7d19 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 16:56:28 +0100 Subject: [PATCH 57/77] fixed faulty assertion in UTs --- .../pkg/core/state_processor_staking_test.go | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) 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 b1f82e12c7..600c263ccb 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -21,6 +21,7 @@ package core_test import ( + "fmt" "testing" "github.com/berachain/beacon-kit/mod/config/pkg/spec" @@ -79,7 +80,7 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: [48]byte{0x01}, Credentials: emptyCredentials, - Amount: maxBalance - 3*increment, + Amount: minBalance + increment, Index: uint64(0), }, { @@ -91,7 +92,7 @@ func TestTransitionUpdateValidators(t *testing.T) { { Pubkey: [48]byte{0x03}, Credentials: emptyCredentials, - Amount: minBalance + increment, + Amount: maxBalance - 3*increment, Index: uint64(2), }, } @@ -120,13 +121,11 @@ func TestTransitionUpdateValidators(t *testing.T) { SkipValidateResult: true, ProposerAddress: dummyProposerAddr, } - blkDeposits = []*types.Deposit{ - { - Pubkey: genDeposits[0].Pubkey, - Credentials: emptyCredentials, - Amount: 2 * increment, // twice to account for hysteresis - Index: uint64(len(genDeposits)), - }, + blkDeposit = &types.Deposit{ + Pubkey: genDeposits[2].Pubkey, + Credentials: emptyCredentials, + Amount: 2 * increment, // twice to account for hysteresis + Index: uint64(len(genDeposits)), } ) @@ -142,7 +141,7 @@ func TestTransitionUpdateValidators(t *testing.T) { BaseFeePerGas: math.NewU256(0), }, Eth1Data: &types.Eth1Data{}, - Deposits: blkDeposits, + Deposits: []*types.Deposit{blkDeposit}, }, ) @@ -154,9 +153,9 @@ func TestTransitionUpdateValidators(t *testing.T) { // check validator balances are duly updated, that is: // - balance is updated immediately // - effective balance is updated only at the epoch turn - expectedBalance := genDeposits[0].Amount + blkDeposits[0].Amount - expectedEffectiveBalance := genDeposits[0].Amount - idx, err := beaconState.ValidatorIndexByPubkey(genDeposits[0].Pubkey) + expectedBalance := genDeposits[2].Amount + blkDeposit.Amount + expectedEffectiveBalance := genDeposits[2].Amount + idx, err := beaconState.ValidatorIndexByPubkey(genDeposits[2].Pubkey) require.NoError(t, err) balance, err := beaconState.GetBalance(idx) @@ -213,19 +212,19 @@ func TestTransitionUpdateValidators(t *testing.T) { }, ) - nextEpochVals, err := sp.Transition(ctx, beaconState, blk) + newEpochVals, err := sp.Transition(ctx, beaconState, blk) require.NoError(t, err) - require.Len(t, nextEpochVals, len(genDeposits)) // just topped up one validator + require.Len(t, newEpochVals, len(genDeposits)) // just topped up one validator // Assuming genesis order is preserved here which is not necessary // TODO: remove this assumption - // all genesis validators other than the first are unchanged - for i := 1; i < len(genDeposits); i++ { - require.Equal(t, genVals[1], nextEpochVals[1]) + // all genesis validators other than the last are unchanged + for i := range len(genDeposits) - 1 { + require.Equal(t, genVals[i], newEpochVals[i], fmt.Sprintf("idx: %d", i)) } - expectedBalance = genDeposits[0].Amount + blkDeposits[0].Amount + expectedBalance = genDeposits[2].Amount + blkDeposit.Amount expectedEffectiveBalance = expectedBalance balance, err = beaconState.GetBalance(idx) From 01839149b5d59cc99c7aee03cffcad0924fe8455 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 20:30:39 +0100 Subject: [PATCH 58/77] added UT for validator creation --- mod/state-transition/pkg/core/errors.go | 2 + .../pkg/core/state_processor_genesis.go | 63 +++--- .../pkg/core/state_processor_staking_test.go | 192 +++++++++++++++++- 3 files changed, 216 insertions(+), 41 deletions(-) diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index a0e2160ac8..5d6bc8ebe6 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -30,6 +30,8 @@ var ( // match the expected value. ErrSlotMismatch = errors.New("slot mismatch") + // ErrProposerMismatch is returned when block builder does not match + // with the proposer reported by consensus. ErrProposerMismatch = errors.New("proposer key mismatch") // ErrParentRootMismatch is returned when the parent root in an execution diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 502447f21c..4d5531aea4 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -21,7 +21,6 @@ package core import ( - "github.com/berachain/beacon-kit/mod/consensus-types/pkg/types" "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/encoding/hex" @@ -112,70 +111,58 @@ func (sp *StateProcessor[ } } - // Process activations - validators, err := st.GetValidators() - if err != nil { - return nil, err - } - for _, val := range validators { - var idx math.ValidatorIndex - idx, err = st.ValidatorIndexByPubkey(val.GetPubkey()) - if err != nil { - return nil, err - } + // Currently we don't really process activations for validator. + // We do not update ActivationEligibilityEpoch nor ActivationEpoch + // for validators. + // A validator is created with its EffectiveBalance duly set + // (as in Eth 2.0 specs). The EffectiveBalance is updated at the + // turn of the epoch, when the consensus is made aware of the + // validator existence as well. + // TODO: this is likely to change once we introduce a cap on + // the validators set, in which case some validators may be evicted + // from the validator set because the cap is reached. - var balance math.Gwei - balance, err = st.GetBalance(idx) - if err != nil { + // Handle special case bartio genesis. + if sp.cs.DepositEth1ChainID() == bArtioChainID { + validatorsRoot := common.Root(hex.MustToBytes(bArtioValRoot)) + if err := st.SetGenesisValidatorsRoot(validatorsRoot); err != nil { return nil, err } - - updatedBalance := types.ComputeEffectiveBalance( - balance, - math.Gwei(sp.cs.EffectiveBalanceIncrement()), - math.Gwei(sp.cs.MaxEffectiveBalance()), - ) - val.SetEffectiveBalance(updatedBalance) - if err = st.UpdateValidatorAtIndex(idx, val); err != nil { + } else { + validators, err := st.GetValidators() + if err != nil { return nil, err } - } - - // Handle special case bartio genesis. - if sp.cs.DepositEth1ChainID() == bArtioChainID { - if err = st.SetGenesisValidatorsRoot( - common.Root(hex.MustToBytes(bArtioValRoot))); err != nil { + if err = st. + SetGenesisValidatorsRoot(validators.HashTreeRoot()); err != nil { return nil, err } - } else if err = st. - SetGenesisValidatorsRoot(validators.HashTreeRoot()); err != nil { - return nil, err } - if err = st.SetLatestExecutionPayloadHeader(execPayloadHeader); err != nil { + if err := st.SetLatestExecutionPayloadHeader(execPayloadHeader); err != nil { return nil, err } // Setup a bunch of 0s to prime the DB. for i := range sp.cs.HistoricalRootsLimit() { //#nosec:G701 // won't overflow in practice. - if err = st.UpdateBlockRootAtIndex(i, common.Root{}); err != nil { + if err := st.UpdateBlockRootAtIndex(i, common.Root{}); err != nil { return nil, err } - if err = st.UpdateStateRootAtIndex(i, common.Root{}); err != nil { + if err := st.UpdateStateRootAtIndex(i, common.Root{}); err != nil { return nil, err } } - if err = st.SetNextWithdrawalIndex(0); err != nil { + if err := st.SetNextWithdrawalIndex(0); err != nil { return nil, err } - if err = st.SetNextWithdrawalValidatorIndex(0); err != nil { + if err := st.SetNextWithdrawalValidatorIndex(0); err != nil { return nil, err } - if err = st.SetTotalSlashing(0); err != nil { + if err := st.SetTotalSlashing(0); err != nil { return nil, 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 600c263ccb..6cc2c055dd 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -38,9 +38,9 @@ import ( "github.com/stretchr/testify/require" ) -// TestTransitionUpdateValidators shows that when validator is -// updated (increasing amount), corresponding balance is updated. -func TestTransitionUpdateValidators(t *testing.T) { +// TestTransitionUpdateValidator shows the lifecycle +// of a validator's balance updates. +func TestTransitionUpdateValidator(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() execEngine := mocks.NewExecutionEngine[ @@ -235,3 +235,189 @@ func TestTransitionUpdateValidators(t *testing.T) { require.NoError(t, err) require.Equal(t, expectedEffectiveBalance, val.EffectiveBalance) } + +// TestTransitionCreateValidator shows the lifecycle +// of a validator creation. +func TestTransitionCreateValidator(t *testing.T) { + // Create state processor to test + cs := spec.BetnetChainSpec() + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} + dummyProposerAddr := []byte{0xff} + + sp := createStateProcessor( + cs, + execEngine, + mocksSigner, + func(bytes.B48) ([]byte, error) { + return dummyProposerAddr, nil + }, + ) + + kvStore, err := initStore() + require.NoError(t, err) + beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + emptyAddress = common.ExecutionAddress{} + emptyCredentials = types.NewCredentialsFromExecutionAddress( + emptyAddress, + ) + ) + + // STEP 0: Setup initial state via genesis + var ( + genDeposits = []*types.Deposit{ + { + Pubkey: [48]byte{0x01}, + Credentials: emptyCredentials, + Amount: minBalance + increment, + Index: uint64(0), + }, + } + genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genVersion = version.FromUint32[common.Version](version.Deneb) + ) + + mocksSigner.On( + "VerifySignature", + mock.Anything, mock.Anything, mock.Anything, + ).Return(nil) + + genVals, err := sp.InitializePreminedBeaconStateFromEth1( + beaconState, + genDeposits, + genPayloadHeader, + genVersion, + ) + require.NoError(t, err) + require.Len(t, genVals, len(genDeposits)) + + // STEP 1: top up a genesis validator balance + var ( + ctx = &transition.Context{ + SkipPayloadVerification: true, + SkipValidateResult: true, + ProposerAddress: dummyProposerAddr, + } + blkDeposit = &types.Deposit{ + Pubkey: [48]byte{0xff}, // a new key for a new validator + Credentials: emptyCredentials, + Amount: maxBalance, + Index: uint64(len(genDeposits)), + } + ) + + blk1 := buildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: 10, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{blkDeposit}, + }, + ) + + // run the test + updatedVals, err := sp.Transition(ctx, beaconState, blk1) + require.NoError(t, err) + require.Empty(t, updatedVals) // validators set updates only at epoch turn + + // check validator balances are duly updated + var ( + expectedBalance = blkDeposit.Amount + expectedEffectiveBalance = expectedBalance + ) + idx, err := beaconState.ValidatorIndexByPubkey(blkDeposit.Pubkey) + require.NoError(t, err) + + balance, err := beaconState.GetBalance(idx) + require.NoError(t, err) + require.Equal(t, expectedBalance, balance) + + val, err := beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, expectedEffectiveBalance, val.EffectiveBalance) + + // check that validator index is still correct + latestValIdx, err := beaconState.GetEth1DepositIndex() + require.NoError(t, err) + require.Equal(t, uint64(len(genDeposits)), latestValIdx) + + // STEP 2: check that effective balance is updated once next epoch arrives + var blk = blk1 + for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { + blk = buildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + updatedVals, err = sp.Transition(ctx, beaconState, blk) + require.NoError(t, err) + require.Empty(t, updatedVals) // validators set updates only at epoch + } + + // finally the block turning epoch + blk = buildNextBlock( + t, + beaconState, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + newEpochVals, err := sp.Transition(ctx, beaconState, blk) + require.NoError(t, err) + require.Len(t, newEpochVals, len(genDeposits)+1) + + // Assuming genesis order is preserved here which is not necessary + // TODO: remove this assumption + + // all genesis validators are unchanged + for i := range len(genDeposits) { + require.Equal(t, genVals[i], newEpochVals[i], fmt.Sprintf("idx: %d", i)) + } + + expectedBalance = blkDeposit.Amount + expectedEffectiveBalance = expectedBalance + + balance, err = beaconState.GetBalance(idx) + require.NoError(t, err) + require.Equal(t, expectedBalance, balance) + + val, err = beaconState.ValidatorByIndex(idx) + require.NoError(t, err) + require.Equal(t, expectedEffectiveBalance, val.EffectiveBalance) +} From eda790978259f35f3463cadb133253d55f1d32d6 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 21:42:15 +0100 Subject: [PATCH 59/77] minor processSyncCommitteeUpdates renaming --- mod/state-transition/pkg/core/state_processor.go | 2 +- mod/state-transition/pkg/core/state_processor_genesis.go | 2 +- ..._processor_committee.go => state_processor_validators.go} | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) rename mod/state-transition/pkg/core/{state_processor_committee.go => state_processor_validators.go} (94%) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index c85b27f762..ccf143a969 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -338,7 +338,7 @@ func (sp *StateProcessor[ if err := sp.processRandaoMixesReset(st); err != nil { return nil, err } - return sp.processSyncCommitteeUpdates(st) + return sp.processValidatorsSetUpdates(st) } // processBlockHeader processes the header and ensures it matches the local diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 4d5531aea4..bac3af3716 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -166,5 +166,5 @@ func (sp *StateProcessor[ return nil, err } - return sp.processSyncCommitteeUpdates(st) + return sp.processValidatorsSetUpdates(st) } diff --git a/mod/state-transition/pkg/core/state_processor_committee.go b/mod/state-transition/pkg/core/state_processor_validators.go similarity index 94% rename from mod/state-transition/pkg/core/state_processor_committee.go rename to mod/state-transition/pkg/core/state_processor_validators.go index 70487a0acd..f9fb35b6f6 100644 --- a/mod/state-transition/pkg/core/state_processor_committee.go +++ b/mod/state-transition/pkg/core/state_processor_validators.go @@ -26,10 +26,11 @@ import ( "github.com/sourcegraph/conc/iter" ) -// processSyncCommitteeUpdates processes the sync committee updates. +// processValidatorsSetUpdates returns the validators set updates that +// will be used by consensus func (sp *StateProcessor[ _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, -]) processSyncCommitteeUpdates( +]) processValidatorsSetUpdates( st BeaconStateT, ) (transition.ValidatorUpdates, error) { vals, err := st.GetValidatorsByEffectiveBalance() From c6b5586171e4d9e6999fe1238d23ce260a8b6d27 Mon Sep 17 00:00:00 2001 From: aBear Date: Sat, 9 Nov 2024 23:15:29 +0100 Subject: [PATCH 60/77] send only validators set diffs --- .../pkg/core/state_processor.go | 6 +++ .../pkg/core/state_processor_staking_test.go | 21 +------- .../pkg/core/state_processor_validators.go | 52 +++++++++++++++++-- 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor.go b/mod/state-transition/pkg/core/state_processor.go index ccf143a969..bcaa2f0198 100644 --- a/mod/state-transition/pkg/core/state_processor.go +++ b/mod/state-transition/pkg/core/state_processor.go @@ -94,6 +94,11 @@ type StateProcessor[ // processingGenesis allows initializing correctly // eth1 deposit index upon genesis processingGenesis bool + + // prevEpochValidators tracks the set of validators active during + // previous epoch. This is useful at the turn of the epoch to send to + // consensus only the diffs rather than the full updated validator set. + prevEpochValidators []*transition.ValidatorUpdate } // NewStateProcessor creates a new state processor. @@ -163,6 +168,7 @@ func NewStateProcessor[ executionEngine: executionEngine, signer: signer, fGetAddressFromPubKey: fGetAddressFromPubKey, + prevEpochValidators: make([]*transition.ValidatorUpdate, 0), } } 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 6cc2c055dd..d361cfd154 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -21,7 +21,6 @@ package core_test import ( - "fmt" "testing" "github.com/berachain/beacon-kit/mod/config/pkg/spec" @@ -214,15 +213,7 @@ func TestTransitionUpdateValidator(t *testing.T) { newEpochVals, err := sp.Transition(ctx, beaconState, blk) require.NoError(t, err) - require.Len(t, newEpochVals, len(genDeposits)) // just topped up one validator - - // Assuming genesis order is preserved here which is not necessary - // TODO: remove this assumption - - // all genesis validators other than the last are unchanged - for i := range len(genDeposits) - 1 { - require.Equal(t, genVals[i], newEpochVals[i], fmt.Sprintf("idx: %d", i)) - } + require.Len(t, newEpochVals, 1) // just topped up one validator expectedBalance = genDeposits[2].Amount + blkDeposit.Amount expectedEffectiveBalance = expectedBalance @@ -400,15 +391,7 @@ func TestTransitionCreateValidator(t *testing.T) { newEpochVals, err := sp.Transition(ctx, beaconState, blk) require.NoError(t, err) - require.Len(t, newEpochVals, len(genDeposits)+1) - - // Assuming genesis order is preserved here which is not necessary - // TODO: remove this assumption - - // all genesis validators are unchanged - for i := range len(genDeposits) { - require.Equal(t, genVals[i], newEpochVals[i], fmt.Sprintf("idx: %d", i)) - } + require.Len(t, newEpochVals, 1) // just added 1 validator expectedBalance = blkDeposit.Amount expectedEffectiveBalance = expectedBalance diff --git a/mod/state-transition/pkg/core/state_processor_validators.go b/mod/state-transition/pkg/core/state_processor_validators.go index f9fb35b6f6..d252c0acf8 100644 --- a/mod/state-transition/pkg/core/state_processor_validators.go +++ b/mod/state-transition/pkg/core/state_processor_validators.go @@ -21,13 +21,14 @@ package core import ( + "github.com/berachain/beacon-kit/mod/primitives/pkg/bytes" "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "github.com/berachain/beacon-kit/mod/primitives/pkg/transition" "github.com/sourcegraph/conc/iter" ) // processValidatorsSetUpdates returns the validators set updates that -// will be used by consensus +// will be used by consensus. func (sp *StateProcessor[ _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, ]) processValidatorsSetUpdates( @@ -46,10 +47,10 @@ func (sp *StateProcessor[ } } - // TODO: a more efficient handling would be to only send back to consensus - // updated validators (including evicted ones), rather than the full list - - return iter.MapErr( + // We need to inform consensus of the changes incurred by the validator set + // We strive to send only diffs (added,updated or removed validators) and + // avoid re-sending validators that have not changed. + currentValSet, err := iter.MapErr( activeVals, func(val *ValidatorT) (*transition.ValidatorUpdate, error) { v := (*val) @@ -59,4 +60,45 @@ func (sp *StateProcessor[ }, nil }, ) + if err != nil { + return nil, err + } + + res := make([]*transition.ValidatorUpdate, 0) + + prevValsSet := make(map[string]math.Gwei, len(sp.prevEpochValidators)) + for _, v := range sp.prevEpochValidators { + prevValsSet[string(v.Pubkey[:])] = v.EffectiveBalance + } + + for _, newVal := range currentValSet { + key := string(newVal.Pubkey[:]) + oldBal, found := prevValsSet[key] + if !found { + // new validator, we add it with its weight + res = append(res, newVal) + continue + } + if oldBal != newVal.EffectiveBalance { + // validator updated, we add it with new weight + res = append(res, newVal) + } + + // consume pre-existing validators + delete(prevValsSet, key) + } + + // prevValsSet now contains all evicted validators (and only those) + for pkBytes := range prevValsSet { + //#nosec:G703 // bytes comes from a pk + pk, _ := bytes.ToBytes48([]byte(pkBytes)) + res = append(res, &transition.ValidatorUpdate{ + Pubkey: pk, + EffectiveBalance: 0, // signal val eviction to consensus + }) + } + + // rotate validators set to new epoch ones + sp.prevEpochValidators = currentValSet + return res, nil } From e9f01e2e9dcd79630fb4833560d731baa0399aca Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 01:18:25 +0100 Subject: [PATCH 61/77] minor UT code consolidation --- mod/state-transition/pkg/core/helpers_test.go | 16 ++++ .../pkg/core/state_processor_staking_test.go | 80 +++++-------------- 2 files changed, 37 insertions(+), 59 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index 2b84fcbd56..f2279c50b2 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -35,6 +35,7 @@ import ( "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" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "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" @@ -219,3 +220,18 @@ func buildNextBlock( Body: nextBlkBody, } } + +var ( + emptyAddress = common.ExecutionAddress{} + emptyCredentials = types.NewCredentialsFromExecutionAddress( + emptyAddress, + ) + + dummyExecutionPayload = &types.ExecutionPayload{ + Timestamp: 0, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + } +) 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 d361cfd154..e929d060dd 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -64,13 +64,9 @@ func TestTransitionUpdateValidator(t *testing.T) { beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - increment = math.Gwei(cs.EffectiveBalanceIncrement()) - minBalance = math.Gwei(cs.EjectionBalance()) - emptyAddress = common.ExecutionAddress{} - emptyCredentials = types.NewCredentialsFromExecutionAddress( - emptyAddress, - ) + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) // STEP 0: Setup initial state via genesis @@ -177,15 +173,9 @@ func TestTransitionUpdateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -199,15 +189,9 @@ func TestTransitionUpdateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -254,13 +238,9 @@ func TestTransitionCreateValidator(t *testing.T) { beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - increment = math.Gwei(cs.EffectiveBalanceIncrement()) - minBalance = math.Gwei(cs.EjectionBalance()) - emptyAddress = common.ExecutionAddress{} - emptyCredentials = types.NewCredentialsFromExecutionAddress( - emptyAddress, - ) + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) // STEP 0: Setup initial state via genesis @@ -310,15 +290,9 @@ func TestTransitionCreateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{blkDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{blkDeposit}, }, ) @@ -355,15 +329,9 @@ func TestTransitionCreateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -377,15 +345,9 @@ func TestTransitionCreateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) From 3bc76787a10b673c0dfd68d85c3b7c9ecbec7a00 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 01:28:14 +0100 Subject: [PATCH 62/77] appease linter --- mod/state-transition/pkg/core/state_processor_staking_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 e929d060dd..3fe1af9350 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -167,7 +167,7 @@ func TestTransitionUpdateValidator(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) // STEP 2: check that effective balance is updated once next epoch arrives - var blk = blk1 + var blk *types.BeaconBlock for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, @@ -323,7 +323,7 @@ func TestTransitionCreateValidator(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) // STEP 2: check that effective balance is updated once next epoch arrives - var blk = blk1 + var blk *types.BeaconBlock for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, From 679da518c3bbb246bb74436c9f2c259254621cf7 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 16:03:16 +0100 Subject: [PATCH 63/77] nits --- mod/chain-spec/pkg/chain/chain_spec.go | 7 +++++++ mod/chain-spec/pkg/chain/data.go | 5 +++-- .../pkg/core/state_processor_genesis.go | 11 ----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 2e76c60ae0..21877edcad 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -45,10 +45,17 @@ type Spec[ // calculations. EffectiveBalanceIncrement() uint64 + // HysteresisQuotient returns the quotient used in effective balance + // calculations to create hysteresis. This provides resistance to small + // balance changes triggering effective balance updates. HysteresisQuotient() uint64 + // HysteresisDownwardMultiplier returns the multiplier used when checking + // if the effective balance should be decreased. HysteresisDownwardMultiplier() uint64 + // HysteresisUpwardMultiplier returns the multiplier used when checking + // if the effective balance should be increased. HysteresisUpwardMultiplier() uint64 // Time parameters constants. diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index b8eefc34e6..d41ffa4479 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -43,10 +43,11 @@ type SpecData[ // EffectiveBalanceIncrement is the effective balance increment. EffectiveBalanceIncrement uint64 `mapstructure:"effective-balance-increment"` + // HysteresisQuotient is the quotient used in effective balance calculations HysteresisQuotient uint64 `mapstructure:"hysteresis-quotient"` - + // HysteresisDownwardMultiplier is the multiplier for downward balance adjustments. HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"` - + // HysteresisUpwardMultiplier is the multiplier for upward balance adjustments. HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"` // Time parameters constants. // diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index 4d5531aea4..13907fb4fe 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -111,17 +111,6 @@ func (sp *StateProcessor[ } } - // Currently we don't really process activations for validator. - // We do not update ActivationEligibilityEpoch nor ActivationEpoch - // for validators. - // A validator is created with its EffectiveBalance duly set - // (as in Eth 2.0 specs). The EffectiveBalance is updated at the - // turn of the epoch, when the consensus is made aware of the - // validator existence as well. - // TODO: this is likely to change once we introduce a cap on - // the validators set, in which case some validators may be evicted - // from the validator set because the cap is reached. - // Handle special case bartio genesis. if sp.cs.DepositEth1ChainID() == bArtioChainID { validatorsRoot := common.Root(hex.MustToBytes(bArtioValRoot)) From b6d62c5f509b01f95a16d3143043159f50834f43 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 16:18:25 +0100 Subject: [PATCH 64/77] minor readme --- mod/state-transition/pkg/core/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 mod/state-transition/pkg/core/README.md diff --git a/mod/state-transition/pkg/core/README.md b/mod/state-transition/pkg/core/README.md new file mode 100644 index 0000000000..27d755d97b --- /dev/null +++ b/mod/state-transition/pkg/core/README.md @@ -0,0 +1,11 @@ +# State Processor + +## Validators handling + +Currently: + +- Any validator whose effective balance is above `EjectionBalance` will stay a validator forever, as we have not (yet) implemented withdrawals facilities. +- Withdrawals are automatically generated only if a validator effective balance goes beyond `MaxEffectiveBalance`. In this case enough balance is scheduled for withdrawal, just enough to make validator's effective balance equal to `MaxEffectiveBalance`. Since `MaxEffectiveBalance` > `EjectionBalance`, the validator will keep being a validator. +- If a deposit is made for a validator with a balance smaller or equal to `EjectionBalance`, no validator will be created[^1] because of the insufficient balance. However currently the whole deposited balance is **not** scheduled for withdrawal at the next epoch. + +[^1]: Technically a validator is made in the BeaconKit state to track the deposit, but such a validator is never returned to the consensus engine. Moreover the deposit should be evicted at the next epoch. From 260bddb019a88350b0edc6b9ceb063f2e003d6b6 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 17:24:01 +0100 Subject: [PATCH 65/77] nit --- .../pkg/core/state_processor_staking_test.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 3fe1af9350..97db962221 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -128,15 +128,9 @@ func TestTransitionUpdateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{blkDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{blkDeposit}, }, ) From f3c2b50a271056f31f3b93f8587103f39b97dcf4 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 17:38:40 +0100 Subject: [PATCH 66/77] README nit --- mod/state-transition/pkg/core/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/state-transition/pkg/core/README.md b/mod/state-transition/pkg/core/README.md index 27d755d97b..7603024a99 100644 --- a/mod/state-transition/pkg/core/README.md +++ b/mod/state-transition/pkg/core/README.md @@ -7,5 +7,6 @@ Currently: - Any validator whose effective balance is above `EjectionBalance` will stay a validator forever, as we have not (yet) implemented withdrawals facilities. - Withdrawals are automatically generated only if a validator effective balance goes beyond `MaxEffectiveBalance`. In this case enough balance is scheduled for withdrawal, just enough to make validator's effective balance equal to `MaxEffectiveBalance`. Since `MaxEffectiveBalance` > `EjectionBalance`, the validator will keep being a validator. - If a deposit is made for a validator with a balance smaller or equal to `EjectionBalance`, no validator will be created[^1] because of the insufficient balance. However currently the whole deposited balance is **not** scheduled for withdrawal at the next epoch. +- Validators returned to consensus engine are guaranteed to have their effective balance ranging between `EjectionBalance` excluded (by filtering out state validators with smaller balance) and `MaxEffectiveBalance` included (by valdiators construction). Moreover only diffs with respect to previous epoch validator set are returned as an optimization measure. [^1]: Technically a validator is made in the BeaconKit state to track the deposit, but such a validator is never returned to the consensus engine. Moreover the deposit should be evicted at the next epoch. From 9b139f8fa8cc55cfc2d68021e75ac618268122a1 Mon Sep 17 00:00:00 2001 From: aBear Date: Sun, 10 Nov 2024 23:19:41 +0100 Subject: [PATCH 67/77] added UT for double eviction --- mod/state-transition/pkg/core/helpers_test.go | 16 + .../pkg/core/state_processor_staking_test.go | 362 ++++++++++++------ 2 files changed, 262 insertions(+), 116 deletions(-) diff --git a/mod/state-transition/pkg/core/helpers_test.go b/mod/state-transition/pkg/core/helpers_test.go index d5b4132289..6961d137d8 100644 --- a/mod/state-transition/pkg/core/helpers_test.go +++ b/mod/state-transition/pkg/core/helpers_test.go @@ -35,6 +35,7 @@ import ( "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" + "github.com/berachain/beacon-kit/mod/primitives/pkg/math" "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" @@ -220,6 +221,21 @@ func buildNextBlock( } } +var ( + emptyAddress = common.ExecutionAddress{} + emptyCredentials = types.NewCredentialsFromExecutionAddress( + emptyAddress, + ) + + dummyExecutionPayload = &types.ExecutionPayload{ + Timestamp: 0, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{}, + BaseFeePerGas: math.NewU256(0), + } +) + // ValUpdatesDiff returns elements of slice a that are not in b. func ValUpdatesDiff( a, b []*transition.ValidatorUpdate, 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 5ceeb47047..cc849e21c7 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -67,13 +67,9 @@ func TestTransitionUpdateValidator(t *testing.T) { beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - increment = math.Gwei(cs.EffectiveBalanceIncrement()) - minBalance = math.Gwei(cs.EjectionBalance()) - emptyAddress = common.ExecutionAddress{} - emptyCredentials = types.NewCredentialsFromExecutionAddress( - emptyAddress, - ) + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) // STEP 0: Setup initial state via genesis @@ -135,15 +131,9 @@ func TestTransitionUpdateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{blkDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{blkDeposit}, }, ) @@ -174,21 +164,15 @@ func TestTransitionUpdateValidator(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) // STEP 2: check that effective balance is updated once next epoch arrives - var blk = blk1 + var blk *types.BeaconBlock for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -202,15 +186,9 @@ func TestTransitionUpdateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -265,13 +243,9 @@ func TestTransitionCreateValidator(t *testing.T) { beaconState := new(TestBeaconStateT).NewFromDB(kvStore, cs) var ( - maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - increment = math.Gwei(cs.EffectiveBalanceIncrement()) - minBalance = math.Gwei(cs.EjectionBalance()) - emptyAddress = common.ExecutionAddress{} - emptyCredentials = types.NewCredentialsFromExecutionAddress( - emptyAddress, - ) + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) ) // STEP 0: Setup initial state via genesis @@ -321,15 +295,9 @@ func TestTransitionCreateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{blkDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{blkDeposit}, }, ) @@ -360,21 +328,15 @@ func TestTransitionCreateValidator(t *testing.T) { require.Equal(t, uint64(len(genDeposits)), latestValIdx) // STEP 2: check that effective balance is updated once next epoch arrives - var blk = blk1 + var blk *types.BeaconBlock for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -388,15 +350,9 @@ func TestTransitionCreateValidator(t *testing.T) { t, beaconState, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -457,7 +413,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { rndSeed = 2024 // seed used to generate unique random value ) - // STEP 1: Setup genesis with GetValidatorSetCapSize validators + // STEP 0: Setup genesis with GetValidatorSetCapSize validators // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) @@ -497,7 +453,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { ) require.NoError(t, err) - // STEP 2: Try and add an extra validator + // STEP 1: Try and add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) extraValCreds, extraValAddr, _ := generateTestExecutionAddress(t, rndSeed) var ( @@ -518,15 +474,9 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{extraValDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraValDeposit}, }, ) @@ -546,7 +496,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { require.NoError(t, err) require.Equal(t, extraValDeposit.Amount, extraValBalance) - // STEP 3: show that following block must contain withdrawals for + // STEP 2: show that following block must contain withdrawals for // the rejected validator blk2 := buildNextBlock( t, @@ -606,11 +556,12 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { var ( maxBalance = math.Gwei(cs.MaxEffectiveBalance()) - minBalance = math.Gwei(cs.EffectiveBalanceIncrement()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) rndSeed = 2024 // seed used to generate unique random value ) - // STEP 1: Setup genesis with GetValidatorSetCapSize validators + // STEP 0: Setup genesis with GetValidatorSetCapSize validators // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) @@ -640,7 +591,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { genAddresses = append(genAddresses, addr) } // make a deposit small to be ready for eviction - genDeposits[0].Amount = maxBalance - minBalance + genDeposits[0].Amount = minBalance + increment smallestVal := genDeposits[0] smallestValAddr := genAddresses[0] @@ -659,7 +610,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { require.NoError(t, err) require.Len(t, genVals, len(genDeposits)) - // STEP 2: Add an extra validator + // STEP 1: Add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) extraValCreds, _, _ := generateTestExecutionAddress(t, rndSeed) var ( @@ -680,15 +631,9 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: 10, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, // no withdrawals - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{extraValDeposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraValDeposit}, }, ) @@ -718,7 +663,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { math.Epoch(constants.FarFutureEpoch), extraVal.WithdrawableEpoch, ) - // STEP 3: show that following block must contain withdrawals for + // STEP 2: show that following block must contain withdrawals for // the evicted, smallest validator blk2 := buildNextBlock( t, @@ -748,23 +693,17 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { require.NoError(t, err) require.Empty(t, vals) // no vals changes expected before next epoch - // STEP 4: moving chain forward to next epoch to see extra validator + // STEP 3: moving chain forward to next epoch to see extra validator // be activated, just replaced - var blk = blk2 + var blk *types.BeaconBlock for i := 2; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, bs, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -777,15 +716,9 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{}, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -805,6 +738,203 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { require.Equal(t, extraVal.Pubkey, addedVals[0].Pubkey) } +// show that eviction mechanism works fine even if multiple evictions +// happen in the same epoch. +func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { + // Create state processor to test + cs := spec.BetnetChainSpec() + execEngine := mocks.NewExecutionEngine[ + *types.ExecutionPayload, + *types.ExecutionPayloadHeader, + engineprimitives.Withdrawals, + ](t) + mocksSigner := &cryptomocks.BLSSigner{} + dummyProposerAddr := []byte{0xff} + + sp := createStateProcessor( + cs, + execEngine, + mocksSigner, + func(bytes.B48) ([]byte, error) { + return dummyProposerAddr, nil + }, + ) + + kvStore, err := initStore() + require.NoError(t, err) + bs := new(TestBeaconStateT).NewFromDB(kvStore, cs) + + var ( + maxBalance = math.Gwei(cs.MaxEffectiveBalance()) + increment = math.Gwei(cs.EffectiveBalanceIncrement()) + minBalance = math.Gwei(cs.EjectionBalance()) + rndSeed = 2024 // seed used to generate unique random value + ) + + // STEP 0: fill genesis with validators till cap. Let two of them + // have smaller balance than others, so to be amenable for eviction. + var ( + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) + genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() + genVersion = version.FromUint32[common.Version](version.Deneb) + ) + + // let genesis define all available validators + genAddresses := make([]common.ExecutionAddress, 0) + for idx := range cs.GetValidatorSetCapSize() { + var ( + key bytes.B48 + creds types.WithdrawalCredentials + addr common.ExecutionAddress + ) + key, rndSeed = generateTestPK(t, rndSeed) + creds, addr, rndSeed = generateTestExecutionAddress(t, rndSeed) + + genDeposits = append(genDeposits, + &types.Deposit{ + Pubkey: key, + Credentials: creds, + Amount: maxBalance, + Index: uint64(idx), + }, + ) + genAddresses = append(genAddresses, addr) + } + // make a deposit small to be ready for eviction + genDeposits[0].Amount = minBalance + increment + smallest1Val := genDeposits[0] + smallest1ValAddr := genAddresses[0] + + genDeposits[1].Amount = minBalance + 2*increment + smallest2Val := genDeposits[1] + // smallest2ValAddr := genAddresses[1] + + mocksSigner.On( + "VerifySignature", + mock.Anything, mock.Anything, mock.Anything, + ).Return(nil) + + var genVals transition.ValidatorUpdates + genVals, err = sp.InitializePreminedBeaconStateFromEth1( + bs, + genDeposits, + genPayloadHeader, + genVersion, + ) + require.NoError(t, err) + require.Len(t, genVals, len(genDeposits)) + + // STEP 1: Add an extra validator + extraVal1Key, rndSeed := generateTestPK(t, rndSeed) + extraVal1Creds, _, _ := generateTestExecutionAddress(t, rndSeed) + var ( + ctx = &transition.Context{ + SkipPayloadVerification: true, + SkipValidateResult: true, + ProposerAddress: dummyProposerAddr, + } + extraValDeposit1 = &types.Deposit{ + Pubkey: extraVal1Key, + Credentials: extraVal1Creds, + Amount: maxBalance, + Index: uint64(len(genDeposits)), + } + ) + + blk1 := buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraValDeposit1}, + }, + ) + + // run the test + vals, err := sp.Transition(ctx, bs, blk1) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + + // check the smallest validator Withdraw epoch is updated + smallVal1Idx, err := bs.ValidatorIndexByPubkey(smallest1Val.Pubkey) + require.NoError(t, err) + smallVal1, err := bs.ValidatorByIndex(smallVal1Idx) + require.NoError(t, err) + require.Equal(t, math.Slot(0), smallVal1.WithdrawableEpoch) + + smallVal1Balance, err := bs.GetBalance(smallVal1Idx) + require.NoError(t, err) + require.Equal(t, smallest1Val.Amount, smallVal1Balance) + + // check that extra validator is added + extraVal1Idx, err := bs.ValidatorIndexByPubkey(extraVal1Key) + require.NoError(t, err) + extraVal1, err := bs.ValidatorByIndex(extraVal1Idx) + require.NoError(t, err) + require.Equal(t, + math.Epoch(constants.FarFutureEpoch), extraVal1.WithdrawableEpoch, + ) + + // STEP 2: add a second, large deposit to evict second smallest validator + extraVal2Key, rndSeed := generateTestPK(t, rndSeed) + extraVal2Creds, _, _ := generateTestExecutionAddress(t, rndSeed) + extraVal2Deposit := &types.Deposit{ + Pubkey: extraVal2Key, + Credentials: extraVal2Creds, + Amount: maxBalance, + Index: uint64(len(genDeposits) + 1), + } + + blk2 := buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: smallVal1Idx, + Address: smallest1ValAddr, + Amount: smallest1Val.Amount, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraVal2Deposit}, + }, + ) + + // run the test + vals, err = sp.Transition(ctx, bs, blk2) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + + // check the second smallest validator Withdraw epoch is updated + smallVal2Idx, err := bs.ValidatorIndexByPubkey(smallest2Val.Pubkey) + require.NoError(t, err) + smallVal2, err := bs.ValidatorByIndex(smallVal2Idx) + require.NoError(t, err) + require.Equal(t, math.Slot(0), smallVal2.WithdrawableEpoch) + + smallVal2Balance, err := bs.GetBalance(smallVal2Idx) + require.NoError(t, err) + require.Equal(t, smallest2Val.Amount, smallVal2Balance) + + // check that extra validator is added + extraVal2Idx, err := bs.ValidatorIndexByPubkey(extraVal2Key) + require.NoError(t, err) + extraVal2, err := bs.ValidatorByIndex(extraVal2Idx) + require.NoError(t, err) + require.Equal(t, + math.Epoch(constants.FarFutureEpoch), extraVal2.WithdrawableEpoch, + ) +} + func generateTestExecutionAddress( t *testing.T, rndSeed int, From 0cbd9814d7389ce92cebdf6571bc621e3eec69d2 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 11 Nov 2024 00:32:05 +0100 Subject: [PATCH 68/77] fixed double evictions --- .../pkg/core/state_processor_staking.go | 68 ++++++++------- .../pkg/core/state_processor_staking_test.go | 87 ++++++++++++++++++- 2 files changed, 122 insertions(+), 33 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 979e3c329e..9ac16ae89b 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -177,18 +177,28 @@ func (sp *StateProcessor[ // breaches the cap, we find the validator with the smallest stake and // mark it as withdrawable so that it will be eventually evicted and // its deposits returned. - capHit, err := sp.isValidatorCapHit(st) + + if sp.processingGenesis { + // minor optimization: we do check in Genesis that + // validators do no exceed cap. So hitting cap here + // should never happen + return sp.addValidatorInternal(st, val, dep.GetAmount()) + } + + candidateVals, err := sp.candidatesForEviction(st) if err != nil { return err } - if !capHit { + //#nosec:G701 // no overflow risk here + if uint32(len(candidateVals)) < sp.cs.GetValidatorSetCapSize() { + // cap not hit, just add the validator return sp.addValidatorInternal(st, val, dep.GetAmount()) } // Adding the validator would breach the cap. Find the validator // with the smallest stake among current and candidate validators // and kit it out. - currSmallestVal, err := sp.findSmallestValidator(st) + smallestVal, err := sp.smallest(candidateVals) if err != nil { return err } @@ -199,7 +209,7 @@ func (sp *StateProcessor[ } epoch := sp.cs.SlotToEpoch(slot) - if val.GetEffectiveBalance() <= currSmallestVal.GetEffectiveBalance() { + if val.GetEffectiveBalance() <= smallestVal.GetEffectiveBalance() { // in case of tie-break among candidate validator we prefer // existing one so we mark candidate as withdrawable val.SetWithdrawableEpoch(epoch) @@ -207,51 +217,51 @@ func (sp *StateProcessor[ } // mark exiting validator for eviction and add candidate - currSmallestVal.SetWithdrawableEpoch(epoch) - idx, err := st.ValidatorIndexByPubkey(currSmallestVal.GetPubkey()) + smallestVal.SetWithdrawableEpoch(epoch) + idx, err := st.ValidatorIndexByPubkey(smallestVal.GetPubkey()) if err != nil { return err } - if err = st.UpdateValidatorAtIndex(idx, currSmallestVal); err != nil { + if err = st.UpdateValidatorAtIndex(idx, smallestVal); err != nil { return err } return sp.addValidatorInternal(st, val, dep.GetAmount()) } func (sp *StateProcessor[ - _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, _, _, _, _, _, -]) isValidatorCapHit(st BeaconStateT) (bool, error) { - if sp.processingGenesis { - // minor optimization: we do check in Genesis that - // validators do no exceed cap. So hitting cap here - // should never happen - return false, nil + _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, +]) candidatesForEviction(st BeaconStateT) ([]ValidatorT, error) { + slot, err := st.GetSlot() + if err != nil { + return nil, err } - validators, err := st.GetValidators() + epoch := sp.cs.SlotToEpoch(slot) + + vals, err := st.GetValidators() if err != nil { - return false, err + return nil, err + } + activeVals := make([]ValidatorT, 0, len(vals)) + for _, val := range vals { + if val.GetEffectiveBalance() <= math.U64(sp.cs.EjectionBalance()) { + continue + } + if val.GetWithdrawableEpoch() == epoch { + continue + } + activeVals = append(activeVals, val) } - //#nosec:G701 // no overflow risk here - return uint32(len(validators)) >= sp.cs.GetValidatorSetCapSize(), nil + return activeVals, nil } // TODO: consider moving this to BeaconState directly func (sp *StateProcessor[ - _, _, _, BeaconStateT, _, DepositT, _, _, _, _, _, _, ValidatorT, _, _, _, _, -]) findSmallestValidator(st BeaconStateT) ( + _, _, _, _, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, +]) smallest(currentVals []ValidatorT) ( ValidatorT, error, ) { - var smallestVal ValidatorT - - // candidateVal would breach the cap. Find the validator with the - // smallest stake among current and candidate validators. - currentVals, err := st.GetValidatorsByEffectiveBalance() - if err != nil { - return smallestVal, err - } - // TODO: consider heapifying slice instead. We only care about the smallest slices.SortFunc(currentVals, func(lhs, rhs ValidatorT) int { var ( 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 cc849e21c7..3d04ddc56a 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -740,6 +740,8 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // show that eviction mechanism works fine even if multiple evictions // happen in the same epoch. +// +//nolint:maintidx // will simplify func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -806,8 +808,8 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { smallest1ValAddr := genAddresses[0] genDeposits[1].Amount = minBalance + 2*increment - smallest2Val := genDeposits[1] - // smallest2ValAddr := genAddresses[1] + smallestVal2 := genDeposits[1] + smallestVal2Addr := genAddresses[1] mocksSigner.On( "VerifySignature", @@ -915,7 +917,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { require.Empty(t, vals) // no vals changes expected before next epoch // check the second smallest validator Withdraw epoch is updated - smallVal2Idx, err := bs.ValidatorIndexByPubkey(smallest2Val.Pubkey) + smallVal2Idx, err := bs.ValidatorIndexByPubkey(smallestVal2.Pubkey) require.NoError(t, err) smallVal2, err := bs.ValidatorByIndex(smallVal2Idx) require.NoError(t, err) @@ -923,7 +925,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { smallVal2Balance, err := bs.GetBalance(smallVal2Idx) require.NoError(t, err) - require.Equal(t, smallest2Val.Amount, smallVal2Balance) + require.Equal(t, smallestVal2.Amount, smallVal2Balance) // check that extra validator is added extraVal2Idx, err := bs.ValidatorIndexByPubkey(extraVal2Key) @@ -933,6 +935,83 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { require.Equal(t, math.Epoch(constants.FarFutureEpoch), extraVal2.WithdrawableEpoch, ) + + // STEP 3: withdraw and move to next epoch + blk3 := buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 1, + Validator: smallVal2Idx, + Address: smallestVal2Addr, + Amount: smallestVal2.Amount, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + // run the test + vals, err = sp.Transition(ctx, bs, blk3) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// + + var blk *types.BeaconBlock + for i := 3; i < int(cs.SlotsPerEpoch())-1; i++ { + blk = buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + vals, err = sp.Transition(ctx, bs, blk) + require.NoError(t, err) + require.Empty(t, vals) // no vals changes expected before next epoch + } + + blk = buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + vals, err = sp.Transition(ctx, bs, blk) + require.NoError(t, err) + require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) + require.Len(t, vals, len(genDeposits)) // just replaced two validators + + // check that we removed the smallest validators at the epoch turn + removedVals := ValUpdatesDiff(genVals, vals) + require.Len(t, removedVals, 2) + require.Equal(t, smallVal1.Pubkey, removedVals[0].Pubkey) + require.Equal(t, smallVal2.Pubkey, removedVals[1].Pubkey) + + // check that we added the incoming validator at the epoch turn + addedVals := ValUpdatesDiff(vals, genVals) + require.Len(t, addedVals, 2) + require.Equal(t, extraVal1.Pubkey, addedVals[0].Pubkey) + require.Equal(t, extraVal2.Pubkey, addedVals[1].Pubkey) } func generateTestExecutionAddress( From 52c4689bdfb029fca9d48238a67d43c3893da761 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 11 Nov 2024 10:11:27 +0100 Subject: [PATCH 69/77] fixed eviction epoch --- .../pkg/core/state_processor_committee.go | 15 +- .../pkg/core/state_processor_staking.go | 21 ++- .../pkg/core/state_processor_staking_test.go | 177 ++++++++---------- 3 files changed, 98 insertions(+), 115 deletions(-) diff --git a/mod/state-transition/pkg/core/state_processor_committee.go b/mod/state-transition/pkg/core/state_processor_committee.go index 13c55a0be1..2080704bb7 100644 --- a/mod/state-transition/pkg/core/state_processor_committee.go +++ b/mod/state-transition/pkg/core/state_processor_committee.go @@ -37,12 +37,23 @@ func (sp *StateProcessor[ return nil, err } + slot, err := st.GetSlot() + if err != nil { + return nil, err + } + // at this state we have not yet updated the slot + incomingEpoch := sp.cs.SlotToEpoch(slot + 1) + // filter out validators whose effective balance is not sufficient to validate activeVals := make([]ValidatorT, 0, len(vals)) for _, val := range vals { - if val.GetEffectiveBalance() > math.U64(sp.cs.EjectionBalance()) { - activeVals = append(activeVals, val) + if val.GetEffectiveBalance() <= math.U64(sp.cs.EjectionBalance()) { + continue + } + if val.GetWithdrawableEpoch() == incomingEpoch { + continue } + activeVals = append(activeVals, val) } // TODO: a more efficient handling would be to only send back to consensus diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 9ac16ae89b..bf2b346736 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -185,12 +185,12 @@ func (sp *StateProcessor[ return sp.addValidatorInternal(st, val, dep.GetAmount()) } - candidateVals, err := sp.candidatesForEviction(st) + nextEpochVals, err := sp.nextEpochValidatorSet(st) if err != nil { return err } //#nosec:G701 // no overflow risk here - if uint32(len(candidateVals)) < sp.cs.GetValidatorSetCapSize() { + if uint32(len(nextEpochVals)) < sp.cs.GetValidatorSetCapSize() { // cap not hit, just add the validator return sp.addValidatorInternal(st, val, dep.GetAmount()) } @@ -198,7 +198,7 @@ func (sp *StateProcessor[ // Adding the validator would breach the cap. Find the validator // with the smallest stake among current and candidate validators // and kit it out. - smallestVal, err := sp.smallest(candidateVals) + smallestVal, err := sp.smallest(nextEpochVals) if err != nil { return err } @@ -207,17 +207,18 @@ func (sp *StateProcessor[ if err != nil { return err } - epoch := sp.cs.SlotToEpoch(slot) + nextEpoch := sp.cs.SlotToEpoch(slot) + 1 if val.GetEffectiveBalance() <= smallestVal.GetEffectiveBalance() { // in case of tie-break among candidate validator we prefer // existing one so we mark candidate as withdrawable - val.SetWithdrawableEpoch(epoch) + // We wait next epoch to return funds, as a way to curb spamming + val.SetWithdrawableEpoch(nextEpoch) return sp.addValidatorInternal(st, val, dep.GetAmount()) } // mark exiting validator for eviction and add candidate - smallestVal.SetWithdrawableEpoch(epoch) + smallestVal.SetWithdrawableEpoch(nextEpoch) idx, err := st.ValidatorIndexByPubkey(smallestVal.GetPubkey()) if err != nil { return err @@ -228,14 +229,16 @@ func (sp *StateProcessor[ return sp.addValidatorInternal(st, val, dep.GetAmount()) } +// nextEpochValidatorSet returns the current estimation of what next epoch +// validator set would be. func (sp *StateProcessor[ _, _, _, BeaconStateT, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, -]) candidatesForEviction(st BeaconStateT) ([]ValidatorT, error) { +]) nextEpochValidatorSet(st BeaconStateT) ([]ValidatorT, error) { slot, err := st.GetSlot() if err != nil { return nil, err } - epoch := sp.cs.SlotToEpoch(slot) + withdrawEpoch := sp.cs.SlotToEpoch(slot) + 1 vals, err := st.GetValidators() if err != nil { @@ -246,7 +249,7 @@ func (sp *StateProcessor[ if val.GetEffectiveBalance() <= math.U64(sp.cs.EjectionBalance()) { continue } - if val.GetWithdrawableEpoch() == epoch { + if val.GetWithdrawableEpoch() == withdrawEpoch { continue } activeVals = append(activeVals, val) 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 3d04ddc56a..0d218bb70a 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -381,9 +381,8 @@ func TestTransitionCreateValidator(t *testing.T) { } // TestTransitionHittingValidatorsCap shows that the extra -// validator added when validators set is at cap is immediately -// scheduled for withdrawal along with its deposit if it does not -// improve staked amount. +// validator added when validators set is at cap gets never activated +// and its deposit is returned at after next epoch starts. func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -490,15 +489,31 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { extraVal, err := bs.ValidatorByIndex(extraValIdx) require.NoError(t, err) require.Equal(t, extraValDeposit.Pubkey, extraVal.Pubkey) - require.Equal(t, math.Slot(0), extraVal.WithdrawableEpoch) + require.Equal(t, math.Slot(1), extraVal.WithdrawableEpoch) extraValBalance, err := bs.GetBalance(extraValIdx) require.NoError(t, err) require.Equal(t, extraValDeposit.Amount, extraValBalance) - // STEP 2: show that following block must contain withdrawals for - // the rejected validator - blk2 := buildNextBlock( + // STEP 2: move the chain to the next epoch and show withdrawals + // for rejected validator are enqueuued then + var blk *types.BeaconBlock + for i := 2; i < int(cs.SlotsPerEpoch()); i++ { + blk = buildNextBlock( + t, + bs, + &types.BeaconBlockBody{ + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, + }, + ) + + _, err = sp.Transition(ctx, bs, blk) + require.NoError(t, err) + } + + blk = buildNextBlock( t, bs, &types.BeaconBlockBody{ @@ -522,14 +537,13 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { ) // run the test - _, err = sp.Transition(ctx, bs, blk2) + _, err = sp.Transition(ctx, bs, blk) require.NoError(t, err) } // TestTransitionHittingValidatorsCap shows that if the extra // validator added when validators set is at cap improves amount staked -// an existing validator is immediately scheduled for withdrawal -// along with its deposit. +// an existing validator is removed at the beginning of next epoch. func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -648,7 +662,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { require.NoError(t, err) smallVal, err := bs.ValidatorByIndex(smallValIdx) require.NoError(t, err) - require.Equal(t, math.Slot(0), smallVal.WithdrawableEpoch) + require.Equal(t, math.Slot(1), smallVal.WithdrawableEpoch) smallestValBalance, err := bs.GetBalance(smallValIdx) require.NoError(t, err) @@ -663,40 +677,10 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { math.Epoch(constants.FarFutureEpoch), extraVal.WithdrawableEpoch, ) - // STEP 2: show that following block must contain withdrawals for - // the evicted, smallest validator - blk2 := buildNextBlock( - t, - bs, - &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{ - { - Index: 0, - Validator: smallValIdx, - Address: smallestValAddr, - Amount: smallestVal.Amount, - }, - }, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, - }, - ) - - // run the test - vals, err = sp.Transition(ctx, bs, blk2) - require.NoError(t, err) - require.Empty(t, vals) // no vals changes expected before next epoch - - // STEP 3: moving chain forward to next epoch to see extra validator - // be activated, just replaced + // STEP 2: move chain to next epoch to see extra validator + // be activated and withdraws for evicted validator var blk *types.BeaconBlock - for i := 2; i < int(cs.SlotsPerEpoch())-1; i++ { + for i := 1; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, bs, @@ -716,9 +700,22 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: dummyExecutionPayload, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: smallValIdx, + Address: smallestValAddr, + Amount: smallestVal.Amount, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) @@ -740,8 +737,6 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // show that eviction mechanism works fine even if multiple evictions // happen in the same epoch. -// -//nolint:maintidx // will simplify func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -863,7 +858,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { require.NoError(t, err) smallVal1, err := bs.ValidatorByIndex(smallVal1Idx) require.NoError(t, err) - require.Equal(t, math.Slot(0), smallVal1.WithdrawableEpoch) + require.Equal(t, math.Slot(1), smallVal1.WithdrawableEpoch) smallVal1Balance, err := bs.GetBalance(smallVal1Idx) require.NoError(t, err) @@ -892,22 +887,9 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{ - { - Index: 0, - Validator: smallVal1Idx, - Address: smallest1ValAddr, - Amount: smallest1Val.Amount, - }, - }, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{extraVal2Deposit}, + ExecutionPayload: dummyExecutionPayload, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{extraVal2Deposit}, }, ) @@ -921,7 +903,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { require.NoError(t, err) smallVal2, err := bs.ValidatorByIndex(smallVal2Idx) require.NoError(t, err) - require.Equal(t, math.Slot(0), smallVal2.WithdrawableEpoch) + require.Equal(t, math.Slot(1), smallVal2.WithdrawableEpoch) smallVal2Balance, err := bs.GetBalance(smallVal2Idx) require.NoError(t, err) @@ -936,41 +918,9 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { math.Epoch(constants.FarFutureEpoch), extraVal2.WithdrawableEpoch, ) - // STEP 3: withdraw and move to next epoch - blk3 := buildNextBlock( - t, - bs, - &types.BeaconBlockBody{ - ExecutionPayload: &types.ExecutionPayload{ - Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, - ExtraData: []byte("testing"), - Transactions: [][]byte{}, - Withdrawals: []*engineprimitives.Withdrawal{ - { - Index: 1, - Validator: smallVal2Idx, - Address: smallestVal2Addr, - Amount: smallestVal2.Amount, - }, - }, - BaseFeePerGas: math.NewU256(0), - }, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, - }, - ) - - // run the test - vals, err = sp.Transition(ctx, bs, blk3) - require.NoError(t, err) - require.Empty(t, vals) // no vals changes expected before next epoch - - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - + // STEP 3: move to next epoch var blk *types.BeaconBlock - for i := 3; i < int(cs.SlotsPerEpoch())-1; i++ { + for i := 2; i < int(cs.SlotsPerEpoch())-1; i++ { blk = buildNextBlock( t, bs, @@ -990,9 +940,28 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { t, bs, &types.BeaconBlockBody{ - ExecutionPayload: dummyExecutionPayload, - Eth1Data: &types.Eth1Data{}, - Deposits: []*types.Deposit{}, + ExecutionPayload: &types.ExecutionPayload{ + Timestamp: blk1.Body.ExecutionPayload.Timestamp + 1, + ExtraData: []byte("testing"), + Transactions: [][]byte{}, + Withdrawals: []*engineprimitives.Withdrawal{ + { + Index: 0, + Validator: smallVal1Idx, + Address: smallest1ValAddr, + Amount: smallest1Val.Amount, + }, + { + Index: 1, + Validator: smallVal2Idx, + Address: smallestVal2Addr, + Amount: smallestVal2.Amount, + }, + }, + BaseFeePerGas: math.NewU256(0), + }, + Eth1Data: &types.Eth1Data{}, + Deposits: []*types.Deposit{}, }, ) From 80af1031b0774a67a7536235ba0b50ae9df7ace7 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 11 Nov 2024 10:57:51 +0100 Subject: [PATCH 70/77] appease rabbit --- mod/chain-spec/pkg/chain/chain_spec.go | 14 +++++++------- mod/chain-spec/pkg/chain/data.go | 5 ++++- mod/config/pkg/spec/testnet.go | 2 +- .../pkg/core/state_processor_genesis.go | 4 ++-- .../pkg/core/state_processor_staking.go | 6 +++--- .../pkg/core/state_processor_staking_test.go | 16 ++++++++-------- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 6055e0c88e..702fcd8c02 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -197,9 +197,9 @@ type Spec[ // slot. GetCometBFTConfigForSlot(slot SlotT) CometBFTConfigT - // GetValidatorSetCapSize retrieves the maximum number of validators - // allowed in the active set. - GetValidatorSetCapSize() uint32 + // GetValidatorSetCap retrieves the maximum number of + // validators allowed in the active set. + GetValidatorSetCap() uint32 } // chainSpec is a concrete implementation of the ChainSpec interface, holding @@ -512,10 +512,10 @@ func (c chainSpec[ return c.Data.CometValues } -// GetValidatorSetCapSize retrieves the maximum number of validators -// allowed in the active set. +// GetValidatorSetCapS retrieves the maximum number of +// validators allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, -]) GetValidatorSetCapSize() uint32 { - return c.Data.ValidatorSetCapSize +]) GetValidatorSetCap() uint32 { + return c.Data.ValidatorSetCap } diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index f0df965477..390cc5c190 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -155,5 +155,8 @@ type SpecData[ CometValues CometBFTConfigT `mapstructure:"comet-bft-config"` // Validators Set config - ValidatorSetCapSize uint32 `mapstructure:"validator-set-cap-size"` + // ValidatorSetCap is the maximum number of validators that can be active + // for a given epoch + // Note: ValidatorSetCap must be smaller than ValidatorRegistryLimit. + ValidatorSetCap uint32 `mapstructure:"validator-set-cap-size"` } diff --git a/mod/config/pkg/spec/testnet.go b/mod/config/pkg/spec/testnet.go index 358021660d..da11a74a58 100644 --- a/mod/config/pkg/spec/testnet.go +++ b/mod/config/pkg/spec/testnet.go @@ -126,6 +126,6 @@ func BaseSpec() chain.SpecData[ BytesPerBlob: 131072, KZGCommitmentInclusionProofDepth: 17, CometValues: cmtConsensusParams, - ValidatorSetCapSize: 256, + ValidatorSetCap: 256, } } diff --git a/mod/state-transition/pkg/core/state_processor_genesis.go b/mod/state-transition/pkg/core/state_processor_genesis.go index b0654e5af4..dfce15f5fa 100644 --- a/mod/state-transition/pkg/core/state_processor_genesis.go +++ b/mod/state-transition/pkg/core/state_processor_genesis.go @@ -109,9 +109,9 @@ func (sp *StateProcessor[ // BeaconKit enforces a cap on the validator set size. // If genesis deposits breaches the cap we return an error. //#nosec:G701 // can't overflow. - if uint32(len(deposits)) > sp.cs.GetValidatorSetCapSize() { + if uint32(len(deposits)) > sp.cs.GetValidatorSetCap() { return nil, fmt.Errorf("validator set cap %d, deposits count %d: %w", - sp.cs.GetValidatorSetCapSize(), + sp.cs.GetValidatorSetCap(), len(deposits), ErrHitValidatorsSetCap, ) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index bf2b346736..2edd54749b 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -175,7 +175,7 @@ func (sp *StateProcessor[ // BeaconKit enforces a cap on the validator set size. If the deposit // breaches the cap, we find the validator with the smallest stake and - // mark it as withdrawable so that it will be eventually evicted and + // mark it as withdrawable so that it will be evicted next epoch and // its deposits returned. if sp.processingGenesis { @@ -190,14 +190,14 @@ func (sp *StateProcessor[ return err } //#nosec:G701 // no overflow risk here - if uint32(len(nextEpochVals)) < sp.cs.GetValidatorSetCapSize() { + if uint32(len(nextEpochVals)) < sp.cs.GetValidatorSetCap() { // cap not hit, just add the validator return sp.addValidatorInternal(st, val, dep.GetAmount()) } // Adding the validator would breach the cap. Find the validator // with the smallest stake among current and candidate validators - // and kit it out. + // and kick it out. smallestVal, err := sp.smallest(nextEpochVals) if 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 0d218bb70a..b6fe475f49 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -415,13 +415,13 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // STEP 0: Setup genesis with GetValidatorSetCapSize validators // TODO: consider instead setting state artificially var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators - for idx := range cs.GetValidatorSetCapSize() { + for idx := range cs.GetValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -578,14 +578,14 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // STEP 0: Setup genesis with GetValidatorSetCapSize validators // TODO: consider instead setting state artificially var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators genAddresses := make([]common.ExecutionAddress, 0) - for idx := range cs.GetValidatorSetCapSize() { + for idx := range cs.GetValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -721,7 +721,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { vals, err = sp.Transition(ctx, bs, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) + require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCap()) require.Len(t, vals, len(genDeposits)) // just replaced one validator // check that we removed the smallest validator at the epoch turn @@ -771,14 +771,14 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // STEP 0: fill genesis with validators till cap. Let two of them // have smaller balance than others, so to be amenable for eviction. var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCapSize()) + genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators genAddresses := make([]common.ExecutionAddress, 0) - for idx := range cs.GetValidatorSetCapSize() { + for idx := range cs.GetValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -967,7 +967,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { vals, err = sp.Transition(ctx, bs, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCapSize()) + require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCap()) require.Len(t, vals, len(genDeposits)) // just replaced two validators // check that we removed the smallest validators at the epoch turn From 1cd96e8fa196c0de6b062870db58fa55a9f34f0b Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 11 Nov 2024 13:14:21 +0100 Subject: [PATCH 71/77] cleanup UTs and improved asserts --- .../pkg/core/state_processor_staking_test.go | 68 +++++++++++-------- 1 file changed, 41 insertions(+), 27 deletions(-) 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 e9a9ec2a68..85ab71d29f 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -410,7 +410,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { creds types.WithdrawalCredentials ) key, rndSeed = generateTestPK(t, rndSeed) - creds, _, rndSeed = generateTestExecutionAddress(t, rndSeed) + creds, rndSeed = generateTestExecutionAddress(t, rndSeed) genDeposits = append(genDeposits, &types.Deposit{ @@ -437,7 +437,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // STEP 1: Try and add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) - extraValCreds, extraValAddr, _ := generateTestExecutionAddress(t, rndSeed) + extraValCreds, _ := generateTestExecutionAddress(t, rndSeed) var ( ctx = &transition.Context{ SkipPayloadVerification: true, @@ -496,6 +496,8 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { require.NoError(t, err) } + extraValAddr, err := extraValCreds.ToExecutionAddress() + require.NoError(t, err) blk = buildNextBlock( t, bs, @@ -567,15 +569,13 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { ) // let genesis define all available validators - genAddresses := make([]common.ExecutionAddress, 0) for idx := range cs.GetValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials - addr common.ExecutionAddress ) key, rndSeed = generateTestPK(t, rndSeed) - creds, addr, rndSeed = generateTestExecutionAddress(t, rndSeed) + creds, rndSeed = generateTestExecutionAddress(t, rndSeed) genDeposits = append(genDeposits, &types.Deposit{ @@ -585,12 +585,12 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { Index: uint64(idx), }, ) - genAddresses = append(genAddresses, addr) } // make a deposit small to be ready for eviction genDeposits[0].Amount = minBalance + increment smallestVal := genDeposits[0] - smallestValAddr := genAddresses[0] + smallestValAddr, err := genDeposits[0].Credentials.ToExecutionAddress() + require.NoError(t, err) mocksSigner.On( "VerifySignature", @@ -609,7 +609,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // STEP 1: Add an extra validator extraValKey, rndSeed := generateTestPK(t, rndSeed) - extraValCreds, _, _ := generateTestExecutionAddress(t, rndSeed) + extraValCreds, _ := generateTestExecutionAddress(t, rndSeed) var ( ctx = &transition.Context{ SkipPayloadVerification: true, @@ -718,6 +718,8 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // show that eviction mechanism works fine even if multiple evictions // happen in the same epoch. +// +// //nolint:maintidx // TODO: simplify func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // Create state processor to test cs := spec.BetnetChainSpec() @@ -758,15 +760,13 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { ) // let genesis define all available validators - genAddresses := make([]common.ExecutionAddress, 0) for idx := range cs.GetValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials - addr common.ExecutionAddress ) key, rndSeed = generateTestPK(t, rndSeed) - creds, addr, rndSeed = generateTestExecutionAddress(t, rndSeed) + creds, rndSeed = generateTestExecutionAddress(t, rndSeed) genDeposits = append(genDeposits, &types.Deposit{ @@ -776,16 +776,17 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { Index: uint64(idx), }, ) - genAddresses = append(genAddresses, addr) } // make a deposit small to be ready for eviction genDeposits[0].Amount = minBalance + increment smallest1Val := genDeposits[0] - smallest1ValAddr := genAddresses[0] + smallest1ValAddr, err := genDeposits[0].Credentials.ToExecutionAddress() + require.NoError(t, err) genDeposits[1].Amount = minBalance + 2*increment smallestVal2 := genDeposits[1] - smallestVal2Addr := genAddresses[1] + smallestVal2Addr, err := genDeposits[1].Credentials.ToExecutionAddress() + require.NoError(t, err) mocksSigner.On( "VerifySignature", @@ -804,7 +805,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // STEP 1: Add an extra validator extraVal1Key, rndSeed := generateTestPK(t, rndSeed) - extraVal1Creds, _, rndSeed := generateTestExecutionAddress(t, rndSeed) + extraVal1Creds, rndSeed := generateTestExecutionAddress(t, rndSeed) var ( ctx = &transition.Context{ SkipPayloadVerification: true, @@ -814,7 +815,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { extraValDeposit1 = &types.Deposit{ Pubkey: extraVal1Key, Credentials: extraVal1Creds, - Amount: maxBalance, + Amount: maxBalance - increment, Index: uint64(len(genDeposits)), } ) @@ -856,7 +857,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // STEP 2: add a second, large deposit to evict second smallest validator extraVal2Key, rndSeed := generateTestPK(t, rndSeed) - extraVal2Creds, _, _ := generateTestExecutionAddress(t, rndSeed) + extraVal2Creds, _ := generateTestExecutionAddress(t, rndSeed) extraVal2Deposit := &types.Deposit{ Pubkey: extraVal2Key, Credentials: extraVal2Creds, @@ -951,23 +952,36 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCap()) require.Len(t, vals, 4) // just replaced two validators + // turn vals into map to avoid ordering issues + valsSet := make(map[string]*transition.ValidatorUpdate) + for _, v := range vals { + valsSet[v.Pubkey.String()] = v + } + require.Equal(t, len(vals), len(valsSet)) // no duplicates + // check that we added the incoming validator at the epoch turn - require.Equal(t, extraVal1.Pubkey, vals[0].Pubkey) - require.Equal(t, extraVal1.EffectiveBalance, vals[0].EffectiveBalance) - require.Equal(t, extraVal2.Pubkey, vals[1].Pubkey) - require.Equal(t, extraVal2.EffectiveBalance, vals[1].EffectiveBalance) + addedVal1, found := valsSet[extraVal1.Pubkey.String()] + require.True(t, found) + require.Equal(t, extraVal1.EffectiveBalance, addedVal1.EffectiveBalance) + + addedVal2, found := valsSet[extraVal2.Pubkey.String()] + require.True(t, found) + require.Equal(t, extraVal2.EffectiveBalance, addedVal2.EffectiveBalance) // check that we removed the smallest validators at the epoch turn - require.Equal(t, smallVal1.Pubkey, vals[2].Pubkey) - require.Equal(t, math.Gwei(0), vals[2].EffectiveBalance) - require.Equal(t, smallVal2.Pubkey, vals[3].Pubkey) - require.Equal(t, math.Gwei(0), vals[3].EffectiveBalance) + removedVal1, found := valsSet[smallVal1.Pubkey.String()] + require.True(t, found) + require.Equal(t, math.Gwei(0), removedVal1.EffectiveBalance) + + removeldVal2, found := valsSet[smallVal2.Pubkey.String()] + require.True(t, found) + require.Equal(t, math.Gwei(0), removeldVal2.EffectiveBalance) } func generateTestExecutionAddress( t *testing.T, rndSeed int, -) (types.WithdrawalCredentials, common.ExecutionAddress, int) { +) (types.WithdrawalCredentials, int) { t.Helper() addrStr := strconv.Itoa(rndSeed) @@ -977,7 +991,7 @@ func generateTestExecutionAddress( rndSeed++ return types.NewCredentialsFromExecutionAddress( common.ExecutionAddress(execAddr), - ), common.ExecutionAddress(execAddr), rndSeed + ), rndSeed } func generateTestPK(t *testing.T, rndSeed int) (bytes.B48, int) { From 78d6429859943b87338adf0830fd0e5838e743ff Mon Sep 17 00:00:00 2001 From: aBear Date: Fri, 29 Nov 2024 12:06:14 +0100 Subject: [PATCH 72/77] nit --- mod/chain-spec/pkg/chain/chain_spec.go | 2 +- mod/chain-spec/pkg/chain/data.go | 5 +-- mod/config/pkg/spec/boonet.go | 10 +++--- .../pkg/core/state_processor_staking.go | 32 +++++++++---------- .../pkg/core/state_processor_staking_test.go | 4 +-- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 7b39904b3c..58a396f1df 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -538,7 +538,7 @@ func (c chainSpec[ return c.Data.CometValues } -// GetValidatorSetCapS retrieves the maximum number of +// GetValidatorSetCap retrieves the maximum number of // validators allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index e50cd75a2d..8ddbc88153 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -129,8 +129,9 @@ type SpecData[ // operations allowed in a single payload. MaxWithdrawalsPerPayload uint64 `mapstructure:"max-withdrawals-per-payload"` // MaxValidatorsPerWithdrawalsSweep specifies the maximum number of - // validator - // withdrawals allowed per sweep. + // validator withdrawals allowed per sweep. + // Note: it should be prime with ValidatorSetCap to ensure every validator + // is visited eventually. MaxValidatorsPerWithdrawalsSweep uint64 `mapstructure:"max-validators-per-withdrawals-sweep"` // Deneb Values diff --git a/mod/config/pkg/spec/boonet.go b/mod/config/pkg/spec/boonet.go index dce02dfddd..9a7dec23da 100644 --- a/mod/config/pkg/spec/boonet.go +++ b/mod/config/pkg/spec/boonet.go @@ -49,14 +49,14 @@ func BoonetChainSpec() (chain.Spec[ // TODO: determine correct value for boonet upgrade. testnetSpec.EVMInflationPerBlock = 2.5e9 - // MaxValidatorsPerWithdrawalsSweep is 43 because we expect at least 46 - // validators in the total validators set. We choose a prime number smaller + // TODO: determine correct value for boonet upgrade. + testnetSpec.ValidatorSetCap = 46 + + // MaxValidatorsPerWithdrawalsSweep is 43 to be smaller than + // the validator set cap. We choose a prime number smaller // than the minimum amount of total validators possible. - // // TODO: Determine correct value for boonet upgrade. testnetSpec.MaxValidatorsPerWithdrawalsSweep = 43 - testnetSpec.ValidatorSetCap = 46 - return chain.NewChainSpec(testnetSpec) } diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index 6c62a332b1..c8005859fb 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -148,8 +148,8 @@ func (sp *StateProcessor[ st BeaconStateT, dep DepositT, ) error { - var val ValidatorT - val = val.New( + var candidateVal ValidatorT + candidateVal = candidateVal.New( dep.GetPubkey(), dep.GetWithdrawalCredentials(), dep.GetAmount(), @@ -169,13 +169,13 @@ func (sp *StateProcessor[ //#nosec:G701 // no overflow risk here if uint32(len(nextEpochVals)) < sp.cs.GetValidatorSetCap() { // cap not hit, just add the validator - return sp.addValidatorInternal(st, val, dep.GetAmount()) + return sp.addValidatorInternal(st, candidateVal, dep.GetAmount()) } // Adding the validator would breach the cap. Find the validator // with the smallest stake among current and candidate validators // and kick it out. - smallestVal, err := sp.smallest(nextEpochVals) + lowestStakeVal, err := sp.lowestStakeVal(nextEpochVals) if err != nil { return err } @@ -186,24 +186,24 @@ func (sp *StateProcessor[ } nextEpoch := sp.cs.SlotToEpoch(slot) + 1 - if val.GetEffectiveBalance() <= smallestVal.GetEffectiveBalance() { + if candidateVal.GetEffectiveBalance() <= lowestStakeVal.GetEffectiveBalance() { // in case of tie-break among candidate validator we prefer // existing one so we mark candidate as withdrawable // We wait next epoch to return funds, as a way to curb spamming - val.SetWithdrawableEpoch(nextEpoch) - return sp.addValidatorInternal(st, val, dep.GetAmount()) + candidateVal.SetWithdrawableEpoch(nextEpoch) + return sp.addValidatorInternal(st, candidateVal, dep.GetAmount()) } - // mark exiting validator for eviction and add candidate - smallestVal.SetWithdrawableEpoch(nextEpoch) - idx, err := st.ValidatorIndexByPubkey(smallestVal.GetPubkey()) + // mark existing validator for eviction and add candidate + lowestStakeVal.SetWithdrawableEpoch(nextEpoch) + idx, err := st.ValidatorIndexByPubkey(lowestStakeVal.GetPubkey()) if err != nil { return err } - if err = st.UpdateValidatorAtIndex(idx, smallestVal); err != nil { + if err = st.UpdateValidatorAtIndex(idx, lowestStakeVal); err != nil { return err } - return sp.addValidatorInternal(st, val, dep.GetAmount()) + return sp.addValidatorInternal(st, candidateVal, dep.GetAmount()) } // nextEpochValidatorSet returns the current estimation of what next epoch @@ -215,7 +215,7 @@ func (sp *StateProcessor[ if err != nil { return nil, err } - withdrawEpoch := sp.cs.SlotToEpoch(slot) + 1 + nextEpoch := sp.cs.SlotToEpoch(slot) + 1 vals, err := st.GetValidators() if err != nil { @@ -226,7 +226,7 @@ func (sp *StateProcessor[ if val.GetEffectiveBalance() <= math.U64(sp.cs.EjectionBalance()) { continue } - if val.GetWithdrawableEpoch() == withdrawEpoch { + if val.GetWithdrawableEpoch() == nextEpoch { continue } activeVals = append(activeVals, val) @@ -236,9 +236,9 @@ func (sp *StateProcessor[ } // TODO: consider moving this to BeaconState directly -func (sp *StateProcessor[ +func (*StateProcessor[ _, _, _, _, _, _, _, _, _, _, _, _, ValidatorT, _, _, _, _, -]) smallest(currentVals []ValidatorT) ( +]) lowestStakeVal(currentVals []ValidatorT) ( ValidatorT, error, ) { 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 3f75263ba6..9f90b5568f 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -586,7 +586,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { rndSeed = 2024 // seed used to generate unique random value ) - // STEP 0: Setup genesis with GetValidatorSetCapSize validators + // STEP 0: Setup genesis with GetValidatorSetCap validators // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) @@ -721,7 +721,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { rndSeed = 2024 // seed used to generate unique random value ) - // STEP 0: Setup genesis with GetValidatorSetCapSize validators + // STEP 0: Setup genesis with GetValidatorSetCap validators // TODO: consider instead setting state artificially var ( genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) From 4f90bfe6ba774f4202cd89da16ba2b53f1a39b83 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 2 Dec 2024 12:23:49 -0500 Subject: [PATCH 73/77] nit --- mod/config/pkg/spec/boonet.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mod/config/pkg/spec/boonet.go b/mod/config/pkg/spec/boonet.go index 5efe9713fe..2751670299 100644 --- a/mod/config/pkg/spec/boonet.go +++ b/mod/config/pkg/spec/boonet.go @@ -45,16 +45,13 @@ func BoonetChainSpec() (chain.Spec[ ) // BERA per block minting. - // - // TODO: determine correct value for boonet upgrade. boonetSpec.EVMInflationPerBlock = 2.5e9 boonetSpec.ValidatorSetCap = 256 - // MaxValidatorsPerWithdrawalsSweep is 43 to be smaller than - // the validator set cap. We choose a prime number smaller + // MaxValidatorsPerWithdrawalsSweep is 43 because we expect at least 46 + // validators in the total validators set. We choose a prime number smaller // than the minimum amount of total validators possible. - // TODO: Determine correct value for boonet upgrade. boonetSpec.MaxValidatorsPerWithdrawalsSweepPostUpgrade = 43 return chain.NewChainSpec(boonetSpec) From f36db5277e5d2844271c99a952fe04f28c09827d Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Mon, 2 Dec 2024 12:54:05 -0500 Subject: [PATCH 74/77] nit renaming + validation of valSetCap chain spec --- mod/chain-spec/pkg/chain/chain_spec.go | 12 ++++++++---- mod/chain-spec/pkg/chain/data.go | 2 +- mod/chain-spec/pkg/chain/errors.go | 6 ++++++ .../pkg/core/state_processor_staking.go | 2 +- .../pkg/core/state_processor_staking_test.go | 16 ++++++++-------- .../pkg/core/validation_deposits.go | 8 ++++---- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/mod/chain-spec/pkg/chain/chain_spec.go b/mod/chain-spec/pkg/chain/chain_spec.go index 322aae523c..18c8beeead 100644 --- a/mod/chain-spec/pkg/chain/chain_spec.go +++ b/mod/chain-spec/pkg/chain/chain_spec.go @@ -203,9 +203,9 @@ type Spec[ // Berachain Values - // GetValidatorSetCap retrieves the maximum number of + // ValidatorSetCap retrieves the maximum number of // validators allowed in the active set. - GetValidatorSetCap() uint32 + ValidatorSetCap() uint64 // EVMInflationAddress returns the address on the EVM which will receive // the inflation amount of native EVM balance through a withdrawal every @@ -258,6 +258,10 @@ func (c *chainSpec[ return ErrInsufficientMaxWithdrawalsPerPayload } + if c.ValidatorSetCap() > c.ValidatorRegistryLimit() { + return ErrInvalidValidatorSetCap + } + // EVM Inflation values can be zero or non-zero, no validation needed. // TODO: Add more validation rules here. @@ -549,11 +553,11 @@ func (c chainSpec[ return c.Data.CometValues } -// GetValidatorSetCap retrieves the maximum number of +// ValidatorSetCap retrieves the maximum number of // validators allowed in the active set. func (c chainSpec[ DomainTypeT, EpochT, ExecutionAddressT, SlotT, CometBFTConfigT, -]) GetValidatorSetCap() uint32 { +]) ValidatorSetCap() uint64 { return c.Data.ValidatorSetCap } diff --git a/mod/chain-spec/pkg/chain/data.go b/mod/chain-spec/pkg/chain/data.go index 1dc789d308..308198bde7 100644 --- a/mod/chain-spec/pkg/chain/data.go +++ b/mod/chain-spec/pkg/chain/data.go @@ -166,7 +166,7 @@ type SpecData[ // ValidatorSetCap is the maximum number of validators that can be active // for a given epoch // Note: ValidatorSetCap must be smaller than ValidatorRegistryLimit. - ValidatorSetCap uint32 `mapstructure:"validator-set-cap-size"` + ValidatorSetCap uint64 `mapstructure:"validator-set-cap-size"` // EVMInflationAddress is the address on the EVM which will receive the // inflation amount of native EVM balance through a withdrawal every block. EVMInflationAddress ExecutionAddressT `mapstructure:"evm-inflation-address"` diff --git a/mod/chain-spec/pkg/chain/errors.go b/mod/chain-spec/pkg/chain/errors.go index 6dc55f59ef..8efa26bc5f 100644 --- a/mod/chain-spec/pkg/chain/errors.go +++ b/mod/chain-spec/pkg/chain/errors.go @@ -29,4 +29,10 @@ var ( // per block. ErrInsufficientMaxWithdrawalsPerPayload = errors.New( "max withdrawals per payload must be greater than 1") + + // ErrInvalidValidatorSetCap is returned when the validator set cap is + // greater than the validator registry limit. + ErrInvalidValidatorSetCap = errors.New( + "validator set cap must be less than the validator registry limit", + ) ) diff --git a/mod/state-transition/pkg/core/state_processor_staking.go b/mod/state-transition/pkg/core/state_processor_staking.go index c8005859fb..2d74230552 100644 --- a/mod/state-transition/pkg/core/state_processor_staking.go +++ b/mod/state-transition/pkg/core/state_processor_staking.go @@ -167,7 +167,7 @@ func (sp *StateProcessor[ return err } //#nosec:G701 // no overflow risk here - if uint32(len(nextEpochVals)) < sp.cs.GetValidatorSetCap() { + if uint64(len(nextEpochVals)) < sp.cs.ValidatorSetCap() { // cap not hit, just add the validator return sp.addValidatorInternal(st, candidateVal, dep.GetAmount()) } 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 f7fc64dd69..9001850993 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -590,13 +590,13 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { // STEP 0: Setup genesis with GetValidatorSetCap validators // TODO: consider instead setting state artificially var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) + genDeposits = make([]*types.Deposit, 0, cs.ValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators - for idx := range cs.GetValidatorSetCap() { + for idx := range cs.ValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -725,13 +725,13 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { // STEP 0: Setup genesis with GetValidatorSetCap validators // TODO: consider instead setting state artificially var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) + genDeposits = make([]*types.Deposit, 0, cs.ValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators - for idx := range cs.GetValidatorSetCap() { + for idx := range cs.ValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -856,7 +856,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { vals, err = sp.Transition(ctx, st, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCap()) + require.LessOrEqual(t, uint32(len(vals)), cs.ValidatorSetCap()) require.Len(t, vals, 2) // just replaced one validator // check that we added the incoming validator at the epoch turn @@ -886,13 +886,13 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { // STEP 0: fill genesis with validators till cap. Let two of them // have smaller balance than others, so to be amenable for eviction. var ( - genDeposits = make([]*types.Deposit, 0, cs.GetValidatorSetCap()) + genDeposits = make([]*types.Deposit, 0, cs.ValidatorSetCap()) genPayloadHeader = new(types.ExecutionPayloadHeader).Empty() genVersion = version.FromUint32[common.Version](version.Deneb) ) // let genesis define all available validators - for idx := range cs.GetValidatorSetCap() { + for idx := range cs.ValidatorSetCap() { var ( key bytes.B48 creds types.WithdrawalCredentials @@ -1069,7 +1069,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { vals, err = sp.Transition(ctx, st, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.GetValidatorSetCap()) + require.LessOrEqual(t, uint32(len(vals)), cs.ValidatorSetCap()) require.Len(t, vals, 4) // just replaced two validators // turn vals into map to avoid ordering issues diff --git a/mod/state-transition/pkg/core/validation_deposits.go b/mod/state-transition/pkg/core/validation_deposits.go index 2d690aecd6..05353d3906 100644 --- a/mod/state-transition/pkg/core/validation_deposits.go +++ b/mod/state-transition/pkg/core/validation_deposits.go @@ -46,9 +46,9 @@ func (sp *StateProcessor[ // validators before we activate the fork. So we skip all validations // but the validator set cap. //#nosec:G701 // can't overflow. - if uint32(len(deposits)) > sp.cs.GetValidatorSetCap() { + if uint64(len(deposits)) > sp.cs.ValidatorSetCap() { return fmt.Errorf("validator set cap %d, deposits count %d: %w", - sp.cs.GetValidatorSetCap(), + sp.cs.ValidatorSetCap(), len(deposits), ErrHitValidatorsSetCap, ) @@ -87,9 +87,9 @@ func (sp *StateProcessor[ // BeaconKit enforces a cap on the validator set size. // If genesis deposits breaches the cap we return an error. //#nosec:G701 // can't overflow. - if uint32(len(deposits)) > sp.cs.GetValidatorSetCap() { + if uint64(len(deposits)) > sp.cs.ValidatorSetCap() { return fmt.Errorf("validator set cap %d, deposits count %d: %w", - sp.cs.GetValidatorSetCap(), + sp.cs.ValidatorSetCap(), len(deposits), ErrHitValidatorsSetCap, ) From 39b83ca1b59e6c2367572652fe49740acb6d68b1 Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Mon, 2 Dec 2024 12:56:31 -0500 Subject: [PATCH 75/77] boonet TODOs for values --- mod/config/pkg/spec/boonet.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mod/config/pkg/spec/boonet.go b/mod/config/pkg/spec/boonet.go index 2751670299..d46601a38e 100644 --- a/mod/config/pkg/spec/boonet.go +++ b/mod/config/pkg/spec/boonet.go @@ -45,13 +45,20 @@ func BoonetChainSpec() (chain.Spec[ ) // BERA per block minting. + // + // TODO: Determine correct value for boonet upgrade. boonetSpec.EVMInflationPerBlock = 2.5e9 + // ValidatorSetCap is 256 on the Boonet chain. + // + // TODO: Determine correct value for boonet upgrade. boonetSpec.ValidatorSetCap = 256 // MaxValidatorsPerWithdrawalsSweep is 43 because we expect at least 46 // validators in the total validators set. We choose a prime number smaller // than the minimum amount of total validators possible. + // + // TODO: Determine correct value for boonet upgrade. boonetSpec.MaxValidatorsPerWithdrawalsSweepPostUpgrade = 43 return chain.NewChainSpec(boonetSpec) From 355d99bb90a2313c2487faa8db34670690af6f45 Mon Sep 17 00:00:00 2001 From: aBear Date: Mon, 2 Dec 2024 14:40:53 -0500 Subject: [PATCH 76/77] appease linter --- .../pkg/core/state_processor_staking_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 9001850993..026c839b82 100644 --- a/mod/state-transition/pkg/core/state_processor_staking_test.go +++ b/mod/state-transition/pkg/core/state_processor_staking_test.go @@ -609,7 +609,7 @@ func TestTransitionHittingValidatorsCap_ExtraSmall(t *testing.T) { Pubkey: key, Credentials: creds, Amount: maxBalance, - Index: uint64(idx), + Index: idx, }, ) } @@ -744,7 +744,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { Pubkey: key, Credentials: creds, Amount: maxBalance, - Index: uint64(idx), + Index: idx, }, ) } @@ -856,7 +856,7 @@ func TestTransitionHittingValidatorsCap_ExtraBig(t *testing.T) { vals, err = sp.Transition(ctx, st, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.ValidatorSetCap()) + require.LessOrEqual(t, uint64(len(vals)), cs.ValidatorSetCap()) require.Len(t, vals, 2) // just replaced one validator // check that we added the incoming validator at the epoch turn @@ -905,7 +905,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { Pubkey: key, Credentials: creds, Amount: maxBalance, - Index: uint64(idx), + Index: idx, }, ) } @@ -1069,7 +1069,7 @@ func TestTransitionValidatorCap_DoubleEviction(t *testing.T) { vals, err = sp.Transition(ctx, st, blk) require.NoError(t, err) - require.LessOrEqual(t, uint32(len(vals)), cs.ValidatorSetCap()) + require.LessOrEqual(t, uint64(len(vals)), cs.ValidatorSetCap()) require.Len(t, vals, 4) // just replaced two validators // turn vals into map to avoid ordering issues From 0307a03281b22b6bf41f87493274137c22bf9d9e Mon Sep 17 00:00:00 2001 From: Cal Bera Date: Mon, 2 Dec 2024 15:15:19 -0500 Subject: [PATCH 77/77] nit renaming error val set cap exceeded --- mod/state-transition/pkg/core/errors.go | 6 +++--- mod/state-transition/pkg/core/validation_deposits.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/state-transition/pkg/core/errors.go b/mod/state-transition/pkg/core/errors.go index f8eb393dd0..69023189b9 100644 --- a/mod/state-transition/pkg/core/errors.go +++ b/mod/state-transition/pkg/core/errors.go @@ -23,9 +23,9 @@ package core import "github.com/berachain/beacon-kit/mod/errors" var ( - // ErrValidatorSetCapHit is returned when we try and add a validator - // that would breach validator set size cap. - ErrHitValidatorsSetCap = errors.New("hit validator set size cap") + // ErrValSetCapExceeded is returned when the number of genesis deposits + // exceeds the validator set cap. + ErrValSetCapExceeded = errors.New("validator set cap exceeded at genesis") // ErrBlockSlotTooLow is returned when the block slot is too low. ErrBlockSlotTooLow = errors.New("block slot too low") diff --git a/mod/state-transition/pkg/core/validation_deposits.go b/mod/state-transition/pkg/core/validation_deposits.go index 05353d3906..939b8336ab 100644 --- a/mod/state-transition/pkg/core/validation_deposits.go +++ b/mod/state-transition/pkg/core/validation_deposits.go @@ -50,7 +50,7 @@ func (sp *StateProcessor[ return fmt.Errorf("validator set cap %d, deposits count %d: %w", sp.cs.ValidatorSetCap(), len(deposits), - ErrHitValidatorsSetCap, + ErrValSetCapExceeded, ) } return nil @@ -91,7 +91,7 @@ func (sp *StateProcessor[ return fmt.Errorf("validator set cap %d, deposits count %d: %w", sp.cs.ValidatorSetCap(), len(deposits), - ErrHitValidatorsSetCap, + ErrValSetCapExceeded, ) } return nil