mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
lnrpc: add unit test covering too many hop hints
This commit is contained in:
parent
4ac6f82b5e
commit
5836d58a99
1 changed files with 30 additions and 0 deletions
|
@ -307,6 +307,36 @@ func TestSelectHopHints(t *testing.T) {
|
|||
numHints: 1,
|
||||
expectedHints: nil,
|
||||
},
|
||||
{
|
||||
// This test case reproduces a bug where we have too
|
||||
// many hop hints for our maximum hint number.
|
||||
name: "too many hints",
|
||||
setupMock: func(h *hopHintsConfigMock) {
|
||||
setMockChannelUsed(
|
||||
h, private1ShortID, privateChan1Policy,
|
||||
)
|
||||
|
||||
setMockChannelUsed(
|
||||
h, private2ShortID, privateChan2Policy,
|
||||
)
|
||||
|
||||
},
|
||||
// Set our amount to less than our channel balance of
|
||||
// 100.
|
||||
amount: 30,
|
||||
channels: []*HopHintInfo{
|
||||
privateChannel1, privateChannel2,
|
||||
},
|
||||
numHints: 1,
|
||||
expectedHints: [][]zpay32.HopHint{
|
||||
{
|
||||
privateChannel1Hint,
|
||||
},
|
||||
{
|
||||
privateChannel2Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// If a channel has more balance than the amount we're
|
||||
// looking for, it'll be added in our first pass. We
|
||||
|
|
Loading…
Add table
Reference in a new issue