mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
lntest: export ListenerFormat constant
This commit is contained in:
parent
5afe7852b5
commit
8c3f2eaba0
2 changed files with 8 additions and 8 deletions
|
@ -140,15 +140,15 @@ type NodeConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg NodeConfig) P2PAddr() string {
|
func (cfg NodeConfig) P2PAddr() string {
|
||||||
return fmt.Sprintf(listenerFormat, cfg.P2PPort)
|
return fmt.Sprintf(ListenerFormat, cfg.P2PPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg NodeConfig) RPCAddr() string {
|
func (cfg NodeConfig) RPCAddr() string {
|
||||||
return fmt.Sprintf(listenerFormat, cfg.RPCPort)
|
return fmt.Sprintf(ListenerFormat, cfg.RPCPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cfg NodeConfig) RESTAddr() string {
|
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.
|
// DBDir returns the holding directory path of the graph database.
|
||||||
|
|
|
@ -19,9 +19,9 @@ const (
|
||||||
// number and are determined by the results of nextAvailablePort().
|
// number and are determined by the results of nextAvailablePort().
|
||||||
defaultNodePort = 5555
|
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.
|
// listener addresses.
|
||||||
listenerFormat = "127.0.0.1:%d"
|
ListenerFormat = "127.0.0.1:%d"
|
||||||
|
|
||||||
// NeutrinoBackendName is the name of the neutrino backend.
|
// NeutrinoBackendName is the name of the neutrino backend.
|
||||||
NeutrinoBackendName = "neutrino"
|
NeutrinoBackendName = "neutrino"
|
||||||
|
@ -73,7 +73,7 @@ func NextAvailablePort() int {
|
||||||
// the harness node, in practice in CI servers this seems much
|
// the harness node, in practice in CI servers this seems much
|
||||||
// less likely than simply some other process already being
|
// less likely than simply some other process already being
|
||||||
// bound at the start of the tests.
|
// bound at the start of the tests.
|
||||||
addr := fmt.Sprintf(listenerFormat, port)
|
addr := fmt.Sprintf(ListenerFormat, port)
|
||||||
l, err := net.Listen("tcp4", addr)
|
l, err := net.Listen("tcp4", addr)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err := l.Close()
|
err := l.Close()
|
||||||
|
@ -117,8 +117,8 @@ func GetBtcdBinary() string {
|
||||||
// addresses with unique ports and should be used to overwrite rpctest's
|
// addresses with unique ports and should be used to overwrite rpctest's
|
||||||
// default generator which is prone to use colliding ports.
|
// default generator which is prone to use colliding ports.
|
||||||
func GenerateBtcdListenerAddresses() (string, string) {
|
func GenerateBtcdListenerAddresses() (string, string) {
|
||||||
return fmt.Sprintf(listenerFormat, NextAvailablePort()),
|
return fmt.Sprintf(ListenerFormat, NextAvailablePort()),
|
||||||
fmt.Sprintf(listenerFormat, NextAvailablePort())
|
fmt.Sprintf(ListenerFormat, NextAvailablePort())
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeOutpoint returns the outpoint of the channel's funding transaction.
|
// MakeOutpoint returns the outpoint of the channel's funding transaction.
|
||||||
|
|
Loading…
Add table
Reference in a new issue