multi: remove dead code
This commit is contained in:
71 files changed
+35
-766
No files matched your search
@@ -8,13 +8,6 @@ import (
|
||||
"testing/quick"
|
||||
)
|
||||
|
||||
var (
|
||||
nID1 = NodeID([33]byte{1})
|
||||
nID2 = NodeID([33]byte{2})
|
||||
nID3 = NodeID([33]byte{3})
|
||||
nID4 = NodeID([33]byte{4})
|
||||
)
|
||||
|
||||
// TestWeightedChoiceEmptyMap tests that passing in an empty slice of weights
|
||||
// returns an error.
|
||||
func TestWeightedChoiceEmptyMap(t *testing.T) {
|
||||
@@ -95,7 +88,6 @@ type nonNegative []float64
|
||||
// Generate generates a value of type nonNegative to be used during
|
||||
// QuickTests.
|
||||
func (nonNegative) Generate(rand *rand.Rand, size int) reflect.Value {
|
||||
const precision = 100
|
||||
w := make([]float64, size)
|
||||
|
||||
for i := range w {
|
||||
|
||||
@@ -74,10 +74,6 @@ var chanGraphs = []struct {
|
||||
// TestPrefAttachmentSelectEmptyGraph ensures that when passed an
|
||||
// empty graph, the NodeSores function always returns a score of 0.
|
||||
func TestPrefAttachmentSelectEmptyGraph(t *testing.T) {
|
||||
const (
|
||||
maxChanSize = btcutil.Amount(btcutil.SatoshiPerBitcoin)
|
||||
)
|
||||
|
||||
prefAttach := NewPrefAttachment()
|
||||
|
||||
// Create a random public key, which we will query to get a score for.
|
||||
@@ -123,47 +119,6 @@ func TestPrefAttachmentSelectEmptyGraph(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// completeGraph is a helper method that adds numNodes fully connected nodes to
|
||||
// the graph.
|
||||
func completeGraph(t *testing.T, g testGraph, numNodes int) {
|
||||
const chanCapacity = btcutil.SatoshiPerBitcoin
|
||||
nodes := make(map[int]*btcec.PublicKey)
|
||||
for i := 0; i < numNodes; i++ {
|
||||
for j := i + 1; j < numNodes; j++ {
|
||||
|
||||
node1 := nodes[i]
|
||||
node2 := nodes[j]
|
||||
edge1, edge2, err := g.addRandChannel(
|
||||
node1, node2, chanCapacity)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to generate channel: %v", err)
|
||||
}
|
||||
|
||||
if node1 == nil {
|
||||
pubKeyBytes := edge1.Peer.PubKey()
|
||||
nodes[i], err = btcec.ParsePubKey(
|
||||
pubKeyBytes[:], btcec.S256(),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to parse pubkey: %v",
|
||||
err)
|
||||
}
|
||||
}
|
||||
|
||||
if node2 == nil {
|
||||
pubKeyBytes := edge2.Peer.PubKey()
|
||||
nodes[j], err = btcec.ParsePubKey(
|
||||
pubKeyBytes[:], btcec.S256(),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to parse pubkey: %v",
|
||||
err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestPrefAttachmentSelectTwoVertexes ensures that when passed a
|
||||
// graph with only two eligible vertexes, then both are given the same score,
|
||||
// and the funds are appropriately allocated across each peer.
|
||||
|
||||
Reference in new issue
Block a user