@@ -23,7 +23,7 @@ import (
2323 "github.com/libp2p/go-libp2p/p2p/host/eventbus"
2424 "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
2525 rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
26- simlibp2p "github.com/libp2p/go-libp2p/x/simlibp2p"
26+ "github.com/libp2p/go-libp2p/x/simlibp2p"
2727 "github.com/marcopolo/simnet"
2828 "github.com/multiformats/go-multiaddr"
2929 "github.com/stretchr/testify/require"
@@ -87,7 +87,7 @@ func (ts *TestSuite) NewTestPeer(disableLogging bool) TestPeer {
8787 multiaddr .StringCast ("/ip4/127.0.0.1/tcp/0" ),
8888 multiaddr .StringCast ("/ip4/127.0.0.1/udp/0/quic-v1" ),
8989 }
90- return ts .newTestPeer (disableLogging , listenAddrs , nil )
90+ return ts .newTestPeerWithConfig (disableLogging , listenAddrs , nil , nil )
9191}
9292
9393type ConfigModifier func (* config.Config )
@@ -106,10 +106,6 @@ type SOCKS5PeerConfig struct {
106106 ProxyingEnabled bool
107107}
108108
109- func (ts * TestSuite ) newTestPeer (disableLogging bool , listenAddrs []multiaddr.Multiaddr , extraLibp2pOpts []libp2p.Option ) TestPeer {
110- return ts .newTestPeerWithConfig (disableLogging , listenAddrs , extraLibp2pOpts , nil )
111- }
112-
113109func (ts * TestSuite ) newTestPeerWithSOCKS5 (disableLogging bool , listenAddrs []multiaddr.Multiaddr , extraLibp2pOpts []libp2p.Option , socks5Conf * SOCKS5PeerConfig ) TestPeer {
114110 return ts .newTestPeerWithConfig (disableLogging , listenAddrs , extraLibp2pOpts , func (c * config.Config ) {
115111 if socks5Conf != nil {
@@ -178,7 +174,7 @@ func (ts *TestSuite) newTestPeerWithConfig(disableLogging bool, listenAddrs []mu
178174
179175 tp := TestPeer {
180176 app : app ,
181- api : apiclient .New (app .Api .Address ()),
177+ api : apiclient .NewWithAuth (app .Api .Address (), app . Conf . HttpBasicAuth . Username , app . Conf . HttpBasicAuth . Password ),
182178 tun : testTUN ,
183179 }
184180
0 commit comments