Skip to content

Commit

Permalink
more explicit name for option to disable signed addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
yusefnapora committed Nov 27, 2019
1 parent 028fe98 commit cf1cdad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion p2p/protocol/identify/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func TestCompatibilityWithPeersThatDoNotSupportSignedAddrs(t *testing.T) {
h1p := h1.ID()
h2p := h2.ID()
ids1 := identify.NewIDService(ctx, h1)
ids2 := identify.NewIDService(ctx, h2, identify.DisableSignedAddrSupport())
ids2 := identify.NewIDService(ctx, h2, identify.DisableSignedAddrSupportForTesting())

h2pi := h2.Peerstore().PeerInfo(h2p)
if err := h1.Connect(ctx, h2pi); err != nil {
Expand Down
5 changes: 3 additions & 2 deletions p2p/protocol/identify/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ func UserAgent(ua string) Option {
}
}

// DisableSignedAddrSupport prevents the identify service from sending or parsing
// DisableSignedAddrSupportForTesting prevents the identify service from sending or parsing
// routing.SignedRoutingState messages during the exchange. Used for testing
// compatibility with older versions that do not support signed addresses.
func DisableSignedAddrSupport() Option {
// Do not use in production!
func DisableSignedAddrSupportForTesting() Option {
return func(cfg *config) {
cfg.disableSignedAddrSupport = true
}
Expand Down

0 comments on commit cf1cdad

Please sign in to comment.