lntest: export ListenerFormat constant

This commit is contained in:
Oliver Gugger 2022-01-06 12:51:37 +01:00
parent 5afe7852b5
commit 8c3f2eaba0
No known key found for this signature in database
GPG key ID: 8E4256593F177720
2 changed files with 8 additions and 8 deletions

View file

@ -140,15 +140,15 @@ type NodeConfig struct {
}
func (cfg NodeConfig) P2PAddr() string {
return fmt.Sprintf(listenerFormat, cfg.P2PPort)
return fmt.Sprintf(ListenerFormat, cfg.P2PPort)
}
func (cfg NodeConfig) RPCAddr() string {
return fmt.Sprintf(listenerFormat, cfg.RPCPort)
return fmt.Sprintf(ListenerFormat, cfg.RPCPort)
}
func (cfg NodeConfig) RESTAddr() string {
return fmt.Sprintf(listenerFormat, cfg.RESTPort)
return fmt.Sprintf(ListenerFormat, cfg.RESTPort)
}
// DBDir returns the holding directory path of the graph database.

View file

@ -19,9 +19,9 @@ const (
// number and are determined by the results of nextAvailablePort().
defaultNodePort = 5555
// listenerFormat is the format string that is used to generate local
// ListenerFormat is the format string that is used to generate local
// listener addresses.
listenerFormat = "127.0.0.1:%d"
ListenerFormat = "127.0.0.1:%d"
// NeutrinoBackendName is the name of the neutrino backend.
NeutrinoBackendName = "neutrino"
@ -73,7 +73,7 @@ func NextAvailablePort() int {
// the harness node, in practice in CI servers this seems much
// less likely than simply some other process already being
// bound at the start of the tests.
addr := fmt.Sprintf(listenerFormat, port)
addr := fmt.Sprintf(ListenerFormat, port)
l, err := net.Listen("tcp4", addr)
if err == nil {
err := l.Close()
@ -117,8 +117,8 @@ func GetBtcdBinary() string {
// addresses with unique ports and should be used to overwrite rpctest's
// default generator which is prone to use colliding ports.
func GenerateBtcdListenerAddresses() (string, string) {
return fmt.Sprintf(listenerFormat, NextAvailablePort()),
fmt.Sprintf(listenerFormat, NextAvailablePort())
return fmt.Sprintf(ListenerFormat, NextAvailablePort()),
fmt.Sprintf(ListenerFormat, NextAvailablePort())
}
// MakeOutpoint returns the outpoint of the channel's funding transaction.