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

Remove ClientErrors interface from common #13279

Merged
merged 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
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
1 change: 1 addition & 0 deletions common/config/clienterrors.go
DylanTinianov marked this conversation as resolved.
Show resolved Hide resolved
DylanTinianov marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package config
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
Loading