channeldb: remove dead code from payments test
This commit is contained in:
parent
3628e65378
commit
e636364ccf
@ -4,7 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -15,15 +14,12 @@ import (
|
|||||||
"github.com/lightningnetwork/lnd/lntypes"
|
"github.com/lightningnetwork/lnd/lntypes"
|
||||||
"github.com/lightningnetwork/lnd/record"
|
"github.com/lightningnetwork/lnd/record"
|
||||||
"github.com/lightningnetwork/lnd/routing/route"
|
"github.com/lightningnetwork/lnd/routing/route"
|
||||||
"github.com/lightningnetwork/lnd/tlv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
priv, _ = btcec.NewPrivateKey(btcec.S256())
|
priv, _ = btcec.NewPrivateKey(btcec.S256())
|
||||||
pub = priv.PubKey()
|
pub = priv.PubKey()
|
||||||
|
|
||||||
tlvBytes = []byte{1, 2, 3}
|
|
||||||
tlvEncoder = tlv.StubEncoder(tlvBytes)
|
|
||||||
testHop1 = &route.Hop{
|
testHop1 = &route.Hop{
|
||||||
PubKeyBytes: route.NewVertex(pub),
|
PubKeyBytes: route.NewVertex(pub),
|
||||||
ChannelID: 12345,
|
ChannelID: 12345,
|
||||||
@ -77,18 +73,6 @@ func makeFakeInfo() (*PaymentCreationInfo, *HTLCAttemptInfo) {
|
|||||||
return c, a
|
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) {
|
func TestSentPaymentSerialization(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user