multi: use timeout field in dialer
This commit is contained in:
7 files changed
+35
-29
No files matched your search
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/tor"
|
||||
"github.com/lightningnetwork/lnd/watchtower/blob"
|
||||
"github.com/lightningnetwork/lnd/watchtower/wtclient"
|
||||
"github.com/lightningnetwork/lnd/watchtower/wtdb"
|
||||
@@ -84,7 +85,9 @@ func newMockNet(cb func(wtserver.Peer)) *mockNet {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *mockNet) Dial(network string, address string) (net.Conn, error) {
|
||||
func (m *mockNet) Dial(network string, address string,
|
||||
timeout time.Duration) (net.Conn, error) {
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -100,8 +103,9 @@ func (m *mockNet) ResolveTCPAddr(network string, address string) (*net.TCPAddr,
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (m *mockNet) AuthDial(local keychain.SingleKeyECDH, netAddr *lnwire.NetAddress,
|
||||
dialer func(string, string) (net.Conn, error)) (wtserver.Peer, error) {
|
||||
func (m *mockNet) AuthDial(local keychain.SingleKeyECDH,
|
||||
netAddr *lnwire.NetAddress,
|
||||
dialer tor.DialFunc) (wtserver.Peer, error) {
|
||||
|
||||
localPk := local.PubKey()
|
||||
localAddr := &net.TCPAddr{
|
||||
@@ -433,10 +437,8 @@ func newHarness(t *testing.T, cfg harnessCfg) *testHarness {
|
||||
clientDB := wtmock.NewClientDB()
|
||||
|
||||
clientCfg := &wtclient.Config{
|
||||
Signer: signer,
|
||||
Dial: func(string, string) (net.Conn, error) {
|
||||
return nil, nil
|
||||
},
|
||||
Signer: signer,
|
||||
Dial: mockNet.Dial,
|
||||
DB: clientDB,
|
||||
AuthDial: mockNet.AuthDial,
|
||||
SecretKeyRing: wtmock.NewSecretKeyRing(),
|
||||
|
||||
Reference in new issue
Block a user