File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,18 @@ func (n *NetworkConfig) Validate() error {
141141 continue
142142 }
143143 }
144- // if the network is not forked, we need to validate RPC endpoints and private keys
145- if _ , httpOk := n .RpcHttpUrls [network ]; ! httpOk {
146- if _ , wsOk := n .RpcWsUrls [network ]; ! wsOk {
147- return fmt .Errorf ("at least one HTTP or WS RPC endpoint for %s network must be set" , network )
148- }
144+
145+ // If the network is not forked, we need to validate RPC endpoints and private keys
146+ _ , httpOk := n .RpcHttpUrls [network ]
147+ _ , wsOk := n .RpcWsUrls [network ]
148+ // WS can be present but only if HTTP is also available
149+ if wsOk && ! httpOk {
150+ return fmt .Errorf ("WS RPC endpoint for %s network is set without an HTTP endpoint; only HTTP or both HTTP and WS are allowed" , network )
151+ }
152+
153+ // Validate that there is at least one HTTP endpoint
154+ if ! httpOk {
155+ return fmt .Errorf ("at least one HTTP RPC endpoint for %s network must be set" , network )
149156 }
150157
151158 if _ , ok := n .WalletKeys [network ]; ! ok {
You can’t perform that action at this time.
0 commit comments