Skip to content

Commit

Permalink
Remove ClientErrors interface from common (#13279)
Browse files Browse the repository at this point in the history
* Move ClientErrors interface to common

* Update blue-camels-promise.md

* Remove client errors from common

* Update blue-camels-promise.md

* Delete clienterrors.go
  • Loading branch information
DylanTinianov authored May 22, 2024
1 parent 6139126 commit 5a87f4a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-camels-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#changed Remove ClientErrors interface from common
3 changes: 0 additions & 3 deletions common/client/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -47,7 +45,6 @@ type NodeConfig interface {
SyncThreshold() uint32
NodeIsSyncingEnabled() bool
FinalizedBlockPollInterval() time.Duration
Errors() config.ClientErrors
}

type ChainConfig interface {
Expand Down
6 changes: 0 additions & 6 deletions common/client/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -19,7 +18,6 @@ type testNodeConfig struct {
syncThreshold uint32
nodeIsSyncingEnabled bool
finalizedBlockPollInterval time.Duration
errors config.ClientErrors
}

func (n testNodeConfig) PollFailureThreshold() uint32 {
Expand All @@ -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]]
}
Expand Down
4 changes: 1 addition & 3 deletions core/chains/evm/client/chain_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ 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"
"github.com/ethereum/go-ethereum/rpc"

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"
)

Expand Down
3 changes: 2 additions & 1 deletion core/chains/evm/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ 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"

"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"
)

Expand Down
4 changes: 3 additions & 1 deletion core/chains/evm/config/chain_scoped_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
6 changes: 3 additions & 3 deletions core/chains/evm/txmgr/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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}
}

Expand Down

0 comments on commit 5a87f4a

Please sign in to comment.