Skip to content

Commit

Permalink
Removed deprecated client constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Mar 5, 2024
1 parent 6b2229f commit 51a1b98
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions core/chains/legacyevm/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"errors"
"fmt"
"math/big"
"net/url"
"time"

gotoml "github.com/pelletier/go-toml/v2"
"go.uber.org/multierr"
Expand All @@ -18,8 +16,6 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox"

commonclient "github.com/smartcontractkit/chainlink/v2/common/client"
commonconfig "github.com/smartcontractkit/chainlink/v2/common/config"
"github.com/smartcontractkit/chainlink/v2/core/chains"
evmclient "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client"
evmconfig "github.com/smartcontractkit/chainlink/v2/core/chains/evm/config"
Expand Down Expand Up @@ -467,27 +463,3 @@ func (c *chain) HeadTracker() httypes.HeadTracker { return c.headTracker
func (c *chain) Logger() logger.Logger { return c.logger }
func (c *chain) BalanceMonitor() monitor.BalanceMonitor { return c.balanceMonitor }
func (c *chain) GasEstimator() gas.EvmFeeEstimator { return c.gasEstimator }

// Deprecated: use [pkg/github.com/smartcontractkit/chainlink/v2/core/chains/evm/client.NewEvmClient]
func newEthClientFromCfg(cfg evmconfig.NodePool, noNewHeadsThreshold time.Duration, lggr logger.Logger, chainID *big.Int, chainType commonconfig.ChainType, nodes []*toml.Node) evmclient.Client {
var empty url.URL
var primaries []commonclient.Node[*big.Int, *evmtypes.Head, evmclient.RPCClient]
var sendonlys []commonclient.SendOnlyNode[*big.Int, evmclient.RPCClient]
for i, node := range nodes {
if node.SendOnly != nil && *node.SendOnly {
rpc := evmclient.NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID,
commonclient.Secondary)
sendonly := commonclient.NewSendOnlyNode[*big.Int, evmclient.RPCClient](lggr, (url.URL)(*node.HTTPURL),
*node.Name, chainID, rpc)
sendonlys = append(sendonlys, sendonly)
} else {
rpc := evmclient.NewRPCClient(lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i),
chainID, commonclient.Primary)
primaryNode := commonclient.NewNode[*big.Int, *evmtypes.Head, evmclient.RPCClient](cfg, noNewHeadsThreshold,
lggr, (url.URL)(*node.WSURL), (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID, *node.Order,
rpc, "EVM")
primaries = append(primaries, primaryNode)
}
}
return evmclient.NewChainClient(lggr, cfg.SelectionMode(), cfg.LeaseDuration(), noNewHeadsThreshold, primaries, sendonlys, chainID, chainType)
}

0 comments on commit 51a1b98

Please sign in to comment.