From e636364ccfbc06c96991143221a41a9076187bf9 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Thu, 9 Apr 2020 19:06:39 +0200 Subject: [PATCH] channeldb: remove dead code from payments test --- channeldb/payments_test.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/channeldb/payments_test.go b/channeldb/payments_test.go index 1c6f09e6..b5228722 100644 --- a/channeldb/payments_test.go +++ b/channeldb/payments_test.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "math" - "math/rand" "reflect" "testing" "time" @@ -15,16 +14,13 @@ import ( "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/record" "github.com/lightningnetwork/lnd/routing/route" - "github.com/lightningnetwork/lnd/tlv" ) var ( priv, _ = btcec.NewPrivateKey(btcec.S256()) pub = priv.PubKey() - tlvBytes = []byte{1, 2, 3} - tlvEncoder = tlv.StubEncoder(tlvBytes) - testHop1 = &route.Hop{ + testHop1 = &route.Hop{ PubKeyBytes: route.NewVertex(pub), ChannelID: 12345, OutgoingTimeLock: 111, @@ -77,18 +73,6 @@ func makeFakeInfo() (*PaymentCreationInfo, *HTLCAttemptInfo) { return c, a } -// randomBytes creates random []byte with length in range [minLen, maxLen) -func randomBytes(minLen, maxLen int) ([]byte, error) { - randBuf := make([]byte, minLen+rand.Intn(maxLen-minLen)) - - if _, err := rand.Read(randBuf); err != nil { - return nil, fmt.Errorf("Internal error. "+ - "Cannot generate random string: %v", err) - } - - return randBuf, nil -} - func TestSentPaymentSerialization(t *testing.T) { t.Parallel()