zpay32: move HopHint and DefaultFinalCLTVDelta

This commit is contained in:
Joost Jager committed 2019-03-15 10:08:32 +01:00
1 parent 652ebb1652
commit 2be1051fb6
11 files changed
+70 -66

No files matched your search

+5 -6
View File
@@ -17,7 +17,6 @@ import (
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing"
litecoinCfg "github.com/ltcsuite/ltcd/chaincfg"
)
@@ -53,7 +52,7 @@ var (
testHopHintPubkeyBytes2, _ = hex.DecodeString("039e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255")
testHopHintPubkey2, _ = btcec.ParsePubKey(testHopHintPubkeyBytes2, btcec.S256())
testSingleHop = []routing.HopHint{
testSingleHop = []HopHint{
{
NodeID: testHopHintPubkey1,
ChannelID: 0x0102030405060708,
@@ -62,7 +61,7 @@ var (
CLTVExpiryDelta: 3,
},
}
testDoubleHop = []routing.HopHint{
testDoubleHop = []HopHint{
{
NodeID: testHopHintPubkey1,
ChannelID: 0x0102030405060708,
@@ -414,7 +413,7 @@ func TestDecodeEncode(t *testing.T) {
DescriptionHash: &testDescriptionHash,
Destination: testPubKey,
FallbackAddr: testRustyAddr,
RouteHints: [][]routing.HopHint{testSingleHop},
RouteHints: [][]HopHint{testSingleHop},
}
},
beforeEncoding: func(i *Invoice) {
@@ -437,7 +436,7 @@ func TestDecodeEncode(t *testing.T) {
DescriptionHash: &testDescriptionHash,
Destination: testPubKey,
FallbackAddr: testRustyAddr,
RouteHints: [][]routing.HopHint{testDoubleHop},
RouteHints: [][]HopHint{testDoubleHop},
}
},
beforeEncoding: func(i *Invoice) {
@@ -844,7 +843,7 @@ func compareHashes(a, b *[32]byte) bool {
return bytes.Equal(a[:], b[:])
}
func compareRouteHints(a, b []routing.HopHint) error {
func compareRouteHints(a, b []HopHint) error {
if len(a) != len(b) {
return fmt.Errorf("expected len routingInfo %d, got %d",
len(a), len(b))