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 f78d98a
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 308 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
2 changes: 0 additions & 2 deletions pkg/topology/kademlia/internal/metrics/metrics_test.go
Expand Up @@ -30,8 +30,6 @@ func snapshot(t *testing.T, mc *metrics.Collector, sst time.Time, addr swarm.Add
}

func TestPeerMetricsCollector(t *testing.T) {
t.Parallel()

db, err := shed.NewDB("", nil)
if err != nil {
t.Fatal(err)
Expand Down
1 change: 0 additions & 1 deletion pkg/topology/kademlia/internal/waitnext/waitnext_test.go
Expand Up @@ -15,7 +15,6 @@ import (
)

func TestSet(t *testing.T) {
t.Parallel()

waitNext := waitnext.New()

Expand Down

0 comments on commit f78d98a

Please sign in to comment.