Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mockgen: use typed mocks for compile time check #10103

Merged
merged 2 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 53 additions & 5 deletions cl/aggregation/mock_services/aggregation_pool_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cl/aggregation/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/ledgerwatch/erigon/cl/cltypes/solid"
)

//go:generate mockgen -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool
//go:generate mockgen -typed=true -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool
type AggregationPool interface {
// AddAttestation adds a single attestation to the pool.
AddAttestation(att *solid.Attestation) error
Expand Down
2 changes: 1 addition & 1 deletion cl/beacon/synced_data/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package synced_data

import "github.com/ledgerwatch/erigon/cl/phase1/core/state"

//go:generate mockgen -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData
//go:generate mockgen -typed=true -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData
type SyncedData interface {
OnHeadState(newState *state.CachingBeaconState) (err error)
HeadState() *state.CachingBeaconState
Expand Down
142 changes: 131 additions & 11 deletions cl/beacon/synced_data/mock_services/synced_data_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cl/phase1/core/state/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import libcommon "github.com/ledgerwatch/erigon-lib/common"

// BeaconStateReader is an interface for reading the beacon state.
//
//go:generate mockgen -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader
//go:generate mockgen -typed=true -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader
type BeaconStateReader interface {
ValidatorPublicKey(index int) (libcommon.Bytes48, error)
GetDomain(domainType [4]byte, epoch uint64) ([]byte, error)
Expand Down
Loading
Loading