Skip to content

Commit

Permalink
Decouple client tests (#12970)
Browse files Browse the repository at this point in the history
* Add first version of evm utils

* Remove unused context util

* Add WSServer tests

* Add NewLegacyTransaction test

* Decouple client tests

* Update NewTestChainScopedConfig to apply correct defaults

* Move testutils

* Update paths

* Add changeset
  • Loading branch information
dimriou authored May 14, 2024
1 parent 68a742f commit 1eb7180
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 88 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-poems-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Decouple client tests from core #internal
6 changes: 4 additions & 2 deletions core/chains/evm/client/chain_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/testutils"
)

func newMockRpc(t *testing.T) *mocks.RPCClient {
Expand All @@ -33,7 +35,7 @@ func TestChainClient_BatchCallContext(t *testing.T) {
t.Parallel()

t.Run("batch requests return errors", func(t *testing.T) {
ctx := testutils.Context(t)
ctx := tests.Context(t)
rpcError := errors.New("something went wrong")
blockNumResp := ""
blockNum := hexutil.EncodeBig(big.NewInt(42))
Expand Down
Loading

0 comments on commit 1eb7180

Please sign in to comment.