mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
lntest: surface bitcoin backend rpc credentials
[skip ci]
This commit is contained in:
parent
fd63301dc5
commit
69ae56ad5c
@ -64,6 +64,11 @@ func (b BitcoindBackendConfig) DisconnectMiner() error {
|
|||||||
return b.rpcClient.AddNode(b.minerAddr, rpcclient.ANRemove)
|
return b.rpcClient.AddNode(b.minerAddr, rpcclient.ANRemove)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Credentials returns the rpc username, password and host for the backend.
|
||||||
|
func (b BitcoindBackendConfig) Credentials() (string, string, string, error) {
|
||||||
|
return b.rpcUser, b.rpcPass, b.rpcHost, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns the name of the backend type.
|
// Name returns the name of the backend type.
|
||||||
func (b BitcoindBackendConfig) Name() string {
|
func (b BitcoindBackendConfig) Name() string {
|
||||||
return "bitcoind"
|
return "bitcoind"
|
||||||
|
@ -67,6 +67,11 @@ func (b BtcdBackendConfig) DisconnectMiner() error {
|
|||||||
return b.harness.Client.Node(btcjson.NDisconnect, b.minerAddr, &temp)
|
return b.harness.Client.Node(btcjson.NDisconnect, b.minerAddr, &temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Credentials returns the rpc username, password and host for the backend.
|
||||||
|
func (b BtcdBackendConfig) Credentials() (string, string, string, error) {
|
||||||
|
return b.rpcConfig.User, b.rpcConfig.Pass, b.rpcConfig.Host, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns the name of the backend type.
|
// Name returns the name of the backend type.
|
||||||
func (b BtcdBackendConfig) Name() string {
|
func (b BtcdBackendConfig) Name() string {
|
||||||
return "btcd"
|
return "btcd"
|
||||||
|
@ -82,6 +82,10 @@ type BackendConfig interface {
|
|||||||
|
|
||||||
// Name returns the name of the backend type.
|
// Name returns the name of the backend type.
|
||||||
Name() string
|
Name() string
|
||||||
|
|
||||||
|
// Credentials returns the rpc username, password and host for the
|
||||||
|
// backend.
|
||||||
|
Credentials() (string, string, string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NodeConfig is the basic interface a node configuration must implement.
|
// NodeConfig is the basic interface a node configuration must implement.
|
||||||
|
@ -42,6 +42,12 @@ func (b NeutrinoBackendConfig) DisconnectMiner() error {
|
|||||||
return fmt.Errorf("unimplemented")
|
return fmt.Errorf("unimplemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Credentials returns the rpc username, password and host for the backend.
|
||||||
|
// For neutrino, we return an error because there is no rpc client available.
|
||||||
|
func (b NeutrinoBackendConfig) Credentials() (string, string, string, error) {
|
||||||
|
return "", "", "", fmt.Errorf("unimplemented")
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns the name of the backend type.
|
// Name returns the name of the backend type.
|
||||||
func (b NeutrinoBackendConfig) Name() string {
|
func (b NeutrinoBackendConfig) Name() string {
|
||||||
return NeutrinoBackendName
|
return NeutrinoBackendName
|
||||||
|
Loading…
Reference in New Issue
Block a user