Skip to content

Commit

Permalink
nil ws url for sendonly nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaidashenko committed Oct 6, 2024
1 parent e19f473 commit 55b6efb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/chains/evm/client/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ func NewEvmClient(cfg evmconfig.NodePool, chainCfg commonclient.ChainConfig, cli
largePayloadRPCTimeout, defaultRPCTimeout := getRPCTimeouts(chainType)

for i, node := range nodes {
var ws *url.URL
if node.WSURL != nil {
ws = (*url.URL)(node.WSURL)
}
if node.SendOnly != nil && *node.SendOnly {
rpc := NewRPCClient(cfg, lggr, ws, (*url.URL)(node.HTTPURL), *node.Name, i, chainID,
rpc := NewRPCClient(cfg, lggr, nil, node.HTTPURL.URL(), *node.Name, i, chainID,
commonclient.Secondary, largePayloadRPCTimeout, defaultRPCTimeout, chainType)
sendonly := commonclient.NewSendOnlyNode(lggr, (url.URL)(*node.HTTPURL),
*node.Name, chainID, rpc)
sendonlys = append(sendonlys, sendonly)
} else {
rpc := NewRPCClient(cfg, lggr, ws, (*url.URL)(node.HTTPURL), *node.Name, i,
rpc := NewRPCClient(cfg, lggr, node.WSURL.URL(), node.HTTPURL.URL(), *node.Name, i,
chainID, commonclient.Primary, largePayloadRPCTimeout, defaultRPCTimeout, chainType)
primaryNode := commonclient.NewNode(cfg, chainCfg,
lggr, ws, (*url.URL)(node.HTTPURL), *node.Name, i, chainID, *node.Order,
lggr, node.WSURL.URL(), node.HTTPURL.URL(), *node.Name, i, chainID, *node.Order,
rpc, "EVM")
primaries = append(primaries, primaryNode)
}
Expand Down

0 comments on commit 55b6efb

Please sign in to comment.