Skip to content

Commit

Permalink
Fix mocks and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantkumar1982 committed Mar 17, 2023
1 parent b441836 commit f6f7f31
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 12 deletions.
122 changes: 122 additions & 0 deletions common/txmgr/types/mocks/head.go

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

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

11 changes: 6 additions & 5 deletions core/chains/evm/headtracker/head_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"testing"
"time"

"golang.org/x/exp/maps"
"golang.org/x/exp/slices"

"github.com/smartcontractkit/chainlink/core/internal/testutils"
configtest "github.com/smartcontractkit/chainlink/core/internal/testutils/configtest/v2"
"github.com/smartcontractkit/chainlink/core/services/chainlink"
"github.com/smartcontractkit/chainlink/core/store/models"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"

"github.com/ethereum/go-ethereum"
gethCommon "github.com/ethereum/go-ethereum/common"
Expand All @@ -24,9 +25,9 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

txmmocks "github.com/smartcontractkit/chainlink/common/txmgr/types/mocks"
evmclient "github.com/smartcontractkit/chainlink/core/chains/evm/client"
"github.com/smartcontractkit/chainlink/core/chains/evm/headtracker"
htmocks "github.com/smartcontractkit/chainlink/core/chains/evm/headtracker/mocks"
httypes "github.com/smartcontractkit/chainlink/core/chains/evm/headtracker/types"
evmtypes "github.com/smartcontractkit/chainlink/core/chains/evm/types"
"github.com/smartcontractkit/chainlink/core/internal/cltest"
Expand Down Expand Up @@ -424,7 +425,7 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingEnabled(t *testing.T)

ethClient := evmtest.NewEthClientMockWithDefaultChain(t)

checker := htmocks.NewHeadTrackable(t)
checker := txmmocks.NewHeadTrackable[*evmtypes.Head](t)
orm := headtracker.NewORM(db, logger, config, *config.DefaultChainID())
ht := createHeadTrackerWithChecker(t, ethClient, evmtest.NewChainScopedConfig(t, config), orm, checker)

Expand Down Expand Up @@ -555,7 +556,7 @@ func TestHeadTracker_SwitchesToLongestChainWithHeadSamplingDisabled(t *testing.T

ethClient := evmtest.NewEthClientMockWithDefaultChain(t)

checker := htmocks.NewHeadTrackable(t)
checker := txmmocks.NewHeadTrackable[*evmtypes.Head](t)
orm := headtracker.NewORM(db, logger, config, cltest.FixtureChainID)
evmcfg := evmtest.NewChainScopedConfig(t, config)
ht := createHeadTrackerWithChecker(t, ethClient, evmcfg, orm, checker)
Expand Down

0 comments on commit f6f7f31

Please sign in to comment.