From 5a87f4a59e3c6c92b08ebefc5090017693785729 Mon Sep 17 00:00:00 2001 From: Dylan Tinianov Date: Wed, 22 May 2024 14:22:15 -0400 Subject: [PATCH] Remove ClientErrors interface from common (#13279) * Move ClientErrors interface to common * Update blue-camels-promise.md * Remove client errors from common * Update blue-camels-promise.md * Delete clienterrors.go --- .changeset/blue-camels-promise.md | 5 +++++ common/client/node.go | 3 --- common/client/node_test.go | 6 ------ core/chains/evm/client/chain_client.go | 4 +--- core/chains/evm/client/errors.go | 3 ++- core/chains/evm/config/chain_scoped_node_pool.go | 4 +++- core/chains/evm/txmgr/client.go | 6 +++--- 7 files changed, 14 insertions(+), 17 deletions(-) create mode 100644 .changeset/blue-camels-promise.md diff --git a/.changeset/blue-camels-promise.md b/.changeset/blue-camels-promise.md new file mode 100644 index 00000000000..48d7fd47565 --- /dev/null +++ b/.changeset/blue-camels-promise.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#changed Remove ClientErrors interface from common diff --git a/common/client/node.go b/common/client/node.go index bee1f3da3b8..1d0a799321b 100644 --- a/common/client/node.go +++ b/common/client/node.go @@ -9,8 +9,6 @@ import ( "sync" "time" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" - "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" @@ -47,7 +45,6 @@ type NodeConfig interface { SyncThreshold() uint32 NodeIsSyncingEnabled() bool FinalizedBlockPollInterval() time.Duration - Errors() config.ClientErrors } type ChainConfig interface { diff --git a/common/client/node_test.go b/common/client/node_test.go index 85c96145740..a97f26555a9 100644 --- a/common/client/node_test.go +++ b/common/client/node_test.go @@ -9,7 +9,6 @@ import ( clientMocks "github.com/smartcontractkit/chainlink/v2/common/client/mocks" "github.com/smartcontractkit/chainlink/v2/common/types" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" ) type testNodeConfig struct { @@ -19,7 +18,6 @@ type testNodeConfig struct { syncThreshold uint32 nodeIsSyncingEnabled bool finalizedBlockPollInterval time.Duration - errors config.ClientErrors } func (n testNodeConfig) PollFailureThreshold() uint32 { @@ -46,10 +44,6 @@ func (n testNodeConfig) FinalizedBlockPollInterval() time.Duration { return n.finalizedBlockPollInterval } -func (n testNodeConfig) Errors() config.ClientErrors { - return n.errors -} - type testNode struct { *node[types.ID, Head, NodeClient[types.ID, Head]] } diff --git a/core/chains/evm/client/chain_client.go b/core/chains/evm/client/chain_client.go index 3ee10a600da..04b1ff29387 100644 --- a/core/chains/evm/client/chain_client.go +++ b/core/chains/evm/client/chain_client.go @@ -5,8 +5,6 @@ import ( "math/big" "time" - evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -14,10 +12,10 @@ import ( commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" - commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/common/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index b7e0d9317eb..bcc8ff961f0 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -6,6 +6,8 @@ import ( "fmt" "regexp" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" pkgerrors "github.com/pkg/errors" @@ -13,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" commonclient "github.com/smartcontractkit/chainlink/v2/common/client" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/label" ) diff --git a/core/chains/evm/config/chain_scoped_node_pool.go b/core/chains/evm/config/chain_scoped_node_pool.go index 7f071e5506f..50269366829 100644 --- a/core/chains/evm/config/chain_scoped_node_pool.go +++ b/core/chains/evm/config/chain_scoped_node_pool.go @@ -38,4 +38,6 @@ func (n *NodePoolConfig) FinalizedBlockPollInterval() time.Duration { return n.C.FinalizedBlockPollInterval.Duration() } -func (n *NodePoolConfig) Errors() ClientErrors { return &clientErrorsConfig{c: n.C.Errors} } +func (n *NodePoolConfig) Errors() ClientErrors { + return &clientErrorsConfig{c: n.C.Errors} +} diff --git a/core/chains/evm/txmgr/client.go b/core/chains/evm/txmgr/client.go index 8ba3c841289..661a180af50 100644 --- a/core/chains/evm/txmgr/client.go +++ b/core/chains/evm/txmgr/client.go @@ -18,7 +18,7 @@ import ( commonclient "github.com/smartcontractkit/chainlink/v2/common/client" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" ) @@ -27,10 +27,10 @@ var _ TxmClient = (*evmTxmClient)(nil) type evmTxmClient struct { client client.Client - clientErrors evmconfig.ClientErrors + clientErrors config.ClientErrors } -func NewEvmTxmClient(c client.Client, clientErrors evmconfig.ClientErrors) *evmTxmClient { +func NewEvmTxmClient(c client.Client, clientErrors config.ClientErrors) *evmTxmClient { return &evmTxmClient{client: c, clientErrors: clientErrors} }