@@ -27,6 +27,7 @@ import (
27
27
"github.com/libp2p/go-libp2p/p2p/net/swarm"
28
28
swarmt "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
29
29
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
30
+ useragent "github.com/libp2p/go-libp2p/p2p/protocol/identify/internal/user-agent"
30
31
"github.com/libp2p/go-libp2p/p2p/protocol/identify/pb"
31
32
32
33
mockClock "github.com/benbjohnson/clock"
@@ -44,9 +45,8 @@ func testKnowsAddrs(t *testing.T, h host.Host, p peer.ID, expected []ma.Multiadd
44
45
45
46
func testHasAgentVersion (t * testing.T , h host.Host , p peer.ID ) {
46
47
v , err := h .Peerstore ().Get (p , "AgentVersion" )
47
- if v .(string ) != "github.com/libp2p/go-libp2p" { // this is the default user agent
48
- t .Error ("agent version mismatch" , err )
49
- }
48
+ require .NoError (t , err , "fetching agent version" )
49
+ require .Equal (t , useragent .DefaultUserAgent (), v , "agent version" )
50
50
}
51
51
52
52
func testHasPublicKey (t * testing.T , h host.Host , p peer.ID , shouldBe ic.PubKey ) {
@@ -104,7 +104,7 @@ func emitAddrChangeEvt(t *testing.T, h host.Host) {
104
104
}
105
105
}
106
106
107
- // TestIDServiceWait gives the ID service 1s to finish after dialing
107
+ // TestIDService gives the ID service 1s to finish after dialing
108
108
// this is because it used to be concurrent. Now, Dial wait till the
109
109
// id service is done.
110
110
func TestIDService (t * testing.T ) {
0 commit comments