Skip to content

Commit

Permalink
Revert "refactor(kademlia): remove hacky config usage (#3360)"
Browse files Browse the repository at this point in the history
This reverts commit 9f93ee8.
  • Loading branch information
mrekucci committed Oct 20, 2022
1 parent cc46f71 commit 943790f
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 315 deletions.
15 changes: 8 additions & 7 deletions pkg/topology/kademlia/export_test.go
Expand Up @@ -5,16 +5,17 @@
package kademlia

var (
PruneOversaturatedBinsFunc = func(k *Kad) func(uint8) {
TimeToRetry = &timeToRetry
SaturationPeers = &saturationPeers
OverSaturationPeers = &overSaturationPeers
BootnodeOverSaturationPeers = &bootNodeOverSaturationPeers
LowWaterMark = &nnLowWatermark
PruneOversaturatedBinsFunc = func(k *Kad) func(uint8) {
return k.pruneOversaturatedBins
}
GenerateCommonBinPrefixes = generateCommonBinPrefixes
)

const (
DefaultBitSuffixLength = defaultBitSuffixLength
DefaultSaturationPeers = defaultSaturationPeers
DefaultOverSaturationPeers = defaultOverSaturationPeers
PeerPingPollTime = &peerPingPollTime
BitSuffixLength = defaultBitSuffixLength
)

type PeerFilterFunc = peerFilterFunc
3 changes: 1 addition & 2 deletions pkg/topology/kademlia/internal/metrics/metrics_test.go
Expand Up @@ -29,9 +29,8 @@ func snapshot(t *testing.T, mc *metrics.Collector, sst time.Time, addr swarm.Add
return cs
}

// nolint:paralleltest
func TestPeerMetricsCollector(t *testing.T) {
t.Parallel()

db, err := shed.NewDB("", nil)
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/topology/kademlia/internal/waitnext/waitnext_test.go
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/ethersphere/bee/pkg/topology/kademlia/internal/waitnext"
)

// nolint:paralleltest
func TestSet(t *testing.T) {
t.Parallel()

waitNext := waitnext.New()

Expand Down

0 comments on commit 943790f

Please sign in to comment.